diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index a8908359f48..afaf75af0f7 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -18223,6 +18223,310 @@ components: $ref: '#/components/schemas/DashboardListItemResponse' type: array type: object + DashboardSearchAggregationBucketKey: + description: Aggregation bucket with a single key value. + properties: + count: + description: Number of results in this bucket. + example: 18 + format: int64 + type: integer + value: + description: Key value for this bucket. + example: team:dashboards-backend + type: string + required: + - count + - value + type: object + DashboardSearchAggregationBucketMultiKey: + description: Aggregation bucket with multiple key values. + properties: + count: + description: Number of results in this bucket. + example: 8 + format: int64 + type: integer + value: + description: Key values for this bucket. + example: + - David Leonard + - david.leonard@datadoghq.com + items: + type: string + type: array + required: + - count + - value + type: object + DashboardSearchAggregations: + description: Aggregations of dashboard search results. + properties: + author: + description: Aggregation by author. + items: + $ref: '#/components/schemas/DashboardSearchAggregationBucketMultiKey' + type: array + is_shared: + description: Aggregation by share status. + items: + $ref: '#/components/schemas/DashboardSearchAggregationBucketKey' + type: array + share_type: + description: Aggregation by share type. + items: + $ref: '#/components/schemas/DashboardSearchAggregationBucketKey' + type: array + shared_by.handle: + description: Aggregation by who shared the dashboard. + items: + $ref: '#/components/schemas/DashboardSearchAggregationBucketKey' + type: array + status: + description: Aggregation by status. + items: + $ref: '#/components/schemas/DashboardSearchAggregationBucketKey' + type: array + tags: + description: Aggregation by tags. + items: + $ref: '#/components/schemas/DashboardSearchAggregationBucketKey' + type: array + template_variables.name: + description: Aggregation by template variable names. + items: + $ref: '#/components/schemas/DashboardSearchAggregationBucketKey' + type: array + type: + description: Aggregation by dashboard type. + items: + $ref: '#/components/schemas/DashboardSearchAggregationBucketKey' + type: array + widgets.metrics: + description: Aggregation by widget metrics. + items: + $ref: '#/components/schemas/DashboardSearchAggregationBucketKey' + type: array + widgets.type: + description: Aggregation by widget type. + items: + $ref: '#/components/schemas/DashboardSearchAggregationBucketKey' + type: array + type: object + DashboardSearchAttributes: + description: Dashboard search result attributes. + properties: + tags: + description: List of tags for the dashboard. + example: + - team:dashboards-backend + items: + type: string + type: array + title: + description: Title of the dashboard. + example: Public Dashboard Metadata caching + type: string + required: + - tags + - title + type: object + DashboardSearchMetadata: + description: Metadata about the dashboard. + properties: + author: + $ref: '#/components/schemas/DashboardSearchUser' + created_at: + description: Time at which the dashboard was created. + example: '2021-10-28T19:10:04.601117Z' + format: date-time + type: string + deleted_at: + description: Time at which the dashboard was deleted, or null if not deleted. + example: null + format: date-time + nullable: true + type: string + embeddable_domains: + description: List of domains the dashboard is allowed to be embedded in. + example: null + items: + type: string + nullable: true + type: array + experience_type: + description: Dashboard experience type. + example: default + type: string + expiration: + description: When the public dashboard link will expire. + example: null + format: date-time + nullable: true + type: string + has_monitors: + description: Whether the dashboard has monitors. + example: null + nullable: true + type: boolean + is_favorited: + description: Whether the dashboard is favorited by the user. + example: false + type: boolean + is_public_dashboard_ownerless: + description: Whether the public dashboard owner is deactivated. + example: false + type: boolean + is_shared: + description: Whether the dashboard is shared publicly. + example: true + type: boolean + last_accessed: + description: Last time the dashboard was accessed. + example: null + format: date-time + nullable: true + type: string + modified_at: + description: Time at which the dashboard was last updated. + example: '2024-02-16T12:43:31.942554Z' + format: date-time + type: string + popularity: + description: Relative measure of dashboard popularity. + example: 0 + format: double + type: number + public_title: + description: Published title of the public dashboard. + example: Public Dashboard Metadata caching + type: string + quality_score: + description: Quality score of the dashboard. + example: null + format: double + nullable: true + type: number + share_list: + description: List of email addresses for invite-only public dashboards. + example: [] + items: + type: string + nullable: true + type: array + share_type: + description: Share type of the public dashboard. + example: invite + type: string + shared_by: + $ref: '#/components/schemas/DashboardSearchUser' + status: + description: Status of the public dashboard. + example: active + type: string + token: + description: Unique public dashboard token. + example: yB5yjZ-f0d1a5802e21f5576f5e34feb9cddc4c + type: string + type: + description: Dashboard type. + example: custom_timeboard + type: string + url: + description: URL path to the dashboard. + example: /dashboard/e8y-qtx-r3w/public-dashboard-metadata-caching + type: string + widget_count: + description: Number of widgets in the dashboard. + example: 1 + format: int64 + type: integer + required: + - author + - created_at + - deleted_at + - is_favorited + - is_shared + - modified_at + - popularity + - quality_score + - has_monitors + - type + - url + - experience_type + - widget_count + - public_title + - shared_by + - is_public_dashboard_ownerless + - share_type + - share_list + - embeddable_domains + - last_accessed + - expiration + - status + - token + type: object + DashboardSearchResponse: + description: Response containing dashboard search results. + properties: + data: + description: List of dashboard search results. + items: + $ref: '#/components/schemas/DashboardSearchResultData' + type: array + meta: + $ref: '#/components/schemas/DashboardSearchResponseMeta' + required: + - data + - meta + type: object + DashboardSearchResponseMeta: + description: Metadata about the dashboard search results. + properties: + aggregations: + $ref: '#/components/schemas/DashboardSearchAggregations' + total: + description: Total number of dashboards found. + example: 18 + format: int64 + type: integer + required: + - total + type: object + DashboardSearchResultData: + description: A dashboard search result. + properties: + attributes: + $ref: '#/components/schemas/DashboardSearchAttributes' + id: + description: Dashboard identifier. + example: e8y-qtx-r3w + type: string + meta: + $ref: '#/components/schemas/DashboardSearchMetadata' + type: + $ref: '#/components/schemas/MetricDashboardType' + required: + - id + - type + - attributes + - meta + type: object + DashboardSearchUser: + description: User information. + properties: + handle: + description: User handle or email. + example: david.leonard@datadoghq.com + type: string + name: + description: User display name. + example: David Leonard + type: string + required: + - handle + - name + type: object DashboardTriggerWrapper: description: Schema for a Dashboard-based trigger. properties: @@ -37764,6 +38068,235 @@ components: meta: $ref: '#/components/schemas/MonthlyCostAttributionMeta' type: object + NotebookSearchAggregationBucketKey: + description: Aggregation bucket with a single key value. + properties: + count: + description: Number of results in this bucket. + example: 10 + format: int64 + type: integer + value: + description: Key value for this bucket. + example: team:notebooks-backend + type: string + required: + - count + - value + type: object + NotebookSearchAggregationBucketMultiKey: + description: Aggregation bucket with multiple key values. + properties: + count: + description: Number of results in this bucket. + example: 5 + format: int64 + type: integer + value: + description: Key values for this bucket. + example: + - User Name + - user@datadoghq.com + items: + type: string + type: array + required: + - count + - value + type: object + NotebookSearchAggregations: + description: Aggregations of notebook search results. + properties: + author: + description: Aggregation by author. + items: + $ref: '#/components/schemas/NotebookSearchAggregationBucketMultiKey' + type: array + tags: + description: Aggregation by tags. + items: + $ref: '#/components/schemas/NotebookSearchAggregationBucketKey' + type: array + template_variables.name: + description: Aggregation by template variable names. + items: + $ref: '#/components/schemas/NotebookSearchAggregationBucketKey' + type: array + type: + description: Aggregation by notebook type. + items: + $ref: '#/components/schemas/NotebookSearchAggregationBucketKey' + type: array + type: object + NotebookSearchAttributes: + description: Notebook search result attributes. + properties: + meta: + $ref: '#/components/schemas/NotebookSearchMetadata' + name: + description: Name of the notebook. + example: My Notebook + type: string + tags: + description: List of tags for the notebook. + example: + - team:notebooks-backend + items: + type: string + type: array + required: + - name + - tags + - meta + type: object + NotebookSearchHighlight: + description: Highlighted fields from the notebook search. + properties: + cells.text: + description: Highlighted cell text matches. + items: + type: string + type: array + cells.title: + description: Highlighted cell title matches. + items: + type: string + type: array + name: + description: Highlighted notebook name matches. + items: + type: string + type: array + type: object + NotebookSearchMetadata: + description: Metadata about the notebook. + properties: + author: + $ref: '#/components/schemas/NotebookSearchUser' + cell_count: + description: Number of cells in the notebook. + example: 5 + format: int64 + type: integer + created_at: + description: Time at which the notebook was created. + example: '2021-10-28T19:10:04.601117Z' + format: date-time + type: string + deleted_at: + description: Time at which the notebook was deleted, or null if not deleted. + example: null + format: date-time + nullable: true + type: string + experience_type: + description: Experience type of the notebook. + example: null + nullable: true + type: string + has_computational_cells: + description: Whether the notebook has computational cells. + example: false + type: boolean + is_favorited: + description: Whether the notebook is favorited by the user. + example: false + type: boolean + is_template: + description: Whether the notebook is a template. + example: false + type: boolean + modified_at: + description: Time at which the notebook was last updated. + example: '2024-02-16T12:43:31.942554Z' + format: date-time + type: string + status: + description: Status of the notebook. + example: published + type: string + take_snapshots: + description: Whether the notebook can take a snapshot. + example: false + type: boolean + type: + description: Notebook type. + example: notebook + type: string + required: + - author + - cell_count + - created_at + - deleted_at + - is_favorited + - is_template + - modified_at + - status + - take_snapshots + - type + - has_computational_cells + - experience_type + type: object + NotebookSearchResponse: + description: Response containing notebook search results. + properties: + data: + description: List of notebook search results. + items: + $ref: '#/components/schemas/NotebookSearchResultData' + type: array + meta: + $ref: '#/components/schemas/NotebookSearchResponseMeta' + required: + - data + - meta + type: object + NotebookSearchResponseMeta: + description: Metadata about the notebook search results. + properties: + aggregations: + $ref: '#/components/schemas/NotebookSearchAggregations' + total: + description: Total number of notebooks found. + example: 25 + format: int64 + type: integer + required: + - total + type: object + NotebookSearchResultData: + description: A notebook search result. + properties: + highlight: + $ref: '#/components/schemas/NotebookSearchHighlight' + id: + description: Notebook identifier. + example: '123456' + type: string + notebook_data: + $ref: '#/components/schemas/NotebookSearchAttributes' + type: + $ref: '#/components/schemas/MetricNotebookType' + required: + - id + - type + - notebook_data + type: object + NotebookSearchUser: + description: User information. + properties: + handle: + description: User handle or email. + example: user@datadoghq.com + type: string + name: + description: User display name. + example: User Name + type: string + required: + - handle + - name + type: object NotebookTriggerWrapper: description: Schema for a Notebook-based trigger. properties: @@ -75312,6 +75845,73 @@ paths: tags: - Dashboard Lists x-codegen-request-body-name: body + /api/v2/dashboards/search: + get: + description: Search for dashboards using a query string. + operationId: SearchDashboards + parameters: + - description: Search query string. + in: query + name: query + required: false + schema: + example: team:dashboards-backend + type: string + - description: Sort field for results. + in: query + name: sort + required: false + schema: + example: metadata.created_at + type: string + - description: Additional data to include in the response. + in: query + name: include + required: false + schema: + example: meta.aggregations + type: string + - description: Page number for pagination. + in: query + name: page + required: false + schema: + example: 0 + type: integer + - description: Maximum number of results to return. + in: query + name: limit + required: false + schema: + example: 10 + type: integer + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/DashboardSearchResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Service Unavailable + summary: Search dashboards + tags: + - Dashboards + x-unstable: '**Note**: This endpoint is in preview and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/datasets: get: description: Get all datasets that have been configured for an organization. @@ -85387,6 +85987,79 @@ paths: summary: Get all aggregated DNS traffic tags: - Cloud Network Monitoring + /api/v2/notebooks/search: + get: + description: Search for notebooks using a query string. + operationId: SearchNotebooks + parameters: + - description: Search query string. + in: query + name: query + required: false + schema: + example: team:notebooks-backend + type: string + - description: Sort field for results. + in: query + name: sort + required: false + schema: + example: metadata.created_at + type: string + - description: Additional data to include in the response. + in: query + name: include + required: false + schema: + example: meta.aggregations + type: string + - description: Page number for pagination. + in: query + name: page + required: false + schema: + example: 0 + type: integer + - description: Maximum number of results to return. + in: query + name: limit + required: false + schema: + example: 10 + type: integer + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/NotebookSearchResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Internal Server Error + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Service Unavailable + summary: Search notebooks + tags: + - Notebooks + x-unstable: '**Note**: This endpoint is in preview and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/obs-pipelines/pipelines: get: description: Retrieve a list of pipelines. @@ -102442,6 +103115,9 @@ tags: organization.' name: Dashboard Lists +- description: Interact with your dashboards through the API to search and retrieve + dashboards. + name: Dashboards - description: The Data Deletion API allows the user to target and delete data from the allowed products. It's currently enabled for Logs and RUM and depends on `logs_delete_data` and `rum_delete_data` permissions respectively. @@ -102686,6 +103362,9 @@ tags: and their attributes. See the [Network Device Monitoring page](https://docs.datadoghq.com/network_monitoring/) for more information. name: Network Device Monitoring +- description: Interact with your notebooks through the API to search and retrieve + notebooks. + name: Notebooks - description: Auto-generated tag OCI Integration name: OCI Integration - description: Observability Pipelines allows you to collect and process logs within diff --git a/examples/v2/dashboards/SearchDashboards.java b/examples/v2/dashboards/SearchDashboards.java new file mode 100644 index 00000000000..ccb62d7c817 --- /dev/null +++ b/examples/v2/dashboards/SearchDashboards.java @@ -0,0 +1,25 @@ +// Search dashboards returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.DashboardsApi; +import com.datadog.api.client.v2.model.DashboardSearchResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.searchDashboards", true); + DashboardsApi apiInstance = new DashboardsApi(defaultClient); + + try { + DashboardSearchResponse result = apiInstance.searchDashboards(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DashboardsApi#searchDashboards"); + 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/notebooks/SearchNotebooks.java b/examples/v2/notebooks/SearchNotebooks.java new file mode 100644 index 00000000000..f0a95d34319 --- /dev/null +++ b/examples/v2/notebooks/SearchNotebooks.java @@ -0,0 +1,25 @@ +// Search notebooks returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.NotebooksApi; +import com.datadog.api.client.v2.model.NotebookSearchResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.searchNotebooks", true); + NotebooksApi apiInstance = new NotebooksApi(defaultClient); + + try { + NotebookSearchResponse result = apiInstance.searchNotebooks(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling NotebooksApi#searchNotebooks"); + 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/ApiClient.java b/src/main/java/com/datadog/api/client/ApiClient.java index ed7b5418859..a4b1b32bd36 100644 --- a/src/main/java/com/datadog/api/client/ApiClient.java +++ b/src/main/java/com/datadog/api/client/ApiClient.java @@ -797,6 +797,7 @@ public class ApiClient { put("v2.muteFindings", false); put("v2.runThreatHuntingJob", false); put("v2.searchSecurityMonitoringHistsignals", false); + put("v2.searchDashboards", false); put("v2.createDataset", false); put("v2.deleteDataset", false); put("v2.getAllDatasets", false); @@ -894,6 +895,7 @@ public class ApiClient { put("v2.updateMonitorUserTemplate", false); put("v2.validateExistingMonitorUserTemplate", false); put("v2.validateMonitorUserTemplate", false); + put("v2.searchNotebooks", false); put("v2.listRoleTemplates", false); put("v2.createConnection", false); put("v2.deleteConnection", false); diff --git a/src/main/java/com/datadog/api/client/v2/api/DashboardsApi.java b/src/main/java/com/datadog/api/client/v2/api/DashboardsApi.java new file mode 100644 index 00000000000..e8cb2a714fc --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/api/DashboardsApi.java @@ -0,0 +1,296 @@ +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.DashboardSearchResponse; +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.concurrent.CompletableFuture; + +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DashboardsApi { + private ApiClient apiClient; + + public DashboardsApi() { + this(ApiClient.getDefaultApiClient()); + } + + public DashboardsApi(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; + } + + /** Manage optional parameters to searchDashboards. */ + public static class SearchDashboardsOptionalParameters { + private String query; + private String sort; + private String include; + private Integer page; + private Integer limit; + + /** + * Set query. + * + * @param query Search query string. (optional) + * @return SearchDashboardsOptionalParameters + */ + public SearchDashboardsOptionalParameters query(String query) { + this.query = query; + return this; + } + + /** + * Set sort. + * + * @param sort Sort field for results. (optional) + * @return SearchDashboardsOptionalParameters + */ + public SearchDashboardsOptionalParameters sort(String sort) { + this.sort = sort; + return this; + } + + /** + * Set include. + * + * @param include Additional data to include in the response. (optional) + * @return SearchDashboardsOptionalParameters + */ + public SearchDashboardsOptionalParameters include(String include) { + this.include = include; + return this; + } + + /** + * Set page. + * + * @param page Page number for pagination. (optional) + * @return SearchDashboardsOptionalParameters + */ + public SearchDashboardsOptionalParameters page(Integer page) { + this.page = page; + return this; + } + + /** + * Set limit. + * + * @param limit Maximum number of results to return. (optional) + * @return SearchDashboardsOptionalParameters + */ + public SearchDashboardsOptionalParameters limit(Integer limit) { + this.limit = limit; + return this; + } + } + + /** + * Search dashboards. + * + *

See {@link #searchDashboardsWithHttpInfo}. + * + * @return DashboardSearchResponse + * @throws ApiException if fails to make API call + */ + public DashboardSearchResponse searchDashboards() throws ApiException { + return searchDashboardsWithHttpInfo(new SearchDashboardsOptionalParameters()).getData(); + } + + /** + * Search dashboards. + * + *

See {@link #searchDashboardsWithHttpInfoAsync}. + * + * @return CompletableFuture<DashboardSearchResponse> + */ + public CompletableFuture searchDashboardsAsync() { + return searchDashboardsWithHttpInfoAsync(new SearchDashboardsOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Search dashboards. + * + *

See {@link #searchDashboardsWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return DashboardSearchResponse + * @throws ApiException if fails to make API call + */ + public DashboardSearchResponse searchDashboards(SearchDashboardsOptionalParameters parameters) + throws ApiException { + return searchDashboardsWithHttpInfo(parameters).getData(); + } + + /** + * Search dashboards. + * + *

See {@link #searchDashboardsWithHttpInfoAsync}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<DashboardSearchResponse> + */ + public CompletableFuture searchDashboardsAsync( + SearchDashboardsOptionalParameters parameters) { + return searchDashboardsWithHttpInfoAsync(parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Search for dashboards using a query string. + * + * @param parameters Optional parameters for the request. + * @return ApiResponse<DashboardSearchResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
429 Too many requests -
503 Service Unavailable -
+ */ + public ApiResponse searchDashboardsWithHttpInfo( + SearchDashboardsOptionalParameters parameters) throws ApiException { + // Check if unstable operation is enabled + String operationId = "searchDashboards"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + String query = parameters.query; + String sort = parameters.sort; + String include = parameters.include; + Integer page = parameters.page; + Integer limit = parameters.limit; + // create path and map variables + String localVarPath = "/api/v2/dashboards/search"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "query", query)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort", sort)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "include", include)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page", page)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "limit", limit)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.DashboardsApi.searchDashboards", + 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 dashboards. + * + *

See {@link #searchDashboardsWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<DashboardSearchResponse>> + */ + public CompletableFuture> searchDashboardsWithHttpInfoAsync( + SearchDashboardsOptionalParameters parameters) { + // Check if unstable operation is enabled + String operationId = "searchDashboards"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + String query = parameters.query; + String sort = parameters.sort; + String include = parameters.include; + Integer page = parameters.page; + Integer limit = parameters.limit; + // create path and map variables + String localVarPath = "/api/v2/dashboards/search"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "query", query)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort", sort)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "include", include)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page", page)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "limit", limit)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.DashboardsApi.searchDashboards", + 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() {}); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/api/NotebooksApi.java b/src/main/java/com/datadog/api/client/v2/api/NotebooksApi.java new file mode 100644 index 00000000000..8f21ea28e96 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/api/NotebooksApi.java @@ -0,0 +1,297 @@ +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.NotebookSearchResponse; +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.concurrent.CompletableFuture; + +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class NotebooksApi { + private ApiClient apiClient; + + public NotebooksApi() { + this(ApiClient.getDefaultApiClient()); + } + + public NotebooksApi(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; + } + + /** Manage optional parameters to searchNotebooks. */ + public static class SearchNotebooksOptionalParameters { + private String query; + private String sort; + private String include; + private Integer page; + private Integer limit; + + /** + * Set query. + * + * @param query Search query string. (optional) + * @return SearchNotebooksOptionalParameters + */ + public SearchNotebooksOptionalParameters query(String query) { + this.query = query; + return this; + } + + /** + * Set sort. + * + * @param sort Sort field for results. (optional) + * @return SearchNotebooksOptionalParameters + */ + public SearchNotebooksOptionalParameters sort(String sort) { + this.sort = sort; + return this; + } + + /** + * Set include. + * + * @param include Additional data to include in the response. (optional) + * @return SearchNotebooksOptionalParameters + */ + public SearchNotebooksOptionalParameters include(String include) { + this.include = include; + return this; + } + + /** + * Set page. + * + * @param page Page number for pagination. (optional) + * @return SearchNotebooksOptionalParameters + */ + public SearchNotebooksOptionalParameters page(Integer page) { + this.page = page; + return this; + } + + /** + * Set limit. + * + * @param limit Maximum number of results to return. (optional) + * @return SearchNotebooksOptionalParameters + */ + public SearchNotebooksOptionalParameters limit(Integer limit) { + this.limit = limit; + return this; + } + } + + /** + * Search notebooks. + * + *

See {@link #searchNotebooksWithHttpInfo}. + * + * @return NotebookSearchResponse + * @throws ApiException if fails to make API call + */ + public NotebookSearchResponse searchNotebooks() throws ApiException { + return searchNotebooksWithHttpInfo(new SearchNotebooksOptionalParameters()).getData(); + } + + /** + * Search notebooks. + * + *

See {@link #searchNotebooksWithHttpInfoAsync}. + * + * @return CompletableFuture<NotebookSearchResponse> + */ + public CompletableFuture searchNotebooksAsync() { + return searchNotebooksWithHttpInfoAsync(new SearchNotebooksOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Search notebooks. + * + *

See {@link #searchNotebooksWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return NotebookSearchResponse + * @throws ApiException if fails to make API call + */ + public NotebookSearchResponse searchNotebooks(SearchNotebooksOptionalParameters parameters) + throws ApiException { + return searchNotebooksWithHttpInfo(parameters).getData(); + } + + /** + * Search notebooks. + * + *

See {@link #searchNotebooksWithHttpInfoAsync}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<NotebookSearchResponse> + */ + public CompletableFuture searchNotebooksAsync( + SearchNotebooksOptionalParameters parameters) { + return searchNotebooksWithHttpInfoAsync(parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Search for notebooks using a query string. + * + * @param parameters Optional parameters for the request. + * @return ApiResponse<NotebookSearchResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
429 Too many requests -
500 Internal Server Error -
503 Service Unavailable -
+ */ + public ApiResponse searchNotebooksWithHttpInfo( + SearchNotebooksOptionalParameters parameters) throws ApiException { + // Check if unstable operation is enabled + String operationId = "searchNotebooks"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + String query = parameters.query; + String sort = parameters.sort; + String include = parameters.include; + Integer page = parameters.page; + Integer limit = parameters.limit; + // create path and map variables + String localVarPath = "/api/v2/notebooks/search"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "query", query)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort", sort)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "include", include)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page", page)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "limit", limit)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.NotebooksApi.searchNotebooks", + 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 notebooks. + * + *

See {@link #searchNotebooksWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<NotebookSearchResponse>> + */ + public CompletableFuture> searchNotebooksWithHttpInfoAsync( + SearchNotebooksOptionalParameters parameters) { + // Check if unstable operation is enabled + String operationId = "searchNotebooks"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + String query = parameters.query; + String sort = parameters.sort; + String include = parameters.include; + Integer page = parameters.page; + Integer limit = parameters.limit; + // create path and map variables + String localVarPath = "/api/v2/notebooks/search"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "query", query)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort", sort)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "include", include)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page", page)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "limit", limit)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.NotebooksApi.searchNotebooks", + 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() {}); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/DashboardSearchAggregationBucketKey.java b/src/main/java/com/datadog/api/client/v2/model/DashboardSearchAggregationBucketKey.java new file mode 100644 index 00000000000..da61b7682bf --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DashboardSearchAggregationBucketKey.java @@ -0,0 +1,175 @@ +/* + * 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; + +/** Aggregation bucket with a single key value. */ +@JsonPropertyOrder({ + DashboardSearchAggregationBucketKey.JSON_PROPERTY_COUNT, + DashboardSearchAggregationBucketKey.JSON_PROPERTY_VALUE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DashboardSearchAggregationBucketKey { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_COUNT = "count"; + private Long count; + + public static final String JSON_PROPERTY_VALUE = "value"; + private String value; + + public DashboardSearchAggregationBucketKey() {} + + @JsonCreator + public DashboardSearchAggregationBucketKey( + @JsonProperty(required = true, value = JSON_PROPERTY_COUNT) Long count, + @JsonProperty(required = true, value = JSON_PROPERTY_VALUE) String value) { + this.count = count; + this.value = value; + } + + public DashboardSearchAggregationBucketKey count(Long count) { + this.count = count; + return this; + } + + /** + * Number of results in this bucket. + * + * @return count + */ + @JsonProperty(JSON_PROPERTY_COUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getCount() { + return count; + } + + public void setCount(Long count) { + this.count = count; + } + + public DashboardSearchAggregationBucketKey value(String value) { + this.value = value; + return this; + } + + /** + * Key value for this bucket. + * + * @return value + */ + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + /** + * 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 DashboardSearchAggregationBucketKey + */ + @JsonAnySetter + public DashboardSearchAggregationBucketKey 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 DashboardSearchAggregationBucketKey object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DashboardSearchAggregationBucketKey dashboardSearchAggregationBucketKey = + (DashboardSearchAggregationBucketKey) o; + return Objects.equals(this.count, dashboardSearchAggregationBucketKey.count) + && Objects.equals(this.value, dashboardSearchAggregationBucketKey.value) + && Objects.equals( + this.additionalProperties, dashboardSearchAggregationBucketKey.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(count, value, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DashboardSearchAggregationBucketKey {\n"); + sb.append(" count: ").append(toIndentedString(count)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).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/DashboardSearchAggregationBucketMultiKey.java b/src/main/java/com/datadog/api/client/v2/model/DashboardSearchAggregationBucketMultiKey.java new file mode 100644 index 00000000000..ea9bf406806 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DashboardSearchAggregationBucketMultiKey.java @@ -0,0 +1,183 @@ +/* + * 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; + +/** Aggregation bucket with multiple key values. */ +@JsonPropertyOrder({ + DashboardSearchAggregationBucketMultiKey.JSON_PROPERTY_COUNT, + DashboardSearchAggregationBucketMultiKey.JSON_PROPERTY_VALUE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DashboardSearchAggregationBucketMultiKey { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_COUNT = "count"; + private Long count; + + public static final String JSON_PROPERTY_VALUE = "value"; + private List value = new ArrayList<>(); + + public DashboardSearchAggregationBucketMultiKey() {} + + @JsonCreator + public DashboardSearchAggregationBucketMultiKey( + @JsonProperty(required = true, value = JSON_PROPERTY_COUNT) Long count, + @JsonProperty(required = true, value = JSON_PROPERTY_VALUE) List value) { + this.count = count; + this.value = value; + } + + public DashboardSearchAggregationBucketMultiKey count(Long count) { + this.count = count; + return this; + } + + /** + * Number of results in this bucket. + * + * @return count + */ + @JsonProperty(JSON_PROPERTY_COUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getCount() { + return count; + } + + public void setCount(Long count) { + this.count = count; + } + + public DashboardSearchAggregationBucketMultiKey value(List value) { + this.value = value; + return this; + } + + public DashboardSearchAggregationBucketMultiKey addValueItem(String valueItem) { + this.value.add(valueItem); + return this; + } + + /** + * Key values for this bucket. + * + * @return value + */ + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getValue() { + return value; + } + + public void setValue(List value) { + this.value = value; + } + + /** + * 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 DashboardSearchAggregationBucketMultiKey + */ + @JsonAnySetter + public DashboardSearchAggregationBucketMultiKey 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 DashboardSearchAggregationBucketMultiKey object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DashboardSearchAggregationBucketMultiKey dashboardSearchAggregationBucketMultiKey = + (DashboardSearchAggregationBucketMultiKey) o; + return Objects.equals(this.count, dashboardSearchAggregationBucketMultiKey.count) + && Objects.equals(this.value, dashboardSearchAggregationBucketMultiKey.value) + && Objects.equals( + this.additionalProperties, + dashboardSearchAggregationBucketMultiKey.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(count, value, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DashboardSearchAggregationBucketMultiKey {\n"); + sb.append(" count: ").append(toIndentedString(count)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).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/DashboardSearchAggregations.java b/src/main/java/com/datadog/api/client/v2/model/DashboardSearchAggregations.java new file mode 100644 index 00000000000..fa97865c1c2 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DashboardSearchAggregations.java @@ -0,0 +1,530 @@ +/* + * 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.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Aggregations of dashboard search results. */ +@JsonPropertyOrder({ + DashboardSearchAggregations.JSON_PROPERTY_AUTHOR, + DashboardSearchAggregations.JSON_PROPERTY_IS_SHARED, + DashboardSearchAggregations.JSON_PROPERTY_SHARE_TYPE, + DashboardSearchAggregations.JSON_PROPERTY_SHARED_BY_HANDLE, + DashboardSearchAggregations.JSON_PROPERTY_STATUS, + DashboardSearchAggregations.JSON_PROPERTY_TAGS, + DashboardSearchAggregations.JSON_PROPERTY_TEMPLATE_VARIABLES_NAME, + DashboardSearchAggregations.JSON_PROPERTY_TYPE, + DashboardSearchAggregations.JSON_PROPERTY_WIDGETS_METRICS, + DashboardSearchAggregations.JSON_PROPERTY_WIDGETS_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DashboardSearchAggregations { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_AUTHOR = "author"; + private List author = null; + + public static final String JSON_PROPERTY_IS_SHARED = "is_shared"; + private List isShared = null; + + public static final String JSON_PROPERTY_SHARE_TYPE = "share_type"; + private List shareType = null; + + public static final String JSON_PROPERTY_SHARED_BY_HANDLE = "shared_by.handle"; + private List sharedByHandle = null; + + public static final String JSON_PROPERTY_STATUS = "status"; + private List status = null; + + public static final String JSON_PROPERTY_TAGS = "tags"; + private List tags = null; + + public static final String JSON_PROPERTY_TEMPLATE_VARIABLES_NAME = "template_variables.name"; + private List templateVariablesName = null; + + public static final String JSON_PROPERTY_TYPE = "type"; + private List type = null; + + public static final String JSON_PROPERTY_WIDGETS_METRICS = "widgets.metrics"; + private List widgetsMetrics = null; + + public static final String JSON_PROPERTY_WIDGETS_TYPE = "widgets.type"; + private List widgetsType = null; + + public DashboardSearchAggregations author(List author) { + this.author = author; + for (DashboardSearchAggregationBucketMultiKey item : author) { + this.unparsed |= item.unparsed; + } + return this; + } + + public DashboardSearchAggregations addAuthorItem( + DashboardSearchAggregationBucketMultiKey authorItem) { + if (this.author == null) { + this.author = new ArrayList<>(); + } + this.author.add(authorItem); + this.unparsed |= authorItem.unparsed; + return this; + } + + /** + * Aggregation by author. + * + * @return author + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AUTHOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getAuthor() { + return author; + } + + public void setAuthor(List author) { + this.author = author; + } + + public DashboardSearchAggregations isShared(List isShared) { + this.isShared = isShared; + for (DashboardSearchAggregationBucketKey item : isShared) { + this.unparsed |= item.unparsed; + } + return this; + } + + public DashboardSearchAggregations addIsSharedItem( + DashboardSearchAggregationBucketKey isSharedItem) { + if (this.isShared == null) { + this.isShared = new ArrayList<>(); + } + this.isShared.add(isSharedItem); + this.unparsed |= isSharedItem.unparsed; + return this; + } + + /** + * Aggregation by share status. + * + * @return isShared + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_SHARED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getIsShared() { + return isShared; + } + + public void setIsShared(List isShared) { + this.isShared = isShared; + } + + public DashboardSearchAggregations shareType( + List shareType) { + this.shareType = shareType; + for (DashboardSearchAggregationBucketKey item : shareType) { + this.unparsed |= item.unparsed; + } + return this; + } + + public DashboardSearchAggregations addShareTypeItem( + DashboardSearchAggregationBucketKey shareTypeItem) { + if (this.shareType == null) { + this.shareType = new ArrayList<>(); + } + this.shareType.add(shareTypeItem); + this.unparsed |= shareTypeItem.unparsed; + return this; + } + + /** + * Aggregation by share type. + * + * @return shareType + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SHARE_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getShareType() { + return shareType; + } + + public void setShareType(List shareType) { + this.shareType = shareType; + } + + public DashboardSearchAggregations sharedByHandle( + List sharedByHandle) { + this.sharedByHandle = sharedByHandle; + for (DashboardSearchAggregationBucketKey item : sharedByHandle) { + this.unparsed |= item.unparsed; + } + return this; + } + + public DashboardSearchAggregations addSharedByHandleItem( + DashboardSearchAggregationBucketKey sharedByHandleItem) { + if (this.sharedByHandle == null) { + this.sharedByHandle = new ArrayList<>(); + } + this.sharedByHandle.add(sharedByHandleItem); + this.unparsed |= sharedByHandleItem.unparsed; + return this; + } + + /** + * Aggregation by who shared the dashboard. + * + * @return sharedByHandle + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SHARED_BY_HANDLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getSharedByHandle() { + return sharedByHandle; + } + + public void setSharedByHandle(List sharedByHandle) { + this.sharedByHandle = sharedByHandle; + } + + public DashboardSearchAggregations status(List status) { + this.status = status; + for (DashboardSearchAggregationBucketKey item : status) { + this.unparsed |= item.unparsed; + } + return this; + } + + public DashboardSearchAggregations addStatusItem(DashboardSearchAggregationBucketKey statusItem) { + if (this.status == null) { + this.status = new ArrayList<>(); + } + this.status.add(statusItem); + this.unparsed |= statusItem.unparsed; + return this; + } + + /** + * Aggregation by status. + * + * @return status + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getStatus() { + return status; + } + + public void setStatus(List status) { + this.status = status; + } + + public DashboardSearchAggregations tags(List tags) { + this.tags = tags; + for (DashboardSearchAggregationBucketKey item : tags) { + this.unparsed |= item.unparsed; + } + return this; + } + + public DashboardSearchAggregations addTagsItem(DashboardSearchAggregationBucketKey tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList<>(); + } + this.tags.add(tagsItem); + this.unparsed |= tagsItem.unparsed; + return this; + } + + /** + * Aggregation by tags. + * + * @return tags + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTags() { + return tags; + } + + public void setTags(List tags) { + this.tags = tags; + } + + public DashboardSearchAggregations templateVariablesName( + List templateVariablesName) { + this.templateVariablesName = templateVariablesName; + for (DashboardSearchAggregationBucketKey item : templateVariablesName) { + this.unparsed |= item.unparsed; + } + return this; + } + + public DashboardSearchAggregations addTemplateVariablesNameItem( + DashboardSearchAggregationBucketKey templateVariablesNameItem) { + if (this.templateVariablesName == null) { + this.templateVariablesName = new ArrayList<>(); + } + this.templateVariablesName.add(templateVariablesNameItem); + this.unparsed |= templateVariablesNameItem.unparsed; + return this; + } + + /** + * Aggregation by template variable names. + * + * @return templateVariablesName + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEMPLATE_VARIABLES_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTemplateVariablesName() { + return templateVariablesName; + } + + public void setTemplateVariablesName( + List templateVariablesName) { + this.templateVariablesName = templateVariablesName; + } + + public DashboardSearchAggregations type(List type) { + this.type = type; + for (DashboardSearchAggregationBucketKey item : type) { + this.unparsed |= item.unparsed; + } + return this; + } + + public DashboardSearchAggregations addTypeItem(DashboardSearchAggregationBucketKey typeItem) { + if (this.type == null) { + this.type = new ArrayList<>(); + } + this.type.add(typeItem); + this.unparsed |= typeItem.unparsed; + return this; + } + + /** + * Aggregation by dashboard type. + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getType() { + return type; + } + + public void setType(List type) { + this.type = type; + } + + public DashboardSearchAggregations widgetsMetrics( + List widgetsMetrics) { + this.widgetsMetrics = widgetsMetrics; + for (DashboardSearchAggregationBucketKey item : widgetsMetrics) { + this.unparsed |= item.unparsed; + } + return this; + } + + public DashboardSearchAggregations addWidgetsMetricsItem( + DashboardSearchAggregationBucketKey widgetsMetricsItem) { + if (this.widgetsMetrics == null) { + this.widgetsMetrics = new ArrayList<>(); + } + this.widgetsMetrics.add(widgetsMetricsItem); + this.unparsed |= widgetsMetricsItem.unparsed; + return this; + } + + /** + * Aggregation by widget metrics. + * + * @return widgetsMetrics + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WIDGETS_METRICS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getWidgetsMetrics() { + return widgetsMetrics; + } + + public void setWidgetsMetrics(List widgetsMetrics) { + this.widgetsMetrics = widgetsMetrics; + } + + public DashboardSearchAggregations widgetsType( + List widgetsType) { + this.widgetsType = widgetsType; + for (DashboardSearchAggregationBucketKey item : widgetsType) { + this.unparsed |= item.unparsed; + } + return this; + } + + public DashboardSearchAggregations addWidgetsTypeItem( + DashboardSearchAggregationBucketKey widgetsTypeItem) { + if (this.widgetsType == null) { + this.widgetsType = new ArrayList<>(); + } + this.widgetsType.add(widgetsTypeItem); + this.unparsed |= widgetsTypeItem.unparsed; + return this; + } + + /** + * Aggregation by widget type. + * + * @return widgetsType + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WIDGETS_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getWidgetsType() { + return widgetsType; + } + + public void setWidgetsType(List widgetsType) { + this.widgetsType = widgetsType; + } + + /** + * 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 DashboardSearchAggregations + */ + @JsonAnySetter + public DashboardSearchAggregations 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 DashboardSearchAggregations object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DashboardSearchAggregations dashboardSearchAggregations = (DashboardSearchAggregations) o; + return Objects.equals(this.author, dashboardSearchAggregations.author) + && Objects.equals(this.isShared, dashboardSearchAggregations.isShared) + && Objects.equals(this.shareType, dashboardSearchAggregations.shareType) + && Objects.equals(this.sharedByHandle, dashboardSearchAggregations.sharedByHandle) + && Objects.equals(this.status, dashboardSearchAggregations.status) + && Objects.equals(this.tags, dashboardSearchAggregations.tags) + && Objects.equals( + this.templateVariablesName, dashboardSearchAggregations.templateVariablesName) + && Objects.equals(this.type, dashboardSearchAggregations.type) + && Objects.equals(this.widgetsMetrics, dashboardSearchAggregations.widgetsMetrics) + && Objects.equals(this.widgetsType, dashboardSearchAggregations.widgetsType) + && Objects.equals( + this.additionalProperties, dashboardSearchAggregations.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + author, + isShared, + shareType, + sharedByHandle, + status, + tags, + templateVariablesName, + type, + widgetsMetrics, + widgetsType, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DashboardSearchAggregations {\n"); + sb.append(" author: ").append(toIndentedString(author)).append("\n"); + sb.append(" isShared: ").append(toIndentedString(isShared)).append("\n"); + sb.append(" shareType: ").append(toIndentedString(shareType)).append("\n"); + sb.append(" sharedByHandle: ").append(toIndentedString(sharedByHandle)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" templateVariablesName: ") + .append(toIndentedString(templateVariablesName)) + .append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" widgetsMetrics: ").append(toIndentedString(widgetsMetrics)).append("\n"); + sb.append(" widgetsType: ").append(toIndentedString(widgetsType)).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/DashboardSearchAttributes.java b/src/main/java/com/datadog/api/client/v2/model/DashboardSearchAttributes.java new file mode 100644 index 00000000000..7a2a33349b4 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DashboardSearchAttributes.java @@ -0,0 +1,181 @@ +/* + * 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; + +/** Dashboard search result attributes. */ +@JsonPropertyOrder({ + DashboardSearchAttributes.JSON_PROPERTY_TAGS, + DashboardSearchAttributes.JSON_PROPERTY_TITLE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DashboardSearchAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_TAGS = "tags"; + private List tags = new ArrayList<>(); + + public static final String JSON_PROPERTY_TITLE = "title"; + private String title; + + public DashboardSearchAttributes() {} + + @JsonCreator + public DashboardSearchAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_TAGS) List tags, + @JsonProperty(required = true, value = JSON_PROPERTY_TITLE) String title) { + this.tags = tags; + this.title = title; + } + + public DashboardSearchAttributes tags(List tags) { + this.tags = tags; + return this; + } + + public DashboardSearchAttributes addTagsItem(String tagsItem) { + this.tags.add(tagsItem); + return this; + } + + /** + * List of tags for the dashboard. + * + * @return tags + */ + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getTags() { + return tags; + } + + public void setTags(List tags) { + this.tags = tags; + } + + public DashboardSearchAttributes title(String title) { + this.title = title; + return this; + } + + /** + * Title of the dashboard. + * + * @return title + */ + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + /** + * 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 DashboardSearchAttributes + */ + @JsonAnySetter + public DashboardSearchAttributes 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 DashboardSearchAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DashboardSearchAttributes dashboardSearchAttributes = (DashboardSearchAttributes) o; + return Objects.equals(this.tags, dashboardSearchAttributes.tags) + && Objects.equals(this.title, dashboardSearchAttributes.title) + && Objects.equals( + this.additionalProperties, dashboardSearchAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(tags, title, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DashboardSearchAttributes {\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).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/DashboardSearchMetadata.java b/src/main/java/com/datadog/api/client/v2/model/DashboardSearchMetadata.java new file mode 100644 index 00000000000..8801f0abc76 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DashboardSearchMetadata.java @@ -0,0 +1,828 @@ +/* + * 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.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Metadata about the dashboard. */ +@JsonPropertyOrder({ + DashboardSearchMetadata.JSON_PROPERTY_AUTHOR, + DashboardSearchMetadata.JSON_PROPERTY_CREATED_AT, + DashboardSearchMetadata.JSON_PROPERTY_DELETED_AT, + DashboardSearchMetadata.JSON_PROPERTY_EMBEDDABLE_DOMAINS, + DashboardSearchMetadata.JSON_PROPERTY_EXPERIENCE_TYPE, + DashboardSearchMetadata.JSON_PROPERTY_EXPIRATION, + DashboardSearchMetadata.JSON_PROPERTY_HAS_MONITORS, + DashboardSearchMetadata.JSON_PROPERTY_IS_FAVORITED, + DashboardSearchMetadata.JSON_PROPERTY_IS_PUBLIC_DASHBOARD_OWNERLESS, + DashboardSearchMetadata.JSON_PROPERTY_IS_SHARED, + DashboardSearchMetadata.JSON_PROPERTY_LAST_ACCESSED, + DashboardSearchMetadata.JSON_PROPERTY_MODIFIED_AT, + DashboardSearchMetadata.JSON_PROPERTY_POPULARITY, + DashboardSearchMetadata.JSON_PROPERTY_PUBLIC_TITLE, + DashboardSearchMetadata.JSON_PROPERTY_QUALITY_SCORE, + DashboardSearchMetadata.JSON_PROPERTY_SHARE_LIST, + DashboardSearchMetadata.JSON_PROPERTY_SHARE_TYPE, + DashboardSearchMetadata.JSON_PROPERTY_SHARED_BY, + DashboardSearchMetadata.JSON_PROPERTY_STATUS, + DashboardSearchMetadata.JSON_PROPERTY_TOKEN, + DashboardSearchMetadata.JSON_PROPERTY_TYPE, + DashboardSearchMetadata.JSON_PROPERTY_URL, + DashboardSearchMetadata.JSON_PROPERTY_WIDGET_COUNT +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DashboardSearchMetadata { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_AUTHOR = "author"; + private DashboardSearchUser author; + + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + private OffsetDateTime createdAt; + + public static final String JSON_PROPERTY_DELETED_AT = "deleted_at"; + private OffsetDateTime deletedAt; + + public static final String JSON_PROPERTY_EMBEDDABLE_DOMAINS = "embeddable_domains"; + private List embeddableDomains = new ArrayList<>(); + + public static final String JSON_PROPERTY_EXPERIENCE_TYPE = "experience_type"; + private String experienceType; + + public static final String JSON_PROPERTY_EXPIRATION = "expiration"; + private OffsetDateTime expiration; + + public static final String JSON_PROPERTY_HAS_MONITORS = "has_monitors"; + private Boolean hasMonitors; + + public static final String JSON_PROPERTY_IS_FAVORITED = "is_favorited"; + private Boolean isFavorited; + + public static final String JSON_PROPERTY_IS_PUBLIC_DASHBOARD_OWNERLESS = + "is_public_dashboard_ownerless"; + private Boolean isPublicDashboardOwnerless; + + public static final String JSON_PROPERTY_IS_SHARED = "is_shared"; + private Boolean isShared; + + public static final String JSON_PROPERTY_LAST_ACCESSED = "last_accessed"; + private OffsetDateTime lastAccessed; + + public static final String JSON_PROPERTY_MODIFIED_AT = "modified_at"; + private OffsetDateTime modifiedAt; + + public static final String JSON_PROPERTY_POPULARITY = "popularity"; + private Double popularity; + + public static final String JSON_PROPERTY_PUBLIC_TITLE = "public_title"; + private String publicTitle; + + public static final String JSON_PROPERTY_QUALITY_SCORE = "quality_score"; + private Double qualityScore; + + public static final String JSON_PROPERTY_SHARE_LIST = "share_list"; + private List shareList = new ArrayList<>(); + + public static final String JSON_PROPERTY_SHARE_TYPE = "share_type"; + private String shareType; + + public static final String JSON_PROPERTY_SHARED_BY = "shared_by"; + private DashboardSearchUser sharedBy; + + public static final String JSON_PROPERTY_STATUS = "status"; + private String status; + + public static final String JSON_PROPERTY_TOKEN = "token"; + private String token; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + public static final String JSON_PROPERTY_URL = "url"; + private String url; + + public static final String JSON_PROPERTY_WIDGET_COUNT = "widget_count"; + private Long widgetCount; + + public DashboardSearchMetadata() {} + + @JsonCreator + public DashboardSearchMetadata( + @JsonProperty(required = true, value = JSON_PROPERTY_AUTHOR) DashboardSearchUser author, + @JsonProperty(required = true, value = JSON_PROPERTY_CREATED_AT) OffsetDateTime createdAt, + @JsonProperty(required = true, value = JSON_PROPERTY_DELETED_AT) OffsetDateTime deletedAt, + @JsonProperty(required = true, value = JSON_PROPERTY_EMBEDDABLE_DOMAINS) + List embeddableDomains, + @JsonProperty(required = true, value = JSON_PROPERTY_EXPERIENCE_TYPE) String experienceType, + @JsonProperty(required = true, value = JSON_PROPERTY_EXPIRATION) OffsetDateTime expiration, + @JsonProperty(required = true, value = JSON_PROPERTY_HAS_MONITORS) Boolean hasMonitors, + @JsonProperty(required = true, value = JSON_PROPERTY_IS_FAVORITED) Boolean isFavorited, + @JsonProperty(required = true, value = JSON_PROPERTY_IS_PUBLIC_DASHBOARD_OWNERLESS) + Boolean isPublicDashboardOwnerless, + @JsonProperty(required = true, value = JSON_PROPERTY_IS_SHARED) Boolean isShared, + @JsonProperty(required = true, value = JSON_PROPERTY_LAST_ACCESSED) + OffsetDateTime lastAccessed, + @JsonProperty(required = true, value = JSON_PROPERTY_MODIFIED_AT) OffsetDateTime modifiedAt, + @JsonProperty(required = true, value = JSON_PROPERTY_POPULARITY) Double popularity, + @JsonProperty(required = true, value = JSON_PROPERTY_PUBLIC_TITLE) String publicTitle, + @JsonProperty(required = true, value = JSON_PROPERTY_QUALITY_SCORE) Double qualityScore, + @JsonProperty(required = true, value = JSON_PROPERTY_SHARE_LIST) List shareList, + @JsonProperty(required = true, value = JSON_PROPERTY_SHARE_TYPE) String shareType, + @JsonProperty(required = true, value = JSON_PROPERTY_SHARED_BY) DashboardSearchUser sharedBy, + @JsonProperty(required = true, value = JSON_PROPERTY_STATUS) String status, + @JsonProperty(required = true, value = JSON_PROPERTY_TOKEN) String token, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) String type, + @JsonProperty(required = true, value = JSON_PROPERTY_URL) String url, + @JsonProperty(required = true, value = JSON_PROPERTY_WIDGET_COUNT) Long widgetCount) { + this.author = author; + this.unparsed |= author.unparsed; + this.createdAt = createdAt; + this.deletedAt = deletedAt; + if (deletedAt != null) {} + this.embeddableDomains = embeddableDomains; + if (embeddableDomains != null) {} + this.experienceType = experienceType; + this.expiration = expiration; + if (expiration != null) {} + this.hasMonitors = hasMonitors; + if (hasMonitors != null) {} + this.isFavorited = isFavorited; + this.isPublicDashboardOwnerless = isPublicDashboardOwnerless; + this.isShared = isShared; + this.lastAccessed = lastAccessed; + if (lastAccessed != null) {} + this.modifiedAt = modifiedAt; + this.popularity = popularity; + this.publicTitle = publicTitle; + this.qualityScore = qualityScore; + if (qualityScore != null) {} + this.shareList = shareList; + if (shareList != null) {} + this.shareType = shareType; + this.sharedBy = sharedBy; + this.unparsed |= sharedBy.unparsed; + this.status = status; + this.token = token; + this.type = type; + this.url = url; + this.widgetCount = widgetCount; + } + + public DashboardSearchMetadata author(DashboardSearchUser author) { + this.author = author; + this.unparsed |= author.unparsed; + return this; + } + + /** + * User information. + * + * @return author + */ + @JsonProperty(JSON_PROPERTY_AUTHOR) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public DashboardSearchUser getAuthor() { + return author; + } + + public void setAuthor(DashboardSearchUser author) { + this.author = author; + } + + public DashboardSearchMetadata createdAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Time at which the dashboard was created. + * + * @return createdAt + */ + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + public DashboardSearchMetadata deletedAt(OffsetDateTime deletedAt) { + this.deletedAt = deletedAt; + if (deletedAt != null) {} + return this; + } + + /** + * Time at which the dashboard was deleted, or null if not deleted. + * + * @return deletedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DELETED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OffsetDateTime getDeletedAt() { + return deletedAt; + } + + public void setDeletedAt(OffsetDateTime deletedAt) { + this.deletedAt = deletedAt; + } + + public DashboardSearchMetadata embeddableDomains(List embeddableDomains) { + this.embeddableDomains = embeddableDomains; + return this; + } + + public DashboardSearchMetadata addEmbeddableDomainsItem(String embeddableDomainsItem) { + this.embeddableDomains.add(embeddableDomainsItem); + return this; + } + + /** + * List of domains the dashboard is allowed to be embedded in. + * + * @return embeddableDomains + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EMBEDDABLE_DOMAINS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getEmbeddableDomains() { + return embeddableDomains; + } + + public void setEmbeddableDomains(List embeddableDomains) { + this.embeddableDomains = embeddableDomains; + } + + public DashboardSearchMetadata experienceType(String experienceType) { + this.experienceType = experienceType; + return this; + } + + /** + * Dashboard experience type. + * + * @return experienceType + */ + @JsonProperty(JSON_PROPERTY_EXPERIENCE_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getExperienceType() { + return experienceType; + } + + public void setExperienceType(String experienceType) { + this.experienceType = experienceType; + } + + public DashboardSearchMetadata expiration(OffsetDateTime expiration) { + this.expiration = expiration; + if (expiration != null) {} + return this; + } + + /** + * When the public dashboard link will expire. + * + * @return expiration + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EXPIRATION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OffsetDateTime getExpiration() { + return expiration; + } + + public void setExpiration(OffsetDateTime expiration) { + this.expiration = expiration; + } + + public DashboardSearchMetadata hasMonitors(Boolean hasMonitors) { + this.hasMonitors = hasMonitors; + if (hasMonitors != null) {} + return this; + } + + /** + * Whether the dashboard has monitors. + * + * @return hasMonitors + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HAS_MONITORS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getHasMonitors() { + return hasMonitors; + } + + public void setHasMonitors(Boolean hasMonitors) { + this.hasMonitors = hasMonitors; + } + + public DashboardSearchMetadata isFavorited(Boolean isFavorited) { + this.isFavorited = isFavorited; + return this; + } + + /** + * Whether the dashboard is favorited by the user. + * + * @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 DashboardSearchMetadata isPublicDashboardOwnerless(Boolean isPublicDashboardOwnerless) { + this.isPublicDashboardOwnerless = isPublicDashboardOwnerless; + return this; + } + + /** + * Whether the public dashboard owner is deactivated. + * + * @return isPublicDashboardOwnerless + */ + @JsonProperty(JSON_PROPERTY_IS_PUBLIC_DASHBOARD_OWNERLESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getIsPublicDashboardOwnerless() { + return isPublicDashboardOwnerless; + } + + public void setIsPublicDashboardOwnerless(Boolean isPublicDashboardOwnerless) { + this.isPublicDashboardOwnerless = isPublicDashboardOwnerless; + } + + public DashboardSearchMetadata isShared(Boolean isShared) { + this.isShared = isShared; + return this; + } + + /** + * Whether the dashboard is shared publicly. + * + * @return isShared + */ + @JsonProperty(JSON_PROPERTY_IS_SHARED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getIsShared() { + return isShared; + } + + public void setIsShared(Boolean isShared) { + this.isShared = isShared; + } + + public DashboardSearchMetadata lastAccessed(OffsetDateTime lastAccessed) { + this.lastAccessed = lastAccessed; + if (lastAccessed != null) {} + return this; + } + + /** + * Last time the dashboard was accessed. + * + * @return lastAccessed + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LAST_ACCESSED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OffsetDateTime getLastAccessed() { + return lastAccessed; + } + + public void setLastAccessed(OffsetDateTime lastAccessed) { + this.lastAccessed = lastAccessed; + } + + public DashboardSearchMetadata modifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = modifiedAt; + return this; + } + + /** + * Time at which the dashboard was last updated. + * + * @return modifiedAt + */ + @JsonProperty(JSON_PROPERTY_MODIFIED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OffsetDateTime getModifiedAt() { + return modifiedAt; + } + + public void setModifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = modifiedAt; + } + + public DashboardSearchMetadata popularity(Double popularity) { + this.popularity = popularity; + return this; + } + + /** + * Relative measure of dashboard popularity. + * + * @return popularity + */ + @JsonProperty(JSON_PROPERTY_POPULARITY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Double getPopularity() { + return popularity; + } + + public void setPopularity(Double popularity) { + this.popularity = popularity; + } + + public DashboardSearchMetadata publicTitle(String publicTitle) { + this.publicTitle = publicTitle; + return this; + } + + /** + * Published title of the public dashboard. + * + * @return publicTitle + */ + @JsonProperty(JSON_PROPERTY_PUBLIC_TITLE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getPublicTitle() { + return publicTitle; + } + + public void setPublicTitle(String publicTitle) { + this.publicTitle = publicTitle; + } + + public DashboardSearchMetadata qualityScore(Double qualityScore) { + this.qualityScore = qualityScore; + if (qualityScore != null) {} + return this; + } + + /** + * Quality score of the dashboard. + * + * @return qualityScore + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_QUALITY_SCORE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Double getQualityScore() { + return qualityScore; + } + + public void setQualityScore(Double qualityScore) { + this.qualityScore = qualityScore; + } + + public DashboardSearchMetadata shareList(List shareList) { + this.shareList = shareList; + return this; + } + + public DashboardSearchMetadata addShareListItem(String shareListItem) { + this.shareList.add(shareListItem); + return this; + } + + /** + * List of email addresses for invite-only public dashboards. + * + * @return shareList + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SHARE_LIST) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getShareList() { + return shareList; + } + + public void setShareList(List shareList) { + this.shareList = shareList; + } + + public DashboardSearchMetadata shareType(String shareType) { + this.shareType = shareType; + return this; + } + + /** + * Share type of the public dashboard. + * + * @return shareType + */ + @JsonProperty(JSON_PROPERTY_SHARE_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getShareType() { + return shareType; + } + + public void setShareType(String shareType) { + this.shareType = shareType; + } + + public DashboardSearchMetadata sharedBy(DashboardSearchUser sharedBy) { + this.sharedBy = sharedBy; + this.unparsed |= sharedBy.unparsed; + return this; + } + + /** + * User information. + * + * @return sharedBy + */ + @JsonProperty(JSON_PROPERTY_SHARED_BY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public DashboardSearchUser getSharedBy() { + return sharedBy; + } + + public void setSharedBy(DashboardSearchUser sharedBy) { + this.sharedBy = sharedBy; + } + + public DashboardSearchMetadata status(String status) { + this.status = status; + return this; + } + + /** + * Status of the public dashboard. + * + * @return status + */ + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public DashboardSearchMetadata token(String token) { + this.token = token; + return this; + } + + /** + * Unique public dashboard token. + * + * @return token + */ + @JsonProperty(JSON_PROPERTY_TOKEN) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getToken() { + return token; + } + + public void setToken(String token) { + this.token = token; + } + + public DashboardSearchMetadata type(String type) { + this.type = type; + return this; + } + + /** + * Dashboard 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; + } + + public DashboardSearchMetadata url(String url) { + this.url = url; + return this; + } + + /** + * URL path to the dashboard. + * + * @return url + */ + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public DashboardSearchMetadata widgetCount(Long widgetCount) { + this.widgetCount = widgetCount; + return this; + } + + /** + * Number of widgets in the dashboard. + * + * @return widgetCount + */ + @JsonProperty(JSON_PROPERTY_WIDGET_COUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getWidgetCount() { + return widgetCount; + } + + public void setWidgetCount(Long widgetCount) { + this.widgetCount = widgetCount; + } + + /** + * 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 DashboardSearchMetadata + */ + @JsonAnySetter + public DashboardSearchMetadata 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 DashboardSearchMetadata object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DashboardSearchMetadata dashboardSearchMetadata = (DashboardSearchMetadata) o; + return Objects.equals(this.author, dashboardSearchMetadata.author) + && Objects.equals(this.createdAt, dashboardSearchMetadata.createdAt) + && Objects.equals(this.deletedAt, dashboardSearchMetadata.deletedAt) + && Objects.equals(this.embeddableDomains, dashboardSearchMetadata.embeddableDomains) + && Objects.equals(this.experienceType, dashboardSearchMetadata.experienceType) + && Objects.equals(this.expiration, dashboardSearchMetadata.expiration) + && Objects.equals(this.hasMonitors, dashboardSearchMetadata.hasMonitors) + && Objects.equals(this.isFavorited, dashboardSearchMetadata.isFavorited) + && Objects.equals( + this.isPublicDashboardOwnerless, dashboardSearchMetadata.isPublicDashboardOwnerless) + && Objects.equals(this.isShared, dashboardSearchMetadata.isShared) + && Objects.equals(this.lastAccessed, dashboardSearchMetadata.lastAccessed) + && Objects.equals(this.modifiedAt, dashboardSearchMetadata.modifiedAt) + && Objects.equals(this.popularity, dashboardSearchMetadata.popularity) + && Objects.equals(this.publicTitle, dashboardSearchMetadata.publicTitle) + && Objects.equals(this.qualityScore, dashboardSearchMetadata.qualityScore) + && Objects.equals(this.shareList, dashboardSearchMetadata.shareList) + && Objects.equals(this.shareType, dashboardSearchMetadata.shareType) + && Objects.equals(this.sharedBy, dashboardSearchMetadata.sharedBy) + && Objects.equals(this.status, dashboardSearchMetadata.status) + && Objects.equals(this.token, dashboardSearchMetadata.token) + && Objects.equals(this.type, dashboardSearchMetadata.type) + && Objects.equals(this.url, dashboardSearchMetadata.url) + && Objects.equals(this.widgetCount, dashboardSearchMetadata.widgetCount) + && Objects.equals(this.additionalProperties, dashboardSearchMetadata.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + author, + createdAt, + deletedAt, + embeddableDomains, + experienceType, + expiration, + hasMonitors, + isFavorited, + isPublicDashboardOwnerless, + isShared, + lastAccessed, + modifiedAt, + popularity, + publicTitle, + qualityScore, + shareList, + shareType, + sharedBy, + status, + token, + type, + url, + widgetCount, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DashboardSearchMetadata {\n"); + sb.append(" author: ").append(toIndentedString(author)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" deletedAt: ").append(toIndentedString(deletedAt)).append("\n"); + sb.append(" embeddableDomains: ").append(toIndentedString(embeddableDomains)).append("\n"); + sb.append(" experienceType: ").append(toIndentedString(experienceType)).append("\n"); + sb.append(" expiration: ").append(toIndentedString(expiration)).append("\n"); + sb.append(" hasMonitors: ").append(toIndentedString(hasMonitors)).append("\n"); + sb.append(" isFavorited: ").append(toIndentedString(isFavorited)).append("\n"); + sb.append(" isPublicDashboardOwnerless: ") + .append(toIndentedString(isPublicDashboardOwnerless)) + .append("\n"); + sb.append(" isShared: ").append(toIndentedString(isShared)).append("\n"); + sb.append(" lastAccessed: ").append(toIndentedString(lastAccessed)).append("\n"); + sb.append(" modifiedAt: ").append(toIndentedString(modifiedAt)).append("\n"); + sb.append(" popularity: ").append(toIndentedString(popularity)).append("\n"); + sb.append(" publicTitle: ").append(toIndentedString(publicTitle)).append("\n"); + sb.append(" qualityScore: ").append(toIndentedString(qualityScore)).append("\n"); + sb.append(" shareList: ").append(toIndentedString(shareList)).append("\n"); + sb.append(" shareType: ").append(toIndentedString(shareType)).append("\n"); + sb.append(" sharedBy: ").append(toIndentedString(sharedBy)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" token: ").append(toIndentedString(token)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append(" widgetCount: ").append(toIndentedString(widgetCount)).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/DashboardSearchResponse.java b/src/main/java/com/datadog/api/client/v2/model/DashboardSearchResponse.java new file mode 100644 index 00000000000..da0214e6963 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DashboardSearchResponse.java @@ -0,0 +1,187 @@ +/* + * 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 dashboard search results. */ +@JsonPropertyOrder({ + DashboardSearchResponse.JSON_PROPERTY_DATA, + DashboardSearchResponse.JSON_PROPERTY_META +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DashboardSearchResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public static final String JSON_PROPERTY_META = "meta"; + private DashboardSearchResponseMeta meta; + + public DashboardSearchResponse() {} + + @JsonCreator + public DashboardSearchResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + List data, + @JsonProperty(required = true, value = JSON_PROPERTY_META) DashboardSearchResponseMeta meta) { + this.data = data; + this.meta = meta; + this.unparsed |= meta.unparsed; + } + + public DashboardSearchResponse data(List data) { + this.data = data; + for (DashboardSearchResultData item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public DashboardSearchResponse addDataItem(DashboardSearchResultData dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * List of dashboard search results. + * + * @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 DashboardSearchResponse meta(DashboardSearchResponseMeta meta) { + this.meta = meta; + this.unparsed |= meta.unparsed; + return this; + } + + /** + * Metadata about the dashboard search results. + * + * @return meta + */ + @JsonProperty(JSON_PROPERTY_META) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public DashboardSearchResponseMeta getMeta() { + return meta; + } + + public void setMeta(DashboardSearchResponseMeta 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 DashboardSearchResponse + */ + @JsonAnySetter + public DashboardSearchResponse 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 DashboardSearchResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DashboardSearchResponse dashboardSearchResponse = (DashboardSearchResponse) o; + return Objects.equals(this.data, dashboardSearchResponse.data) + && Objects.equals(this.meta, dashboardSearchResponse.meta) + && Objects.equals(this.additionalProperties, dashboardSearchResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, meta, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DashboardSearchResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).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/DashboardSearchResponseMeta.java b/src/main/java/com/datadog/api/client/v2/model/DashboardSearchResponseMeta.java new file mode 100644 index 00000000000..424baa19258 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DashboardSearchResponseMeta.java @@ -0,0 +1,174 @@ +/* + * 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; + +/** Metadata about the dashboard search results. */ +@JsonPropertyOrder({ + DashboardSearchResponseMeta.JSON_PROPERTY_AGGREGATIONS, + DashboardSearchResponseMeta.JSON_PROPERTY_TOTAL +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DashboardSearchResponseMeta { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_AGGREGATIONS = "aggregations"; + private DashboardSearchAggregations aggregations; + + public static final String JSON_PROPERTY_TOTAL = "total"; + private Long total; + + public DashboardSearchResponseMeta() {} + + @JsonCreator + public DashboardSearchResponseMeta( + @JsonProperty(required = true, value = JSON_PROPERTY_TOTAL) Long total) { + this.total = total; + } + + public DashboardSearchResponseMeta aggregations(DashboardSearchAggregations aggregations) { + this.aggregations = aggregations; + this.unparsed |= aggregations.unparsed; + return this; + } + + /** + * Aggregations of dashboard search results. + * + * @return aggregations + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AGGREGATIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DashboardSearchAggregations getAggregations() { + return aggregations; + } + + public void setAggregations(DashboardSearchAggregations aggregations) { + this.aggregations = aggregations; + } + + public DashboardSearchResponseMeta total(Long total) { + this.total = total; + return this; + } + + /** + * Total number of dashboards found. + * + * @return total + */ + @JsonProperty(JSON_PROPERTY_TOTAL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getTotal() { + return total; + } + + public void setTotal(Long total) { + this.total = total; + } + + /** + * 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 DashboardSearchResponseMeta + */ + @JsonAnySetter + public DashboardSearchResponseMeta 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 DashboardSearchResponseMeta object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DashboardSearchResponseMeta dashboardSearchResponseMeta = (DashboardSearchResponseMeta) o; + return Objects.equals(this.aggregations, dashboardSearchResponseMeta.aggregations) + && Objects.equals(this.total, dashboardSearchResponseMeta.total) + && Objects.equals( + this.additionalProperties, dashboardSearchResponseMeta.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(aggregations, total, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DashboardSearchResponseMeta {\n"); + sb.append(" aggregations: ").append(toIndentedString(aggregations)).append("\n"); + sb.append(" total: ").append(toIndentedString(total)).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/DashboardSearchResultData.java b/src/main/java/com/datadog/api/client/v2/model/DashboardSearchResultData.java new file mode 100644 index 00000000000..8330049ab18 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DashboardSearchResultData.java @@ -0,0 +1,240 @@ +/* + * 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 dashboard search result. */ +@JsonPropertyOrder({ + DashboardSearchResultData.JSON_PROPERTY_ATTRIBUTES, + DashboardSearchResultData.JSON_PROPERTY_ID, + DashboardSearchResultData.JSON_PROPERTY_META, + DashboardSearchResultData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DashboardSearchResultData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private DashboardSearchAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_META = "meta"; + private DashboardSearchMetadata meta; + + public static final String JSON_PROPERTY_TYPE = "type"; + private MetricDashboardType type; + + public DashboardSearchResultData() {} + + @JsonCreator + public DashboardSearchResultData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + DashboardSearchAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_META) DashboardSearchMetadata meta, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) MetricDashboardType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.meta = meta; + this.unparsed |= meta.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public DashboardSearchResultData attributes(DashboardSearchAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Dashboard search result attributes. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public DashboardSearchAttributes getAttributes() { + return attributes; + } + + public void setAttributes(DashboardSearchAttributes attributes) { + this.attributes = attributes; + } + + public DashboardSearchResultData id(String id) { + this.id = id; + return this; + } + + /** + * Dashboard identifier. + * + * @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 DashboardSearchResultData meta(DashboardSearchMetadata meta) { + this.meta = meta; + this.unparsed |= meta.unparsed; + return this; + } + + /** + * Metadata about the dashboard. + * + * @return meta + */ + @JsonProperty(JSON_PROPERTY_META) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public DashboardSearchMetadata getMeta() { + return meta; + } + + public void setMeta(DashboardSearchMetadata meta) { + this.meta = meta; + } + + public DashboardSearchResultData type(MetricDashboardType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Dashboard resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public MetricDashboardType getType() { + return type; + } + + public void setType(MetricDashboardType 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 DashboardSearchResultData + */ + @JsonAnySetter + public DashboardSearchResultData 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 DashboardSearchResultData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DashboardSearchResultData dashboardSearchResultData = (DashboardSearchResultData) o; + return Objects.equals(this.attributes, dashboardSearchResultData.attributes) + && Objects.equals(this.id, dashboardSearchResultData.id) + && Objects.equals(this.meta, dashboardSearchResultData.meta) + && Objects.equals(this.type, dashboardSearchResultData.type) + && Objects.equals( + this.additionalProperties, dashboardSearchResultData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, meta, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DashboardSearchResultData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" meta: ").append(toIndentedString(meta)).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/DashboardSearchUser.java b/src/main/java/com/datadog/api/client/v2/model/DashboardSearchUser.java new file mode 100644 index 00000000000..1ed1f805bd8 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DashboardSearchUser.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; + +/** User information. */ +@JsonPropertyOrder({ + DashboardSearchUser.JSON_PROPERTY_HANDLE, + DashboardSearchUser.JSON_PROPERTY_NAME +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DashboardSearchUser { + @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 String name; + + public DashboardSearchUser() {} + + @JsonCreator + public DashboardSearchUser( + @JsonProperty(required = true, value = JSON_PROPERTY_HANDLE) String handle, + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name) { + this.handle = handle; + this.name = name; + } + + public DashboardSearchUser handle(String handle) { + this.handle = handle; + return this; + } + + /** + * User handle or email. + * + * @return handle + */ + @JsonProperty(JSON_PROPERTY_HANDLE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getHandle() { + return handle; + } + + public void setHandle(String handle) { + this.handle = handle; + } + + public DashboardSearchUser name(String name) { + this.name = name; + return this; + } + + /** + * User display name. + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = 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 DashboardSearchUser + */ + @JsonAnySetter + public DashboardSearchUser 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 DashboardSearchUser object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DashboardSearchUser dashboardSearchUser = (DashboardSearchUser) o; + return Objects.equals(this.handle, dashboardSearchUser.handle) + && Objects.equals(this.name, dashboardSearchUser.name) + && Objects.equals(this.additionalProperties, dashboardSearchUser.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(handle, name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DashboardSearchUser {\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/NotebookSearchAggregationBucketKey.java b/src/main/java/com/datadog/api/client/v2/model/NotebookSearchAggregationBucketKey.java new file mode 100644 index 00000000000..50875a89c55 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/NotebookSearchAggregationBucketKey.java @@ -0,0 +1,175 @@ +/* + * 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; + +/** Aggregation bucket with a single key value. */ +@JsonPropertyOrder({ + NotebookSearchAggregationBucketKey.JSON_PROPERTY_COUNT, + NotebookSearchAggregationBucketKey.JSON_PROPERTY_VALUE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class NotebookSearchAggregationBucketKey { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_COUNT = "count"; + private Long count; + + public static final String JSON_PROPERTY_VALUE = "value"; + private String value; + + public NotebookSearchAggregationBucketKey() {} + + @JsonCreator + public NotebookSearchAggregationBucketKey( + @JsonProperty(required = true, value = JSON_PROPERTY_COUNT) Long count, + @JsonProperty(required = true, value = JSON_PROPERTY_VALUE) String value) { + this.count = count; + this.value = value; + } + + public NotebookSearchAggregationBucketKey count(Long count) { + this.count = count; + return this; + } + + /** + * Number of results in this bucket. + * + * @return count + */ + @JsonProperty(JSON_PROPERTY_COUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getCount() { + return count; + } + + public void setCount(Long count) { + this.count = count; + } + + public NotebookSearchAggregationBucketKey value(String value) { + this.value = value; + return this; + } + + /** + * Key value for this bucket. + * + * @return value + */ + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + /** + * 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 NotebookSearchAggregationBucketKey + */ + @JsonAnySetter + public NotebookSearchAggregationBucketKey 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 NotebookSearchAggregationBucketKey object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NotebookSearchAggregationBucketKey notebookSearchAggregationBucketKey = + (NotebookSearchAggregationBucketKey) o; + return Objects.equals(this.count, notebookSearchAggregationBucketKey.count) + && Objects.equals(this.value, notebookSearchAggregationBucketKey.value) + && Objects.equals( + this.additionalProperties, notebookSearchAggregationBucketKey.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(count, value, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NotebookSearchAggregationBucketKey {\n"); + sb.append(" count: ").append(toIndentedString(count)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).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/NotebookSearchAggregationBucketMultiKey.java b/src/main/java/com/datadog/api/client/v2/model/NotebookSearchAggregationBucketMultiKey.java new file mode 100644 index 00000000000..e7d8ea77922 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/NotebookSearchAggregationBucketMultiKey.java @@ -0,0 +1,183 @@ +/* + * 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; + +/** Aggregation bucket with multiple key values. */ +@JsonPropertyOrder({ + NotebookSearchAggregationBucketMultiKey.JSON_PROPERTY_COUNT, + NotebookSearchAggregationBucketMultiKey.JSON_PROPERTY_VALUE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class NotebookSearchAggregationBucketMultiKey { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_COUNT = "count"; + private Long count; + + public static final String JSON_PROPERTY_VALUE = "value"; + private List value = new ArrayList<>(); + + public NotebookSearchAggregationBucketMultiKey() {} + + @JsonCreator + public NotebookSearchAggregationBucketMultiKey( + @JsonProperty(required = true, value = JSON_PROPERTY_COUNT) Long count, + @JsonProperty(required = true, value = JSON_PROPERTY_VALUE) List value) { + this.count = count; + this.value = value; + } + + public NotebookSearchAggregationBucketMultiKey count(Long count) { + this.count = count; + return this; + } + + /** + * Number of results in this bucket. + * + * @return count + */ + @JsonProperty(JSON_PROPERTY_COUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getCount() { + return count; + } + + public void setCount(Long count) { + this.count = count; + } + + public NotebookSearchAggregationBucketMultiKey value(List value) { + this.value = value; + return this; + } + + public NotebookSearchAggregationBucketMultiKey addValueItem(String valueItem) { + this.value.add(valueItem); + return this; + } + + /** + * Key values for this bucket. + * + * @return value + */ + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getValue() { + return value; + } + + public void setValue(List value) { + this.value = value; + } + + /** + * 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 NotebookSearchAggregationBucketMultiKey + */ + @JsonAnySetter + public NotebookSearchAggregationBucketMultiKey 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 NotebookSearchAggregationBucketMultiKey object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NotebookSearchAggregationBucketMultiKey notebookSearchAggregationBucketMultiKey = + (NotebookSearchAggregationBucketMultiKey) o; + return Objects.equals(this.count, notebookSearchAggregationBucketMultiKey.count) + && Objects.equals(this.value, notebookSearchAggregationBucketMultiKey.value) + && Objects.equals( + this.additionalProperties, + notebookSearchAggregationBucketMultiKey.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(count, value, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NotebookSearchAggregationBucketMultiKey {\n"); + sb.append(" count: ").append(toIndentedString(count)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).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/NotebookSearchAggregations.java b/src/main/java/com/datadog/api/client/v2/model/NotebookSearchAggregations.java new file mode 100644 index 00000000000..149b31c67d9 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/NotebookSearchAggregations.java @@ -0,0 +1,276 @@ +/* + * 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.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Aggregations of notebook search results. */ +@JsonPropertyOrder({ + NotebookSearchAggregations.JSON_PROPERTY_AUTHOR, + NotebookSearchAggregations.JSON_PROPERTY_TAGS, + NotebookSearchAggregations.JSON_PROPERTY_TEMPLATE_VARIABLES_NAME, + NotebookSearchAggregations.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class NotebookSearchAggregations { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_AUTHOR = "author"; + private List author = null; + + public static final String JSON_PROPERTY_TAGS = "tags"; + private List tags = null; + + public static final String JSON_PROPERTY_TEMPLATE_VARIABLES_NAME = "template_variables.name"; + private List templateVariablesName = null; + + public static final String JSON_PROPERTY_TYPE = "type"; + private List type = null; + + public NotebookSearchAggregations author(List author) { + this.author = author; + for (NotebookSearchAggregationBucketMultiKey item : author) { + this.unparsed |= item.unparsed; + } + return this; + } + + public NotebookSearchAggregations addAuthorItem( + NotebookSearchAggregationBucketMultiKey authorItem) { + if (this.author == null) { + this.author = new ArrayList<>(); + } + this.author.add(authorItem); + this.unparsed |= authorItem.unparsed; + return this; + } + + /** + * Aggregation by author. + * + * @return author + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AUTHOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getAuthor() { + return author; + } + + public void setAuthor(List author) { + this.author = author; + } + + public NotebookSearchAggregations tags(List tags) { + this.tags = tags; + for (NotebookSearchAggregationBucketKey item : tags) { + this.unparsed |= item.unparsed; + } + return this; + } + + public NotebookSearchAggregations addTagsItem(NotebookSearchAggregationBucketKey tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList<>(); + } + this.tags.add(tagsItem); + this.unparsed |= tagsItem.unparsed; + return this; + } + + /** + * Aggregation by tags. + * + * @return tags + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTags() { + return tags; + } + + public void setTags(List tags) { + this.tags = tags; + } + + public NotebookSearchAggregations templateVariablesName( + List templateVariablesName) { + this.templateVariablesName = templateVariablesName; + for (NotebookSearchAggregationBucketKey item : templateVariablesName) { + this.unparsed |= item.unparsed; + } + return this; + } + + public NotebookSearchAggregations addTemplateVariablesNameItem( + NotebookSearchAggregationBucketKey templateVariablesNameItem) { + if (this.templateVariablesName == null) { + this.templateVariablesName = new ArrayList<>(); + } + this.templateVariablesName.add(templateVariablesNameItem); + this.unparsed |= templateVariablesNameItem.unparsed; + return this; + } + + /** + * Aggregation by template variable names. + * + * @return templateVariablesName + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEMPLATE_VARIABLES_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTemplateVariablesName() { + return templateVariablesName; + } + + public void setTemplateVariablesName( + List templateVariablesName) { + this.templateVariablesName = templateVariablesName; + } + + public NotebookSearchAggregations type(List type) { + this.type = type; + for (NotebookSearchAggregationBucketKey item : type) { + this.unparsed |= item.unparsed; + } + return this; + } + + public NotebookSearchAggregations addTypeItem(NotebookSearchAggregationBucketKey typeItem) { + if (this.type == null) { + this.type = new ArrayList<>(); + } + this.type.add(typeItem); + this.unparsed |= typeItem.unparsed; + return this; + } + + /** + * Aggregation by notebook type. + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getType() { + return type; + } + + public void setType(List 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 NotebookSearchAggregations + */ + @JsonAnySetter + public NotebookSearchAggregations 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 NotebookSearchAggregations object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NotebookSearchAggregations notebookSearchAggregations = (NotebookSearchAggregations) o; + return Objects.equals(this.author, notebookSearchAggregations.author) + && Objects.equals(this.tags, notebookSearchAggregations.tags) + && Objects.equals( + this.templateVariablesName, notebookSearchAggregations.templateVariablesName) + && Objects.equals(this.type, notebookSearchAggregations.type) + && Objects.equals( + this.additionalProperties, notebookSearchAggregations.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(author, tags, templateVariablesName, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NotebookSearchAggregations {\n"); + sb.append(" author: ").append(toIndentedString(author)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" templateVariablesName: ") + .append(toIndentedString(templateVariablesName)) + .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/NotebookSearchAttributes.java b/src/main/java/com/datadog/api/client/v2/model/NotebookSearchAttributes.java new file mode 100644 index 00000000000..1b782b86f6e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/NotebookSearchAttributes.java @@ -0,0 +1,210 @@ +/* + * 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; + +/** Notebook search result attributes. */ +@JsonPropertyOrder({ + NotebookSearchAttributes.JSON_PROPERTY_META, + NotebookSearchAttributes.JSON_PROPERTY_NAME, + NotebookSearchAttributes.JSON_PROPERTY_TAGS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class NotebookSearchAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_META = "meta"; + private NotebookSearchMetadata meta; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_TAGS = "tags"; + private List tags = new ArrayList<>(); + + public NotebookSearchAttributes() {} + + @JsonCreator + public NotebookSearchAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_META) NotebookSearchMetadata meta, + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, + @JsonProperty(required = true, value = JSON_PROPERTY_TAGS) List tags) { + this.meta = meta; + this.unparsed |= meta.unparsed; + this.name = name; + this.tags = tags; + } + + public NotebookSearchAttributes meta(NotebookSearchMetadata meta) { + this.meta = meta; + this.unparsed |= meta.unparsed; + return this; + } + + /** + * Metadata about the notebook. + * + * @return meta + */ + @JsonProperty(JSON_PROPERTY_META) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public NotebookSearchMetadata getMeta() { + return meta; + } + + public void setMeta(NotebookSearchMetadata meta) { + this.meta = meta; + } + + public NotebookSearchAttributes name(String name) { + this.name = name; + return this; + } + + /** + * Name of the notebook. + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public NotebookSearchAttributes tags(List tags) { + this.tags = tags; + return this; + } + + public NotebookSearchAttributes addTagsItem(String tagsItem) { + this.tags.add(tagsItem); + return this; + } + + /** + * List of tags for the notebook. + * + * @return tags + */ + @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 NotebookSearchAttributes + */ + @JsonAnySetter + public NotebookSearchAttributes 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 NotebookSearchAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NotebookSearchAttributes notebookSearchAttributes = (NotebookSearchAttributes) o; + return Objects.equals(this.meta, notebookSearchAttributes.meta) + && Objects.equals(this.name, notebookSearchAttributes.name) + && Objects.equals(this.tags, notebookSearchAttributes.tags) + && Objects.equals(this.additionalProperties, notebookSearchAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(meta, name, tags, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NotebookSearchAttributes {\n"); + sb.append(" meta: ").append(toIndentedString(meta)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).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/NotebookSearchHighlight.java b/src/main/java/com/datadog/api/client/v2/model/NotebookSearchHighlight.java new file mode 100644 index 00000000000..95b0b195932 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/NotebookSearchHighlight.java @@ -0,0 +1,217 @@ +/* + * 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.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Highlighted fields from the notebook search. */ +@JsonPropertyOrder({ + NotebookSearchHighlight.JSON_PROPERTY_CELLS_TEXT, + NotebookSearchHighlight.JSON_PROPERTY_CELLS_TITLE, + NotebookSearchHighlight.JSON_PROPERTY_NAME +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class NotebookSearchHighlight { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CELLS_TEXT = "cells.text"; + private List cellsText = null; + + public static final String JSON_PROPERTY_CELLS_TITLE = "cells.title"; + private List cellsTitle = null; + + public static final String JSON_PROPERTY_NAME = "name"; + private List name = null; + + public NotebookSearchHighlight cellsText(List cellsText) { + this.cellsText = cellsText; + return this; + } + + public NotebookSearchHighlight addCellsTextItem(String cellsTextItem) { + if (this.cellsText == null) { + this.cellsText = new ArrayList<>(); + } + this.cellsText.add(cellsTextItem); + return this; + } + + /** + * Highlighted cell text matches. + * + * @return cellsText + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CELLS_TEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getCellsText() { + return cellsText; + } + + public void setCellsText(List cellsText) { + this.cellsText = cellsText; + } + + public NotebookSearchHighlight cellsTitle(List cellsTitle) { + this.cellsTitle = cellsTitle; + return this; + } + + public NotebookSearchHighlight addCellsTitleItem(String cellsTitleItem) { + if (this.cellsTitle == null) { + this.cellsTitle = new ArrayList<>(); + } + this.cellsTitle.add(cellsTitleItem); + return this; + } + + /** + * Highlighted cell title matches. + * + * @return cellsTitle + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CELLS_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getCellsTitle() { + return cellsTitle; + } + + public void setCellsTitle(List cellsTitle) { + this.cellsTitle = cellsTitle; + } + + public NotebookSearchHighlight name(List name) { + this.name = name; + return this; + } + + public NotebookSearchHighlight addNameItem(String nameItem) { + if (this.name == null) { + this.name = new ArrayList<>(); + } + this.name.add(nameItem); + return this; + } + + /** + * Highlighted notebook name matches. + * + * @return name + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getName() { + return name; + } + + public void setName(List name) { + this.name = 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 NotebookSearchHighlight + */ + @JsonAnySetter + public NotebookSearchHighlight 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 NotebookSearchHighlight object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NotebookSearchHighlight notebookSearchHighlight = (NotebookSearchHighlight) o; + return Objects.equals(this.cellsText, notebookSearchHighlight.cellsText) + && Objects.equals(this.cellsTitle, notebookSearchHighlight.cellsTitle) + && Objects.equals(this.name, notebookSearchHighlight.name) + && Objects.equals(this.additionalProperties, notebookSearchHighlight.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(cellsText, cellsTitle, name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NotebookSearchHighlight {\n"); + sb.append(" cellsText: ").append(toIndentedString(cellsText)).append("\n"); + sb.append(" cellsTitle: ").append(toIndentedString(cellsTitle)).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/NotebookSearchMetadata.java b/src/main/java/com/datadog/api/client/v2/model/NotebookSearchMetadata.java new file mode 100644 index 00000000000..748c5590363 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/NotebookSearchMetadata.java @@ -0,0 +1,478 @@ +/* + * 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.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Metadata about the notebook. */ +@JsonPropertyOrder({ + NotebookSearchMetadata.JSON_PROPERTY_AUTHOR, + NotebookSearchMetadata.JSON_PROPERTY_CELL_COUNT, + NotebookSearchMetadata.JSON_PROPERTY_CREATED_AT, + NotebookSearchMetadata.JSON_PROPERTY_DELETED_AT, + NotebookSearchMetadata.JSON_PROPERTY_EXPERIENCE_TYPE, + NotebookSearchMetadata.JSON_PROPERTY_HAS_COMPUTATIONAL_CELLS, + NotebookSearchMetadata.JSON_PROPERTY_IS_FAVORITED, + NotebookSearchMetadata.JSON_PROPERTY_IS_TEMPLATE, + NotebookSearchMetadata.JSON_PROPERTY_MODIFIED_AT, + NotebookSearchMetadata.JSON_PROPERTY_STATUS, + NotebookSearchMetadata.JSON_PROPERTY_TAKE_SNAPSHOTS, + NotebookSearchMetadata.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class NotebookSearchMetadata { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_AUTHOR = "author"; + private NotebookSearchUser author; + + public static final String JSON_PROPERTY_CELL_COUNT = "cell_count"; + private Long cellCount; + + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + private OffsetDateTime createdAt; + + public static final String JSON_PROPERTY_DELETED_AT = "deleted_at"; + private OffsetDateTime deletedAt; + + public static final String JSON_PROPERTY_EXPERIENCE_TYPE = "experience_type"; + private String experienceType; + + public static final String JSON_PROPERTY_HAS_COMPUTATIONAL_CELLS = "has_computational_cells"; + private Boolean hasComputationalCells; + + public static final String JSON_PROPERTY_IS_FAVORITED = "is_favorited"; + private Boolean isFavorited; + + public static final String JSON_PROPERTY_IS_TEMPLATE = "is_template"; + private Boolean isTemplate; + + public static final String JSON_PROPERTY_MODIFIED_AT = "modified_at"; + private OffsetDateTime modifiedAt; + + public static final String JSON_PROPERTY_STATUS = "status"; + private String status; + + public static final String JSON_PROPERTY_TAKE_SNAPSHOTS = "take_snapshots"; + private Boolean takeSnapshots; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + public NotebookSearchMetadata() {} + + @JsonCreator + public NotebookSearchMetadata( + @JsonProperty(required = true, value = JSON_PROPERTY_AUTHOR) NotebookSearchUser author, + @JsonProperty(required = true, value = JSON_PROPERTY_CELL_COUNT) Long cellCount, + @JsonProperty(required = true, value = JSON_PROPERTY_CREATED_AT) OffsetDateTime createdAt, + @JsonProperty(required = true, value = JSON_PROPERTY_DELETED_AT) OffsetDateTime deletedAt, + @JsonProperty(required = true, value = JSON_PROPERTY_EXPERIENCE_TYPE) String experienceType, + @JsonProperty(required = true, value = JSON_PROPERTY_HAS_COMPUTATIONAL_CELLS) + Boolean hasComputationalCells, + @JsonProperty(required = true, value = JSON_PROPERTY_IS_FAVORITED) Boolean isFavorited, + @JsonProperty(required = true, value = JSON_PROPERTY_IS_TEMPLATE) Boolean isTemplate, + @JsonProperty(required = true, value = JSON_PROPERTY_MODIFIED_AT) OffsetDateTime modifiedAt, + @JsonProperty(required = true, value = JSON_PROPERTY_STATUS) String status, + @JsonProperty(required = true, value = JSON_PROPERTY_TAKE_SNAPSHOTS) Boolean takeSnapshots, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) String type) { + this.author = author; + this.unparsed |= author.unparsed; + this.cellCount = cellCount; + this.createdAt = createdAt; + this.deletedAt = deletedAt; + if (deletedAt != null) {} + this.experienceType = experienceType; + if (experienceType != null) {} + this.hasComputationalCells = hasComputationalCells; + this.isFavorited = isFavorited; + this.isTemplate = isTemplate; + this.modifiedAt = modifiedAt; + this.status = status; + this.takeSnapshots = takeSnapshots; + this.type = type; + } + + public NotebookSearchMetadata author(NotebookSearchUser author) { + this.author = author; + this.unparsed |= author.unparsed; + return this; + } + + /** + * User information. + * + * @return author + */ + @JsonProperty(JSON_PROPERTY_AUTHOR) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public NotebookSearchUser getAuthor() { + return author; + } + + public void setAuthor(NotebookSearchUser author) { + this.author = author; + } + + public NotebookSearchMetadata cellCount(Long cellCount) { + this.cellCount = cellCount; + return this; + } + + /** + * Number of cells in the notebook. + * + * @return cellCount + */ + @JsonProperty(JSON_PROPERTY_CELL_COUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getCellCount() { + return cellCount; + } + + public void setCellCount(Long cellCount) { + this.cellCount = cellCount; + } + + public NotebookSearchMetadata createdAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Time at which the notebook was created. + * + * @return createdAt + */ + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + public NotebookSearchMetadata deletedAt(OffsetDateTime deletedAt) { + this.deletedAt = deletedAt; + if (deletedAt != null) {} + return this; + } + + /** + * Time at which the notebook was deleted, or null if not deleted. + * + * @return deletedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DELETED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OffsetDateTime getDeletedAt() { + return deletedAt; + } + + public void setDeletedAt(OffsetDateTime deletedAt) { + this.deletedAt = deletedAt; + } + + public NotebookSearchMetadata experienceType(String experienceType) { + this.experienceType = experienceType; + if (experienceType != null) {} + return this; + } + + /** + * Experience type of the notebook. + * + * @return experienceType + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EXPERIENCE_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getExperienceType() { + return experienceType; + } + + public void setExperienceType(String experienceType) { + this.experienceType = experienceType; + } + + public NotebookSearchMetadata hasComputationalCells(Boolean hasComputationalCells) { + this.hasComputationalCells = hasComputationalCells; + return this; + } + + /** + * Whether the notebook has computational cells. + * + * @return hasComputationalCells + */ + @JsonProperty(JSON_PROPERTY_HAS_COMPUTATIONAL_CELLS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getHasComputationalCells() { + return hasComputationalCells; + } + + public void setHasComputationalCells(Boolean hasComputationalCells) { + this.hasComputationalCells = hasComputationalCells; + } + + public NotebookSearchMetadata isFavorited(Boolean isFavorited) { + this.isFavorited = isFavorited; + return this; + } + + /** + * Whether the notebook is favorited by the user. + * + * @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 NotebookSearchMetadata isTemplate(Boolean isTemplate) { + this.isTemplate = isTemplate; + return this; + } + + /** + * Whether the notebook is a template. + * + * @return isTemplate + */ + @JsonProperty(JSON_PROPERTY_IS_TEMPLATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getIsTemplate() { + return isTemplate; + } + + public void setIsTemplate(Boolean isTemplate) { + this.isTemplate = isTemplate; + } + + public NotebookSearchMetadata modifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = modifiedAt; + return this; + } + + /** + * Time at which the notebook was last updated. + * + * @return modifiedAt + */ + @JsonProperty(JSON_PROPERTY_MODIFIED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OffsetDateTime getModifiedAt() { + return modifiedAt; + } + + public void setModifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = modifiedAt; + } + + public NotebookSearchMetadata status(String status) { + this.status = status; + return this; + } + + /** + * Status of the notebook. + * + * @return status + */ + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public NotebookSearchMetadata takeSnapshots(Boolean takeSnapshots) { + this.takeSnapshots = takeSnapshots; + return this; + } + + /** + * Whether the notebook can take a snapshot. + * + * @return takeSnapshots + */ + @JsonProperty(JSON_PROPERTY_TAKE_SNAPSHOTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getTakeSnapshots() { + return takeSnapshots; + } + + public void setTakeSnapshots(Boolean takeSnapshots) { + this.takeSnapshots = takeSnapshots; + } + + public NotebookSearchMetadata type(String type) { + this.type = type; + return this; + } + + /** + * Notebook 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 NotebookSearchMetadata + */ + @JsonAnySetter + public NotebookSearchMetadata 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 NotebookSearchMetadata object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NotebookSearchMetadata notebookSearchMetadata = (NotebookSearchMetadata) o; + return Objects.equals(this.author, notebookSearchMetadata.author) + && Objects.equals(this.cellCount, notebookSearchMetadata.cellCount) + && Objects.equals(this.createdAt, notebookSearchMetadata.createdAt) + && Objects.equals(this.deletedAt, notebookSearchMetadata.deletedAt) + && Objects.equals(this.experienceType, notebookSearchMetadata.experienceType) + && Objects.equals(this.hasComputationalCells, notebookSearchMetadata.hasComputationalCells) + && Objects.equals(this.isFavorited, notebookSearchMetadata.isFavorited) + && Objects.equals(this.isTemplate, notebookSearchMetadata.isTemplate) + && Objects.equals(this.modifiedAt, notebookSearchMetadata.modifiedAt) + && Objects.equals(this.status, notebookSearchMetadata.status) + && Objects.equals(this.takeSnapshots, notebookSearchMetadata.takeSnapshots) + && Objects.equals(this.type, notebookSearchMetadata.type) + && Objects.equals(this.additionalProperties, notebookSearchMetadata.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + author, + cellCount, + createdAt, + deletedAt, + experienceType, + hasComputationalCells, + isFavorited, + isTemplate, + modifiedAt, + status, + takeSnapshots, + type, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NotebookSearchMetadata {\n"); + sb.append(" author: ").append(toIndentedString(author)).append("\n"); + sb.append(" cellCount: ").append(toIndentedString(cellCount)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" deletedAt: ").append(toIndentedString(deletedAt)).append("\n"); + sb.append(" experienceType: ").append(toIndentedString(experienceType)).append("\n"); + sb.append(" hasComputationalCells: ") + .append(toIndentedString(hasComputationalCells)) + .append("\n"); + sb.append(" isFavorited: ").append(toIndentedString(isFavorited)).append("\n"); + sb.append(" isTemplate: ").append(toIndentedString(isTemplate)).append("\n"); + sb.append(" modifiedAt: ").append(toIndentedString(modifiedAt)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" takeSnapshots: ").append(toIndentedString(takeSnapshots)).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/NotebookSearchResponse.java b/src/main/java/com/datadog/api/client/v2/model/NotebookSearchResponse.java new file mode 100644 index 00000000000..c053057b405 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/NotebookSearchResponse.java @@ -0,0 +1,187 @@ +/* + * 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 notebook search results. */ +@JsonPropertyOrder({ + NotebookSearchResponse.JSON_PROPERTY_DATA, + NotebookSearchResponse.JSON_PROPERTY_META +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class NotebookSearchResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public static final String JSON_PROPERTY_META = "meta"; + private NotebookSearchResponseMeta meta; + + public NotebookSearchResponse() {} + + @JsonCreator + public NotebookSearchResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + List data, + @JsonProperty(required = true, value = JSON_PROPERTY_META) NotebookSearchResponseMeta meta) { + this.data = data; + this.meta = meta; + this.unparsed |= meta.unparsed; + } + + public NotebookSearchResponse data(List data) { + this.data = data; + for (NotebookSearchResultData item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public NotebookSearchResponse addDataItem(NotebookSearchResultData dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * List of notebook search results. + * + * @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 NotebookSearchResponse meta(NotebookSearchResponseMeta meta) { + this.meta = meta; + this.unparsed |= meta.unparsed; + return this; + } + + /** + * Metadata about the notebook search results. + * + * @return meta + */ + @JsonProperty(JSON_PROPERTY_META) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public NotebookSearchResponseMeta getMeta() { + return meta; + } + + public void setMeta(NotebookSearchResponseMeta 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 NotebookSearchResponse + */ + @JsonAnySetter + public NotebookSearchResponse 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 NotebookSearchResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NotebookSearchResponse notebookSearchResponse = (NotebookSearchResponse) o; + return Objects.equals(this.data, notebookSearchResponse.data) + && Objects.equals(this.meta, notebookSearchResponse.meta) + && Objects.equals(this.additionalProperties, notebookSearchResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, meta, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NotebookSearchResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).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/NotebookSearchResponseMeta.java b/src/main/java/com/datadog/api/client/v2/model/NotebookSearchResponseMeta.java new file mode 100644 index 00000000000..85ebc724e80 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/NotebookSearchResponseMeta.java @@ -0,0 +1,174 @@ +/* + * 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; + +/** Metadata about the notebook search results. */ +@JsonPropertyOrder({ + NotebookSearchResponseMeta.JSON_PROPERTY_AGGREGATIONS, + NotebookSearchResponseMeta.JSON_PROPERTY_TOTAL +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class NotebookSearchResponseMeta { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_AGGREGATIONS = "aggregations"; + private NotebookSearchAggregations aggregations; + + public static final String JSON_PROPERTY_TOTAL = "total"; + private Long total; + + public NotebookSearchResponseMeta() {} + + @JsonCreator + public NotebookSearchResponseMeta( + @JsonProperty(required = true, value = JSON_PROPERTY_TOTAL) Long total) { + this.total = total; + } + + public NotebookSearchResponseMeta aggregations(NotebookSearchAggregations aggregations) { + this.aggregations = aggregations; + this.unparsed |= aggregations.unparsed; + return this; + } + + /** + * Aggregations of notebook search results. + * + * @return aggregations + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AGGREGATIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public NotebookSearchAggregations getAggregations() { + return aggregations; + } + + public void setAggregations(NotebookSearchAggregations aggregations) { + this.aggregations = aggregations; + } + + public NotebookSearchResponseMeta total(Long total) { + this.total = total; + return this; + } + + /** + * Total number of notebooks found. + * + * @return total + */ + @JsonProperty(JSON_PROPERTY_TOTAL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getTotal() { + return total; + } + + public void setTotal(Long total) { + this.total = total; + } + + /** + * 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 NotebookSearchResponseMeta + */ + @JsonAnySetter + public NotebookSearchResponseMeta 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 NotebookSearchResponseMeta object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NotebookSearchResponseMeta notebookSearchResponseMeta = (NotebookSearchResponseMeta) o; + return Objects.equals(this.aggregations, notebookSearchResponseMeta.aggregations) + && Objects.equals(this.total, notebookSearchResponseMeta.total) + && Objects.equals( + this.additionalProperties, notebookSearchResponseMeta.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(aggregations, total, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NotebookSearchResponseMeta {\n"); + sb.append(" aggregations: ").append(toIndentedString(aggregations)).append("\n"); + sb.append(" total: ").append(toIndentedString(total)).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/NotebookSearchResultData.java b/src/main/java/com/datadog/api/client/v2/model/NotebookSearchResultData.java new file mode 100644 index 00000000000..f9982ee0fe2 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/NotebookSearchResultData.java @@ -0,0 +1,237 @@ +/* + * 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 notebook search result. */ +@JsonPropertyOrder({ + NotebookSearchResultData.JSON_PROPERTY_HIGHLIGHT, + NotebookSearchResultData.JSON_PROPERTY_ID, + NotebookSearchResultData.JSON_PROPERTY_NOTEBOOK_DATA, + NotebookSearchResultData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class NotebookSearchResultData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_HIGHLIGHT = "highlight"; + private NotebookSearchHighlight highlight; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_NOTEBOOK_DATA = "notebook_data"; + private NotebookSearchAttributes notebookData; + + public static final String JSON_PROPERTY_TYPE = "type"; + private MetricNotebookType type; + + public NotebookSearchResultData() {} + + @JsonCreator + public NotebookSearchResultData( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_NOTEBOOK_DATA) + NotebookSearchAttributes notebookData, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) MetricNotebookType type) { + this.id = id; + this.notebookData = notebookData; + this.unparsed |= notebookData.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public NotebookSearchResultData highlight(NotebookSearchHighlight highlight) { + this.highlight = highlight; + this.unparsed |= highlight.unparsed; + return this; + } + + /** + * Highlighted fields from the notebook search. + * + * @return highlight + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HIGHLIGHT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public NotebookSearchHighlight getHighlight() { + return highlight; + } + + public void setHighlight(NotebookSearchHighlight highlight) { + this.highlight = highlight; + } + + public NotebookSearchResultData id(String id) { + this.id = id; + return this; + } + + /** + * Notebook identifier. + * + * @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 NotebookSearchResultData notebookData(NotebookSearchAttributes notebookData) { + this.notebookData = notebookData; + this.unparsed |= notebookData.unparsed; + return this; + } + + /** + * Notebook search result attributes. + * + * @return notebookData + */ + @JsonProperty(JSON_PROPERTY_NOTEBOOK_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public NotebookSearchAttributes getNotebookData() { + return notebookData; + } + + public void setNotebookData(NotebookSearchAttributes notebookData) { + this.notebookData = notebookData; + } + + public NotebookSearchResultData type(MetricNotebookType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Notebook resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public MetricNotebookType getType() { + return type; + } + + public void setType(MetricNotebookType 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 NotebookSearchResultData + */ + @JsonAnySetter + public NotebookSearchResultData 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 NotebookSearchResultData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NotebookSearchResultData notebookSearchResultData = (NotebookSearchResultData) o; + return Objects.equals(this.highlight, notebookSearchResultData.highlight) + && Objects.equals(this.id, notebookSearchResultData.id) + && Objects.equals(this.notebookData, notebookSearchResultData.notebookData) + && Objects.equals(this.type, notebookSearchResultData.type) + && Objects.equals(this.additionalProperties, notebookSearchResultData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(highlight, id, notebookData, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NotebookSearchResultData {\n"); + sb.append(" highlight: ").append(toIndentedString(highlight)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" notebookData: ").append(toIndentedString(notebookData)).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/NotebookSearchUser.java b/src/main/java/com/datadog/api/client/v2/model/NotebookSearchUser.java new file mode 100644 index 00000000000..ffc67f79aca --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/NotebookSearchUser.java @@ -0,0 +1,170 @@ +/* + * 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; + +/** User information. */ +@JsonPropertyOrder({NotebookSearchUser.JSON_PROPERTY_HANDLE, NotebookSearchUser.JSON_PROPERTY_NAME}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class NotebookSearchUser { + @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 String name; + + public NotebookSearchUser() {} + + @JsonCreator + public NotebookSearchUser( + @JsonProperty(required = true, value = JSON_PROPERTY_HANDLE) String handle, + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name) { + this.handle = handle; + this.name = name; + } + + public NotebookSearchUser handle(String handle) { + this.handle = handle; + return this; + } + + /** + * User handle or email. + * + * @return handle + */ + @JsonProperty(JSON_PROPERTY_HANDLE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getHandle() { + return handle; + } + + public void setHandle(String handle) { + this.handle = handle; + } + + public NotebookSearchUser name(String name) { + this.name = name; + return this; + } + + /** + * User display name. + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = 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 NotebookSearchUser + */ + @JsonAnySetter + public NotebookSearchUser 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 NotebookSearchUser object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NotebookSearchUser notebookSearchUser = (NotebookSearchUser) o; + return Objects.equals(this.handle, notebookSearchUser.handle) + && Objects.equals(this.name, notebookSearchUser.name) + && Objects.equals(this.additionalProperties, notebookSearchUser.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(handle, name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NotebookSearchUser {\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/test/resources/com/datadog/api/client/v2/api/dashboards.feature b/src/test/resources/com/datadog/api/client/v2/api/dashboards.feature new file mode 100644 index 00000000000..8601f547e95 --- /dev/null +++ b/src/test/resources/com/datadog/api/client/v2/api/dashboards.feature @@ -0,0 +1,21 @@ +@endpoint(dashboards) @endpoint(dashboards-v2) +Feature: Dashboards + Interact with your dashboards through the API to search and retrieve + dashboards. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "Dashboards" API + And operation "SearchDashboards" enabled + And new "SearchDashboards" request + + @generated @skip @team:DataDog/notebooks-backend + Scenario: Search dashboards returns "Bad Request" response + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/notebooks-backend + Scenario: Search dashboards returns "OK" response + When the request is sent + Then the response status is 200 OK diff --git a/src/test/resources/com/datadog/api/client/v2/api/notebooks.feature b/src/test/resources/com/datadog/api/client/v2/api/notebooks.feature new file mode 100644 index 00000000000..2b5255c89bd --- /dev/null +++ b/src/test/resources/com/datadog/api/client/v2/api/notebooks.feature @@ -0,0 +1,21 @@ +@endpoint(notebooks) @endpoint(notebooks-v2) +Feature: Notebooks + Interact with your notebooks through the API to search and retrieve + notebooks. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "Notebooks" API + And operation "SearchNotebooks" enabled + And new "SearchNotebooks" request + + @generated @skip @team:DataDog/notebooks-backend + Scenario: Search notebooks returns "Bad Request" response + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/notebooks-backend + Scenario: Search notebooks returns "OK" response + When the request is sent + Then the response status is 200 OK 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 7e549784ee6..d561c026ced 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 @@ -1319,6 +1319,12 @@ "type": "safe" } }, + "SearchDashboards": { + "tag": "Dashboards", + "undo": { + "type": "safe" + } + }, "GetAllDatasets": { "tag": "Datasets", "undo": { @@ -3110,6 +3116,12 @@ "type": "safe" } }, + "SearchNotebooks": { + "tag": "Notebooks", + "undo": { + "type": "safe" + } + }, "ListPipelines": { "tag": "Observability Pipelines", "undo": {