diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 4857ca25ab3..e2256f32bd5 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -48138,6 +48138,430 @@ components: type: string x-enum-varnames: - PROCESS + ProductAnalyticsAnalyticsQuery: + description: The analytics query definition containing a base query, compute + rule, and optional grouping. + properties: + audience_filters: + $ref: '#/components/schemas/ProductAnalyticsAudienceFilters' + compute: + $ref: '#/components/schemas/ProductAnalyticsCompute' + group_by: + description: Group-by rules for segmenting results. + items: + $ref: '#/components/schemas/ProductAnalyticsGroupBy' + type: array + indexes: + description: Restrict the query to specific indexes. Max 1 entry. + items: + type: string + maxItems: 1 + type: array + query: + $ref: '#/components/schemas/ProductAnalyticsBaseQuery' + required: + - query + - compute + type: object + ProductAnalyticsAnalyticsRequest: + description: Request for computing analytics results (scalar or timeseries). + example: + data: + attributes: + from: 1771232048460 + query: + compute: + aggregation: count + query: + data_source: product_analytics + search: + query: '@type:view' + to: 1771836848262 + type: formula_analytics_extended_request + properties: + data: + $ref: '#/components/schemas/ProductAnalyticsAnalyticsRequestData' + required: + - data + type: object + ProductAnalyticsAnalyticsRequestAttributes: + description: Attributes for an analytics request. + properties: + enforced_execution_type: + $ref: '#/components/schemas/ProductAnalyticsExecutionType' + from: + description: Start time in epoch milliseconds. Must be less than `to`. + example: 1771232048460 + format: int64 + type: integer + query: + $ref: '#/components/schemas/ProductAnalyticsAnalyticsQuery' + request_id: + description: Optional request ID for multi-step query continuation. + type: string + to: + description: End time in epoch milliseconds. + example: 1771836848262 + format: int64 + type: integer + required: + - from + - to + - query + type: object + ProductAnalyticsAnalyticsRequestData: + description: Data object for an analytics request. + properties: + attributes: + $ref: '#/components/schemas/ProductAnalyticsAnalyticsRequestAttributes' + type: + $ref: '#/components/schemas/ProductAnalyticsAnalyticsRequestType' + required: + - type + - attributes + type: object + ProductAnalyticsAnalyticsRequestType: + description: The resource type for analytics requests. + enum: + - formula_analytics_extended_request + example: formula_analytics_extended_request + type: string + x-enum-varnames: + - FORMULA_ANALYTICS_EXTENDED_REQUEST + ProductAnalyticsAudienceAccountSubquery: + description: An account-based audience query. + properties: + name: + description: Name of this query, referenced in the formula. + example: '' + type: string + query: + description: Search query for filtering accounts. + type: string + required: + - name + type: object + ProductAnalyticsAudienceFilters: + description: Audience filter definitions for targeting specific user segments. + properties: + accounts: + description: Account audience queries. + items: + $ref: '#/components/schemas/ProductAnalyticsAudienceAccountSubquery' + type: array + formula: + description: Boolean formula combining audience queries by name. + example: u + type: string + segments: + description: Segment audience queries. + items: + $ref: '#/components/schemas/ProductAnalyticsAudienceSegmentSubquery' + type: array + users: + description: User audience queries. + items: + $ref: '#/components/schemas/ProductAnalyticsAudienceUserSubquery' + type: array + type: object + ProductAnalyticsAudienceSegmentSubquery: + description: A segment-based audience query. + properties: + name: + description: Name of this query, referenced in the formula. + example: '' + type: string + segment_id: + description: UUID of the segment to filter by. + example: '' + format: uuid + type: string + required: + - name + - segment_id + type: object + ProductAnalyticsAudienceUserSubquery: + description: A user-based audience query. + properties: + name: + description: Name of this query, referenced in the formula. + example: u + type: string + query: + description: Search query for filtering users. + example: '*' + type: string + required: + - name + type: object + ProductAnalyticsBaseQuery: + description: 'A query definition discriminated by the `data_source` field. + + Use `product_analytics` for standard event queries, or + + `product_analytics_occurrence` for occurrence-filtered queries.' + oneOf: + - $ref: '#/components/schemas/ProductAnalyticsEventQuery' + - $ref: '#/components/schemas/ProductAnalyticsOccurrenceQuery' + ProductAnalyticsCompute: + description: A compute rule for aggregating data. + properties: + aggregation: + description: The aggregation function (count, cardinality, avg, sum, min, + max, etc.). + example: count + type: string + interval: + description: Time bucket size in milliseconds. Required for timeseries queries. + example: 3600000 + format: int64 + type: integer + metric: + description: The metric to aggregate on. Required for non-count aggregations. + example: '@session.time_spent' + type: string + required: + - aggregation + type: object + ProductAnalyticsEventQuery: + description: A standard Product Analytics event query. + properties: + data_source: + $ref: '#/components/schemas/ProductAnalyticsEventQueryDataSource' + search: + $ref: '#/components/schemas/ProductAnalyticsEventSearch' + required: + - data_source + - search + type: object + ProductAnalyticsEventQueryDataSource: + description: The data source identifier. + enum: + - product_analytics + example: product_analytics + type: string + x-enum-varnames: + - PRODUCT_ANALYTICS + ProductAnalyticsEventSearch: + description: Search parameters for an event query. + properties: + query: + description: The search query using Datadog search syntax. + example: '@type:view' + type: string + type: object + ProductAnalyticsExecutionType: + description: Override the query execution strategy. + enum: + - simple + - background + - trino-multistep + - materialized-view + type: string + x-enum-varnames: + - SIMPLE + - BACKGROUND + - TRINO_MULTISTEP + - MATERIALIZED_VIEW + ProductAnalyticsGroupBy: + description: A group-by rule for segmenting results by facet values. + properties: + facet: + description: The facet to group by. + example: '@view.name' + type: string + limit: + description: Maximum number of groups to return. + example: 10 + format: int64 + type: integer + should_exclude_missing: + default: false + description: Exclude results with missing facet values. + type: boolean + sort: + $ref: '#/components/schemas/ProductAnalyticsGroupBySort' + source: + description: The source for audience-filter-based group-by. + type: string + required: + - facet + type: object + ProductAnalyticsGroupBySort: + description: Sort configuration for group-by results. + properties: + aggregation: + description: The aggregation function to sort by. + example: count + type: string + metric: + description: The metric to sort by. + type: string + order: + $ref: '#/components/schemas/QuerySortOrder' + type: object + ProductAnalyticsInterval: + description: An interval definition in a timeseries response. + properties: + milliseconds: + format: int64 + type: integer + start_time: + format: int64 + type: integer + times: + items: + format: int64 + type: integer + type: array + type: + type: string + type: object + ProductAnalyticsOccurrenceFilter: + description: Filter for occurrence-based queries. + properties: + meta: + additionalProperties: + type: string + description: Additional metadata. + type: object + operator: + description: Comparison operator (=, >=, <=, >, <). + example: '>=' + type: string + value: + description: The occurrence count threshold as a string. + example: '1' + type: string + required: + - operator + - value + type: object + ProductAnalyticsOccurrenceQuery: + description: A Product Analytics occurrence-filtered query. + properties: + data_source: + $ref: '#/components/schemas/ProductAnalyticsOccurrenceQueryDataSource' + search: + $ref: '#/components/schemas/ProductAnalyticsOccurrenceSearch' + required: + - data_source + - search + type: object + ProductAnalyticsOccurrenceQueryDataSource: + description: The data source identifier for occurrence queries. + enum: + - product_analytics_occurrence + example: product_analytics_occurrence + type: string + x-enum-varnames: + - PRODUCT_ANALYTICS_OCCURRENCE + ProductAnalyticsOccurrenceSearch: + description: Search parameters for an occurrence query. + properties: + occurrences: + $ref: '#/components/schemas/ProductAnalyticsOccurrenceFilter' + query: + description: The search query using Datadog search syntax. + example: '@type:action' + type: string + type: object + ProductAnalyticsResponseMeta: + description: Metadata for a Product Analytics query response. + properties: + request_id: + type: string + status: + $ref: '#/components/schemas/ProductAnalyticsResponseMetaStatus' + type: object + ProductAnalyticsResponseMetaStatus: + enum: + - done + - running + - timeout + type: string + x-enum-varnames: + - DONE + - RUNNING + - TIMEOUT + ProductAnalyticsScalarColumn: + description: A column in a scalar response. + properties: + meta: + $ref: '#/components/schemas/ProductAnalyticsScalarColumnMeta' + name: + description: Column name (facet name for group-by, or "query"). + type: string + type: + $ref: '#/components/schemas/ProductAnalyticsScalarColumnType' + values: + description: Column values. + items: {} + type: array + type: object + ProductAnalyticsScalarColumnMeta: + properties: + unit: + items: + $ref: '#/components/schemas/ProductAnalyticsUnit' + nullable: true + type: array + type: object + ProductAnalyticsScalarColumnType: + description: Column type. + enum: + - number + - group + type: string + x-enum-varnames: + - NUMBER + - GROUP + ProductAnalyticsScalarResponse: + description: Response for a scalar analytics query. + properties: + data: + $ref: '#/components/schemas/ProductAnalyticsScalarResponseData' + meta: + $ref: '#/components/schemas/ProductAnalyticsResponseMeta' + type: object + ProductAnalyticsScalarResponseAttributes: + properties: + columns: + items: + $ref: '#/components/schemas/ProductAnalyticsScalarColumn' + type: array + type: object + ProductAnalyticsScalarResponseData: + description: Data object for a scalar response. + properties: + attributes: + $ref: '#/components/schemas/ProductAnalyticsScalarResponseAttributes' + id: + type: string + type: + $ref: '#/components/schemas/ProductAnalyticsScalarResponseType' + type: object + ProductAnalyticsScalarResponseType: + enum: + - scalar_response + type: string + x-enum-varnames: + - SCALAR_RESPONSE + ProductAnalyticsSerie: + description: A series in a timeseries response. + properties: + group_tags: + items: + type: string + type: array + query_index: + format: int64 + type: integer + unit: + items: + $ref: '#/components/schemas/ProductAnalyticsUnit' + type: array + type: object ProductAnalyticsServerSideEventError: description: Error details. properties: @@ -48246,6 +48670,75 @@ components: required: - id type: object + ProductAnalyticsTimeseriesResponse: + description: Response for a timeseries analytics query. + properties: + data: + $ref: '#/components/schemas/ProductAnalyticsTimeseriesResponseData' + meta: + $ref: '#/components/schemas/ProductAnalyticsResponseMeta' + type: object + ProductAnalyticsTimeseriesResponseAttributes: + properties: + intervals: + items: + $ref: '#/components/schemas/ProductAnalyticsInterval' + type: array + series: + items: + $ref: '#/components/schemas/ProductAnalyticsSerie' + type: array + times: + description: Timestamps for each data point (epoch milliseconds). + items: + format: int64 + type: integer + type: array + values: + description: Values for each series at each time point. + items: + items: + format: double + nullable: true + type: number + type: array + type: array + type: object + ProductAnalyticsTimeseriesResponseData: + properties: + attributes: + $ref: '#/components/schemas/ProductAnalyticsTimeseriesResponseAttributes' + id: + type: string + type: + $ref: '#/components/schemas/ProductAnalyticsTimeseriesResponseType' + type: object + ProductAnalyticsTimeseriesResponseType: + enum: + - timeseries_response + type: string + x-enum-varnames: + - TIMESERIES_RESPONSE + ProductAnalyticsUnit: + description: A unit definition for metric values. + properties: + family: + example: time + type: string + id: + format: int64 + type: integer + name: + example: nanosecond + type: string + plural: + type: string + scale_factor: + format: double + type: number + short_name: + type: string + type: object Project: description: A Project properties: @@ -92643,6 +93136,75 @@ paths: tags: - Rum Audience Management x-unstable: '**Note**: This endpoint may be subject to changes.' + /api/v2/product-analytics/analytics/scalar: + post: + description: 'Compute scalar analytics results for Product Analytics data. + + Returns aggregated values (counts, averages, percentiles) optionally grouped + by facets.' + operationId: QueryProductAnalyticsScalar + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ProductAnalyticsAnalyticsRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ProductAnalyticsScalarResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/NotAuthorizedResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Compute scalar analytics + tags: + - Product Analytics + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - rum_apps_read + /api/v2/product-analytics/analytics/timeseries: + post: + description: 'Compute timeseries analytics results for Product Analytics data. + + Returns time-bucketed values for charts and trend analysis. + + The `compute.interval` field (milliseconds) is required for time bucketing.' + operationId: QueryProductAnalyticsTimeseries + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ProductAnalyticsAnalyticsRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ProductAnalyticsTimeseriesResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/NotAuthorizedResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Compute timeseries analytics + tags: + - Product Analytics + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - rum_apps_read /api/v2/product-analytics/users/event_filtered_query: post: description: Query users filtered by both user properties and event platform diff --git a/examples/v2/product-analytics/QueryProductAnalyticsScalar.java b/examples/v2/product-analytics/QueryProductAnalyticsScalar.java new file mode 100644 index 00000000000..481c810d5bc --- /dev/null +++ b/examples/v2/product-analytics/QueryProductAnalyticsScalar.java @@ -0,0 +1,56 @@ +// Compute scalar analytics returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.ProductAnalyticsApi; +import com.datadog.api.client.v2.model.ProductAnalyticsAnalyticsQuery; +import com.datadog.api.client.v2.model.ProductAnalyticsAnalyticsRequest; +import com.datadog.api.client.v2.model.ProductAnalyticsAnalyticsRequestAttributes; +import com.datadog.api.client.v2.model.ProductAnalyticsAnalyticsRequestData; +import com.datadog.api.client.v2.model.ProductAnalyticsAnalyticsRequestType; +import com.datadog.api.client.v2.model.ProductAnalyticsBaseQuery; +import com.datadog.api.client.v2.model.ProductAnalyticsCompute; +import com.datadog.api.client.v2.model.ProductAnalyticsEventQuery; +import com.datadog.api.client.v2.model.ProductAnalyticsEventQueryDataSource; +import com.datadog.api.client.v2.model.ProductAnalyticsEventSearch; +import com.datadog.api.client.v2.model.ProductAnalyticsScalarResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + ProductAnalyticsApi apiInstance = new ProductAnalyticsApi(defaultClient); + + ProductAnalyticsAnalyticsRequest body = + new ProductAnalyticsAnalyticsRequest() + .data( + new ProductAnalyticsAnalyticsRequestData() + .attributes( + new ProductAnalyticsAnalyticsRequestAttributes() + .from(1771232048460L) + .query( + new ProductAnalyticsAnalyticsQuery() + .compute(new ProductAnalyticsCompute().aggregation("count")) + .query( + new ProductAnalyticsBaseQuery( + new ProductAnalyticsEventQuery() + .dataSource( + ProductAnalyticsEventQueryDataSource + .PRODUCT_ANALYTICS) + .search( + new ProductAnalyticsEventSearch() + .query("@type:view"))))) + .to(1771836848262L)) + .type(ProductAnalyticsAnalyticsRequestType.FORMULA_ANALYTICS_EXTENDED_REQUEST)); + + try { + ProductAnalyticsScalarResponse result = apiInstance.queryProductAnalyticsScalar(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ProductAnalyticsApi#queryProductAnalyticsScalar"); + 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/product-analytics/QueryProductAnalyticsTimeseries.java b/examples/v2/product-analytics/QueryProductAnalyticsTimeseries.java new file mode 100644 index 00000000000..65cabce7a35 --- /dev/null +++ b/examples/v2/product-analytics/QueryProductAnalyticsTimeseries.java @@ -0,0 +1,57 @@ +// Compute timeseries analytics returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.ProductAnalyticsApi; +import com.datadog.api.client.v2.model.ProductAnalyticsAnalyticsQuery; +import com.datadog.api.client.v2.model.ProductAnalyticsAnalyticsRequest; +import com.datadog.api.client.v2.model.ProductAnalyticsAnalyticsRequestAttributes; +import com.datadog.api.client.v2.model.ProductAnalyticsAnalyticsRequestData; +import com.datadog.api.client.v2.model.ProductAnalyticsAnalyticsRequestType; +import com.datadog.api.client.v2.model.ProductAnalyticsBaseQuery; +import com.datadog.api.client.v2.model.ProductAnalyticsCompute; +import com.datadog.api.client.v2.model.ProductAnalyticsEventQuery; +import com.datadog.api.client.v2.model.ProductAnalyticsEventQueryDataSource; +import com.datadog.api.client.v2.model.ProductAnalyticsEventSearch; +import com.datadog.api.client.v2.model.ProductAnalyticsTimeseriesResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + ProductAnalyticsApi apiInstance = new ProductAnalyticsApi(defaultClient); + + ProductAnalyticsAnalyticsRequest body = + new ProductAnalyticsAnalyticsRequest() + .data( + new ProductAnalyticsAnalyticsRequestData() + .attributes( + new ProductAnalyticsAnalyticsRequestAttributes() + .from(1771232048460L) + .query( + new ProductAnalyticsAnalyticsQuery() + .compute(new ProductAnalyticsCompute().aggregation("count")) + .query( + new ProductAnalyticsBaseQuery( + new ProductAnalyticsEventQuery() + .dataSource( + ProductAnalyticsEventQueryDataSource + .PRODUCT_ANALYTICS) + .search( + new ProductAnalyticsEventSearch() + .query("@type:view"))))) + .to(1771836848262L)) + .type(ProductAnalyticsAnalyticsRequestType.FORMULA_ANALYTICS_EXTENDED_REQUEST)); + + try { + ProductAnalyticsTimeseriesResponse result = apiInstance.queryProductAnalyticsTimeseries(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling ProductAnalyticsApi#queryProductAnalyticsTimeseries"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/datadog/api/client/v2/api/ProductAnalyticsApi.java b/src/main/java/com/datadog/api/client/v2/api/ProductAnalyticsApi.java index 4059a272fdb..d0c712b8895 100644 --- a/src/main/java/com/datadog/api/client/v2/api/ProductAnalyticsApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/ProductAnalyticsApi.java @@ -4,7 +4,10 @@ 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.ProductAnalyticsAnalyticsRequest; +import com.datadog.api.client.v2.model.ProductAnalyticsScalarResponse; import com.datadog.api.client.v2.model.ProductAnalyticsServerSideEventItem; +import com.datadog.api.client.v2.model.ProductAnalyticsTimeseriesResponse; import jakarta.ws.rs.client.Invocation; import jakarta.ws.rs.core.GenericType; import java.util.ArrayList; @@ -43,6 +46,284 @@ public void setApiClient(ApiClient apiClient) { this.apiClient = apiClient; } + /** + * Compute scalar analytics. + * + *

See {@link #queryProductAnalyticsScalarWithHttpInfo}. + * + * @param body (required) + * @return ProductAnalyticsScalarResponse + * @throws ApiException if fails to make API call + */ + public ProductAnalyticsScalarResponse queryProductAnalyticsScalar( + ProductAnalyticsAnalyticsRequest body) throws ApiException { + return queryProductAnalyticsScalarWithHttpInfo(body).getData(); + } + + /** + * Compute scalar analytics. + * + *

See {@link #queryProductAnalyticsScalarWithHttpInfoAsync}. + * + * @param body (required) + * @return CompletableFuture<ProductAnalyticsScalarResponse> + */ + public CompletableFuture queryProductAnalyticsScalarAsync( + ProductAnalyticsAnalyticsRequest body) { + return queryProductAnalyticsScalarWithHttpInfoAsync(body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Compute scalar analytics results for Product Analytics data. Returns aggregated values (counts, + * averages, percentiles) optionally grouped by facets. + * + * @param body (required) + * @return ApiResponse<ProductAnalyticsScalarResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Not Authorized -
429 Too many requests -
+ */ + public ApiResponse queryProductAnalyticsScalarWithHttpInfo( + ProductAnalyticsAnalyticsRequest body) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling queryProductAnalyticsScalar"); + } + // create path and map variables + String localVarPath = "/api/v2/product-analytics/analytics/scalar"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.ProductAnalyticsApi.queryProductAnalyticsScalar", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Compute scalar analytics. + * + *

See {@link #queryProductAnalyticsScalarWithHttpInfo}. + * + * @param body (required) + * @return CompletableFuture<ApiResponse<ProductAnalyticsScalarResponse>> + */ + public CompletableFuture> + queryProductAnalyticsScalarWithHttpInfoAsync(ProductAnalyticsAnalyticsRequest body) { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'body' when calling queryProductAnalyticsScalar")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/product-analytics/analytics/scalar"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.ProductAnalyticsApi.queryProductAnalyticsScalar", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Compute timeseries analytics. + * + *

See {@link #queryProductAnalyticsTimeseriesWithHttpInfo}. + * + * @param body (required) + * @return ProductAnalyticsTimeseriesResponse + * @throws ApiException if fails to make API call + */ + public ProductAnalyticsTimeseriesResponse queryProductAnalyticsTimeseries( + ProductAnalyticsAnalyticsRequest body) throws ApiException { + return queryProductAnalyticsTimeseriesWithHttpInfo(body).getData(); + } + + /** + * Compute timeseries analytics. + * + *

See {@link #queryProductAnalyticsTimeseriesWithHttpInfoAsync}. + * + * @param body (required) + * @return CompletableFuture<ProductAnalyticsTimeseriesResponse> + */ + public CompletableFuture queryProductAnalyticsTimeseriesAsync( + ProductAnalyticsAnalyticsRequest body) { + return queryProductAnalyticsTimeseriesWithHttpInfoAsync(body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Compute timeseries analytics results for Product Analytics data. Returns time-bucketed values + * for charts and trend analysis. The compute.interval field (milliseconds) is + * required for time bucketing. + * + * @param body (required) + * @return ApiResponse<ProductAnalyticsTimeseriesResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Not Authorized -
429 Too many requests -
+ */ + public ApiResponse + queryProductAnalyticsTimeseriesWithHttpInfo(ProductAnalyticsAnalyticsRequest body) + throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, + "Missing the required parameter 'body' when calling queryProductAnalyticsTimeseries"); + } + // create path and map variables + String localVarPath = "/api/v2/product-analytics/analytics/timeseries"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.ProductAnalyticsApi.queryProductAnalyticsTimeseries", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Compute timeseries analytics. + * + *

See {@link #queryProductAnalyticsTimeseriesWithHttpInfo}. + * + * @param body (required) + * @return CompletableFuture<ApiResponse<ProductAnalyticsTimeseriesResponse>> + */ + public CompletableFuture> + queryProductAnalyticsTimeseriesWithHttpInfoAsync(ProductAnalyticsAnalyticsRequest body) { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'body' when calling" + + " queryProductAnalyticsTimeseries")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/product-analytics/analytics/timeseries"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.ProductAnalyticsApi.queryProductAnalyticsTimeseries", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + /** * Send server-side events. * diff --git a/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsAnalyticsQuery.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsAnalyticsQuery.java new file mode 100644 index 00000000000..19c9062cda5 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsAnalyticsQuery.java @@ -0,0 +1,286 @@ +/* + * 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; + +/** The analytics query definition containing a base query, compute rule, and optional grouping. */ +@JsonPropertyOrder({ + ProductAnalyticsAnalyticsQuery.JSON_PROPERTY_AUDIENCE_FILTERS, + ProductAnalyticsAnalyticsQuery.JSON_PROPERTY_COMPUTE, + ProductAnalyticsAnalyticsQuery.JSON_PROPERTY_GROUP_BY, + ProductAnalyticsAnalyticsQuery.JSON_PROPERTY_INDEXES, + ProductAnalyticsAnalyticsQuery.JSON_PROPERTY_QUERY +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsAnalyticsQuery { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_AUDIENCE_FILTERS = "audience_filters"; + private ProductAnalyticsAudienceFilters audienceFilters; + + public static final String JSON_PROPERTY_COMPUTE = "compute"; + private ProductAnalyticsCompute compute; + + public static final String JSON_PROPERTY_GROUP_BY = "group_by"; + private List groupBy = null; + + public static final String JSON_PROPERTY_INDEXES = "indexes"; + private List indexes = null; + + public static final String JSON_PROPERTY_QUERY = "query"; + private ProductAnalyticsBaseQuery query; + + public ProductAnalyticsAnalyticsQuery() {} + + @JsonCreator + public ProductAnalyticsAnalyticsQuery( + @JsonProperty(required = true, value = JSON_PROPERTY_COMPUTE) ProductAnalyticsCompute compute, + @JsonProperty(required = true, value = JSON_PROPERTY_QUERY) ProductAnalyticsBaseQuery query) { + this.compute = compute; + this.unparsed |= compute.unparsed; + this.query = query; + this.unparsed |= query.unparsed; + } + + public ProductAnalyticsAnalyticsQuery audienceFilters( + ProductAnalyticsAudienceFilters audienceFilters) { + this.audienceFilters = audienceFilters; + this.unparsed |= audienceFilters.unparsed; + return this; + } + + /** + * Audience filter definitions for targeting specific user segments. + * + * @return audienceFilters + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AUDIENCE_FILTERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ProductAnalyticsAudienceFilters getAudienceFilters() { + return audienceFilters; + } + + public void setAudienceFilters(ProductAnalyticsAudienceFilters audienceFilters) { + this.audienceFilters = audienceFilters; + } + + public ProductAnalyticsAnalyticsQuery compute(ProductAnalyticsCompute compute) { + this.compute = compute; + this.unparsed |= compute.unparsed; + return this; + } + + /** + * A compute rule for aggregating data. + * + * @return compute + */ + @JsonProperty(JSON_PROPERTY_COMPUTE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsCompute getCompute() { + return compute; + } + + public void setCompute(ProductAnalyticsCompute compute) { + this.compute = compute; + } + + public ProductAnalyticsAnalyticsQuery groupBy(List groupBy) { + this.groupBy = groupBy; + for (ProductAnalyticsGroupBy item : groupBy) { + this.unparsed |= item.unparsed; + } + return this; + } + + public ProductAnalyticsAnalyticsQuery addGroupByItem(ProductAnalyticsGroupBy groupByItem) { + if (this.groupBy == null) { + this.groupBy = new ArrayList<>(); + } + this.groupBy.add(groupByItem); + this.unparsed |= groupByItem.unparsed; + return this; + } + + /** + * Group-by rules for segmenting results. + * + * @return groupBy + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_GROUP_BY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getGroupBy() { + return groupBy; + } + + public void setGroupBy(List groupBy) { + this.groupBy = groupBy; + } + + public ProductAnalyticsAnalyticsQuery indexes(List indexes) { + this.indexes = indexes; + return this; + } + + public ProductAnalyticsAnalyticsQuery addIndexesItem(String indexesItem) { + if (this.indexes == null) { + this.indexes = new ArrayList<>(); + } + this.indexes.add(indexesItem); + return this; + } + + /** + * Restrict the query to specific indexes. Max 1 entry. + * + * @return indexes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INDEXES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getIndexes() { + return indexes; + } + + public void setIndexes(List indexes) { + this.indexes = indexes; + } + + public ProductAnalyticsAnalyticsQuery query(ProductAnalyticsBaseQuery query) { + this.query = query; + this.unparsed |= query.unparsed; + return this; + } + + /** + * A query definition discriminated by the data_source field. Use + * product_analytics for standard event queries, or product_analytics_occurrence + * for occurrence-filtered queries. + * + * @return query + */ + @JsonProperty(JSON_PROPERTY_QUERY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsBaseQuery getQuery() { + return query; + } + + public void setQuery(ProductAnalyticsBaseQuery query) { + this.query = query; + } + + /** + * 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 ProductAnalyticsAnalyticsQuery + */ + @JsonAnySetter + public ProductAnalyticsAnalyticsQuery 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 ProductAnalyticsAnalyticsQuery object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsAnalyticsQuery productAnalyticsAnalyticsQuery = + (ProductAnalyticsAnalyticsQuery) o; + return Objects.equals(this.audienceFilters, productAnalyticsAnalyticsQuery.audienceFilters) + && Objects.equals(this.compute, productAnalyticsAnalyticsQuery.compute) + && Objects.equals(this.groupBy, productAnalyticsAnalyticsQuery.groupBy) + && Objects.equals(this.indexes, productAnalyticsAnalyticsQuery.indexes) + && Objects.equals(this.query, productAnalyticsAnalyticsQuery.query) + && Objects.equals( + this.additionalProperties, productAnalyticsAnalyticsQuery.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(audienceFilters, compute, groupBy, indexes, query, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsAnalyticsQuery {\n"); + sb.append(" audienceFilters: ").append(toIndentedString(audienceFilters)).append("\n"); + sb.append(" compute: ").append(toIndentedString(compute)).append("\n"); + sb.append(" groupBy: ").append(toIndentedString(groupBy)).append("\n"); + sb.append(" indexes: ").append(toIndentedString(indexes)).append("\n"); + sb.append(" query: ").append(toIndentedString(query)).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/ProductAnalyticsAnalyticsRequest.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsAnalyticsRequest.java new file mode 100644 index 00000000000..408f785708d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsAnalyticsRequest.java @@ -0,0 +1,148 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Request for computing analytics results (scalar or timeseries). */ +@JsonPropertyOrder({ProductAnalyticsAnalyticsRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsAnalyticsRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private ProductAnalyticsAnalyticsRequestData data; + + public ProductAnalyticsAnalyticsRequest() {} + + @JsonCreator + public ProductAnalyticsAnalyticsRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + ProductAnalyticsAnalyticsRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public ProductAnalyticsAnalyticsRequest data(ProductAnalyticsAnalyticsRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data object for an analytics request. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsAnalyticsRequestData getData() { + return data; + } + + public void setData(ProductAnalyticsAnalyticsRequestData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ProductAnalyticsAnalyticsRequest + */ + @JsonAnySetter + public ProductAnalyticsAnalyticsRequest 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 ProductAnalyticsAnalyticsRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsAnalyticsRequest productAnalyticsAnalyticsRequest = + (ProductAnalyticsAnalyticsRequest) o; + return Objects.equals(this.data, productAnalyticsAnalyticsRequest.data) + && Objects.equals( + this.additionalProperties, productAnalyticsAnalyticsRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsAnalyticsRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsAnalyticsRequestAttributes.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsAnalyticsRequestAttributes.java new file mode 100644 index 00000000000..636b55250e8 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsAnalyticsRequestAttributes.java @@ -0,0 +1,271 @@ +/* + * 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; + +/** Attributes for an analytics request. */ +@JsonPropertyOrder({ + ProductAnalyticsAnalyticsRequestAttributes.JSON_PROPERTY_ENFORCED_EXECUTION_TYPE, + ProductAnalyticsAnalyticsRequestAttributes.JSON_PROPERTY_FROM, + ProductAnalyticsAnalyticsRequestAttributes.JSON_PROPERTY_QUERY, + ProductAnalyticsAnalyticsRequestAttributes.JSON_PROPERTY_REQUEST_ID, + ProductAnalyticsAnalyticsRequestAttributes.JSON_PROPERTY_TO +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsAnalyticsRequestAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ENFORCED_EXECUTION_TYPE = "enforced_execution_type"; + private ProductAnalyticsExecutionType enforcedExecutionType; + + public static final String JSON_PROPERTY_FROM = "from"; + private Long from; + + public static final String JSON_PROPERTY_QUERY = "query"; + private ProductAnalyticsAnalyticsQuery query; + + public static final String JSON_PROPERTY_REQUEST_ID = "request_id"; + private String requestId; + + public static final String JSON_PROPERTY_TO = "to"; + private Long to; + + public ProductAnalyticsAnalyticsRequestAttributes() {} + + @JsonCreator + public ProductAnalyticsAnalyticsRequestAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_FROM) Long from, + @JsonProperty(required = true, value = JSON_PROPERTY_QUERY) + ProductAnalyticsAnalyticsQuery query, + @JsonProperty(required = true, value = JSON_PROPERTY_TO) Long to) { + this.from = from; + this.query = query; + this.unparsed |= query.unparsed; + this.to = to; + } + + public ProductAnalyticsAnalyticsRequestAttributes enforcedExecutionType( + ProductAnalyticsExecutionType enforcedExecutionType) { + this.enforcedExecutionType = enforcedExecutionType; + this.unparsed |= !enforcedExecutionType.isValid(); + return this; + } + + /** + * Override the query execution strategy. + * + * @return enforcedExecutionType + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENFORCED_EXECUTION_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ProductAnalyticsExecutionType getEnforcedExecutionType() { + return enforcedExecutionType; + } + + public void setEnforcedExecutionType(ProductAnalyticsExecutionType enforcedExecutionType) { + if (!enforcedExecutionType.isValid()) { + this.unparsed = true; + } + this.enforcedExecutionType = enforcedExecutionType; + } + + public ProductAnalyticsAnalyticsRequestAttributes from(Long from) { + this.from = from; + return this; + } + + /** + * Start time in epoch milliseconds. Must be less than to. + * + * @return from + */ + @JsonProperty(JSON_PROPERTY_FROM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getFrom() { + return from; + } + + public void setFrom(Long from) { + this.from = from; + } + + public ProductAnalyticsAnalyticsRequestAttributes query(ProductAnalyticsAnalyticsQuery query) { + this.query = query; + this.unparsed |= query.unparsed; + return this; + } + + /** + * The analytics query definition containing a base query, compute rule, and optional grouping. + * + * @return query + */ + @JsonProperty(JSON_PROPERTY_QUERY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsAnalyticsQuery getQuery() { + return query; + } + + public void setQuery(ProductAnalyticsAnalyticsQuery query) { + this.query = query; + } + + public ProductAnalyticsAnalyticsRequestAttributes requestId(String requestId) { + this.requestId = requestId; + return this; + } + + /** + * Optional request ID for multi-step query continuation. + * + * @return requestId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REQUEST_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getRequestId() { + return requestId; + } + + public void setRequestId(String requestId) { + this.requestId = requestId; + } + + public ProductAnalyticsAnalyticsRequestAttributes to(Long to) { + this.to = to; + return this; + } + + /** + * End time in epoch milliseconds. + * + * @return to + */ + @JsonProperty(JSON_PROPERTY_TO) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getTo() { + return to; + } + + public void setTo(Long to) { + this.to = to; + } + + /** + * 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 ProductAnalyticsAnalyticsRequestAttributes + */ + @JsonAnySetter + public ProductAnalyticsAnalyticsRequestAttributes 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 ProductAnalyticsAnalyticsRequestAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsAnalyticsRequestAttributes productAnalyticsAnalyticsRequestAttributes = + (ProductAnalyticsAnalyticsRequestAttributes) o; + return Objects.equals( + this.enforcedExecutionType, + productAnalyticsAnalyticsRequestAttributes.enforcedExecutionType) + && Objects.equals(this.from, productAnalyticsAnalyticsRequestAttributes.from) + && Objects.equals(this.query, productAnalyticsAnalyticsRequestAttributes.query) + && Objects.equals(this.requestId, productAnalyticsAnalyticsRequestAttributes.requestId) + && Objects.equals(this.to, productAnalyticsAnalyticsRequestAttributes.to) + && Objects.equals( + this.additionalProperties, + productAnalyticsAnalyticsRequestAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(enforcedExecutionType, from, query, requestId, to, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsAnalyticsRequestAttributes {\n"); + sb.append(" enforcedExecutionType: ") + .append(toIndentedString(enforcedExecutionType)) + .append("\n"); + sb.append(" from: ").append(toIndentedString(from)).append("\n"); + sb.append(" query: ").append(toIndentedString(query)).append("\n"); + sb.append(" requestId: ").append(toIndentedString(requestId)).append("\n"); + sb.append(" to: ").append(toIndentedString(to)).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/ProductAnalyticsAnalyticsRequestData.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsAnalyticsRequestData.java new file mode 100644 index 00000000000..e9f42571bd6 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsAnalyticsRequestData.java @@ -0,0 +1,185 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data object for an analytics request. */ +@JsonPropertyOrder({ + ProductAnalyticsAnalyticsRequestData.JSON_PROPERTY_ATTRIBUTES, + ProductAnalyticsAnalyticsRequestData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsAnalyticsRequestData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private ProductAnalyticsAnalyticsRequestAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ProductAnalyticsAnalyticsRequestType type; + + public ProductAnalyticsAnalyticsRequestData() {} + + @JsonCreator + public ProductAnalyticsAnalyticsRequestData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + ProductAnalyticsAnalyticsRequestAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + ProductAnalyticsAnalyticsRequestType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public ProductAnalyticsAnalyticsRequestData attributes( + ProductAnalyticsAnalyticsRequestAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes for an analytics request. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsAnalyticsRequestAttributes getAttributes() { + return attributes; + } + + public void setAttributes(ProductAnalyticsAnalyticsRequestAttributes attributes) { + this.attributes = attributes; + } + + public ProductAnalyticsAnalyticsRequestData type(ProductAnalyticsAnalyticsRequestType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The resource type for analytics requests. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsAnalyticsRequestType getType() { + return type; + } + + public void setType(ProductAnalyticsAnalyticsRequestType 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 ProductAnalyticsAnalyticsRequestData + */ + @JsonAnySetter + public ProductAnalyticsAnalyticsRequestData 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 ProductAnalyticsAnalyticsRequestData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsAnalyticsRequestData productAnalyticsAnalyticsRequestData = + (ProductAnalyticsAnalyticsRequestData) o; + return Objects.equals(this.attributes, productAnalyticsAnalyticsRequestData.attributes) + && Objects.equals(this.type, productAnalyticsAnalyticsRequestData.type) + && Objects.equals( + this.additionalProperties, productAnalyticsAnalyticsRequestData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsAnalyticsRequestData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsAnalyticsRequestType.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsAnalyticsRequestType.java new file mode 100644 index 00000000000..10013e87e85 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsAnalyticsRequestType.java @@ -0,0 +1,60 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The resource type for analytics requests. */ +@JsonSerialize( + using = + ProductAnalyticsAnalyticsRequestType.ProductAnalyticsAnalyticsRequestTypeSerializer.class) +public class ProductAnalyticsAnalyticsRequestType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("formula_analytics_extended_request")); + + public static final ProductAnalyticsAnalyticsRequestType FORMULA_ANALYTICS_EXTENDED_REQUEST = + new ProductAnalyticsAnalyticsRequestType("formula_analytics_extended_request"); + + ProductAnalyticsAnalyticsRequestType(String value) { + super(value, allowedValues); + } + + public static class ProductAnalyticsAnalyticsRequestTypeSerializer + extends StdSerializer { + public ProductAnalyticsAnalyticsRequestTypeSerializer( + Class t) { + super(t); + } + + public ProductAnalyticsAnalyticsRequestTypeSerializer() { + this(null); + } + + @Override + public void serialize( + ProductAnalyticsAnalyticsRequestType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ProductAnalyticsAnalyticsRequestType fromValue(String value) { + return new ProductAnalyticsAnalyticsRequestType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsAudienceAccountSubquery.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsAudienceAccountSubquery.java new file mode 100644 index 00000000000..33a4778bb0c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsAudienceAccountSubquery.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; + +/** An account-based audience query. */ +@JsonPropertyOrder({ + ProductAnalyticsAudienceAccountSubquery.JSON_PROPERTY_NAME, + ProductAnalyticsAudienceAccountSubquery.JSON_PROPERTY_QUERY +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsAudienceAccountSubquery { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_QUERY = "query"; + private String query; + + public ProductAnalyticsAudienceAccountSubquery() {} + + @JsonCreator + public ProductAnalyticsAudienceAccountSubquery( + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name) { + this.name = name; + } + + public ProductAnalyticsAudienceAccountSubquery name(String name) { + this.name = name; + return this; + } + + /** + * Name of this query, referenced in the formula. + * + * @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 ProductAnalyticsAudienceAccountSubquery query(String query) { + this.query = query; + return this; + } + + /** + * Search query for filtering accounts. + * + * @return query + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_QUERY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getQuery() { + return query; + } + + public void setQuery(String query) { + this.query = query; + } + + /** + * 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 ProductAnalyticsAudienceAccountSubquery + */ + @JsonAnySetter + public ProductAnalyticsAudienceAccountSubquery 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 ProductAnalyticsAudienceAccountSubquery object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsAudienceAccountSubquery productAnalyticsAudienceAccountSubquery = + (ProductAnalyticsAudienceAccountSubquery) o; + return Objects.equals(this.name, productAnalyticsAudienceAccountSubquery.name) + && Objects.equals(this.query, productAnalyticsAudienceAccountSubquery.query) + && Objects.equals( + this.additionalProperties, + productAnalyticsAudienceAccountSubquery.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, query, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsAudienceAccountSubquery {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" query: ").append(toIndentedString(query)).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/ProductAnalyticsAudienceFilters.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsAudienceFilters.java new file mode 100644 index 00000000000..406a6911e71 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsAudienceFilters.java @@ -0,0 +1,263 @@ +/* + * 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; + +/** Audience filter definitions for targeting specific user segments. */ +@JsonPropertyOrder({ + ProductAnalyticsAudienceFilters.JSON_PROPERTY_ACCOUNTS, + ProductAnalyticsAudienceFilters.JSON_PROPERTY_FORMULA, + ProductAnalyticsAudienceFilters.JSON_PROPERTY_SEGMENTS, + ProductAnalyticsAudienceFilters.JSON_PROPERTY_USERS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsAudienceFilters { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ACCOUNTS = "accounts"; + private List accounts = null; + + public static final String JSON_PROPERTY_FORMULA = "formula"; + private String formula; + + public static final String JSON_PROPERTY_SEGMENTS = "segments"; + private List segments = null; + + public static final String JSON_PROPERTY_USERS = "users"; + private List users = null; + + public ProductAnalyticsAudienceFilters accounts( + List accounts) { + this.accounts = accounts; + for (ProductAnalyticsAudienceAccountSubquery item : accounts) { + this.unparsed |= item.unparsed; + } + return this; + } + + public ProductAnalyticsAudienceFilters addAccountsItem( + ProductAnalyticsAudienceAccountSubquery accountsItem) { + if (this.accounts == null) { + this.accounts = new ArrayList<>(); + } + this.accounts.add(accountsItem); + this.unparsed |= accountsItem.unparsed; + return this; + } + + /** + * Account audience queries. + * + * @return accounts + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ACCOUNTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getAccounts() { + return accounts; + } + + public void setAccounts(List accounts) { + this.accounts = accounts; + } + + public ProductAnalyticsAudienceFilters formula(String formula) { + this.formula = formula; + return this; + } + + /** + * Boolean formula combining audience queries by name. + * + * @return formula + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FORMULA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFormula() { + return formula; + } + + public void setFormula(String formula) { + this.formula = formula; + } + + public ProductAnalyticsAudienceFilters segments( + List segments) { + this.segments = segments; + for (ProductAnalyticsAudienceSegmentSubquery item : segments) { + this.unparsed |= item.unparsed; + } + return this; + } + + public ProductAnalyticsAudienceFilters addSegmentsItem( + ProductAnalyticsAudienceSegmentSubquery segmentsItem) { + if (this.segments == null) { + this.segments = new ArrayList<>(); + } + this.segments.add(segmentsItem); + this.unparsed |= segmentsItem.unparsed; + return this; + } + + /** + * Segment audience queries. + * + * @return segments + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SEGMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getSegments() { + return segments; + } + + public void setSegments(List segments) { + this.segments = segments; + } + + public ProductAnalyticsAudienceFilters users(List users) { + this.users = users; + for (ProductAnalyticsAudienceUserSubquery item : users) { + this.unparsed |= item.unparsed; + } + return this; + } + + public ProductAnalyticsAudienceFilters addUsersItem( + ProductAnalyticsAudienceUserSubquery usersItem) { + if (this.users == null) { + this.users = new ArrayList<>(); + } + this.users.add(usersItem); + this.unparsed |= usersItem.unparsed; + return this; + } + + /** + * User audience queries. + * + * @return users + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getUsers() { + return users; + } + + public void setUsers(List users) { + this.users = users; + } + + /** + * 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 ProductAnalyticsAudienceFilters + */ + @JsonAnySetter + public ProductAnalyticsAudienceFilters 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 ProductAnalyticsAudienceFilters object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsAudienceFilters productAnalyticsAudienceFilters = + (ProductAnalyticsAudienceFilters) o; + return Objects.equals(this.accounts, productAnalyticsAudienceFilters.accounts) + && Objects.equals(this.formula, productAnalyticsAudienceFilters.formula) + && Objects.equals(this.segments, productAnalyticsAudienceFilters.segments) + && Objects.equals(this.users, productAnalyticsAudienceFilters.users) + && Objects.equals( + this.additionalProperties, productAnalyticsAudienceFilters.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(accounts, formula, segments, users, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsAudienceFilters {\n"); + sb.append(" accounts: ").append(toIndentedString(accounts)).append("\n"); + sb.append(" formula: ").append(toIndentedString(formula)).append("\n"); + sb.append(" segments: ").append(toIndentedString(segments)).append("\n"); + sb.append(" users: ").append(toIndentedString(users)).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/ProductAnalyticsAudienceSegmentSubquery.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsAudienceSegmentSubquery.java new file mode 100644 index 00000000000..f36b2ae0257 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsAudienceSegmentSubquery.java @@ -0,0 +1,177 @@ +/* + * 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; +import java.util.UUID; + +/** A segment-based audience query. */ +@JsonPropertyOrder({ + ProductAnalyticsAudienceSegmentSubquery.JSON_PROPERTY_NAME, + ProductAnalyticsAudienceSegmentSubquery.JSON_PROPERTY_SEGMENT_ID +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsAudienceSegmentSubquery { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_SEGMENT_ID = "segment_id"; + private UUID segmentId; + + public ProductAnalyticsAudienceSegmentSubquery() {} + + @JsonCreator + public ProductAnalyticsAudienceSegmentSubquery( + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, + @JsonProperty(required = true, value = JSON_PROPERTY_SEGMENT_ID) UUID segmentId) { + this.name = name; + this.segmentId = segmentId; + } + + public ProductAnalyticsAudienceSegmentSubquery name(String name) { + this.name = name; + return this; + } + + /** + * Name of this query, referenced in the formula. + * + * @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 ProductAnalyticsAudienceSegmentSubquery segmentId(UUID segmentId) { + this.segmentId = segmentId; + return this; + } + + /** + * UUID of the segment to filter by. + * + * @return segmentId + */ + @JsonProperty(JSON_PROPERTY_SEGMENT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UUID getSegmentId() { + return segmentId; + } + + public void setSegmentId(UUID segmentId) { + this.segmentId = segmentId; + } + + /** + * 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 ProductAnalyticsAudienceSegmentSubquery + */ + @JsonAnySetter + public ProductAnalyticsAudienceSegmentSubquery 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 ProductAnalyticsAudienceSegmentSubquery object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsAudienceSegmentSubquery productAnalyticsAudienceSegmentSubquery = + (ProductAnalyticsAudienceSegmentSubquery) o; + return Objects.equals(this.name, productAnalyticsAudienceSegmentSubquery.name) + && Objects.equals(this.segmentId, productAnalyticsAudienceSegmentSubquery.segmentId) + && Objects.equals( + this.additionalProperties, + productAnalyticsAudienceSegmentSubquery.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, segmentId, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsAudienceSegmentSubquery {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" segmentId: ").append(toIndentedString(segmentId)).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/ProductAnalyticsAudienceUserSubquery.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsAudienceUserSubquery.java new file mode 100644 index 00000000000..0719526f51b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsAudienceUserSubquery.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; + +/** A user-based audience query. */ +@JsonPropertyOrder({ + ProductAnalyticsAudienceUserSubquery.JSON_PROPERTY_NAME, + ProductAnalyticsAudienceUserSubquery.JSON_PROPERTY_QUERY +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsAudienceUserSubquery { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_QUERY = "query"; + private String query; + + public ProductAnalyticsAudienceUserSubquery() {} + + @JsonCreator + public ProductAnalyticsAudienceUserSubquery( + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name) { + this.name = name; + } + + public ProductAnalyticsAudienceUserSubquery name(String name) { + this.name = name; + return this; + } + + /** + * Name of this query, referenced in the formula. + * + * @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 ProductAnalyticsAudienceUserSubquery query(String query) { + this.query = query; + return this; + } + + /** + * Search query for filtering users. + * + * @return query + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_QUERY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getQuery() { + return query; + } + + public void setQuery(String query) { + this.query = query; + } + + /** + * 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 ProductAnalyticsAudienceUserSubquery + */ + @JsonAnySetter + public ProductAnalyticsAudienceUserSubquery 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 ProductAnalyticsAudienceUserSubquery object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsAudienceUserSubquery productAnalyticsAudienceUserSubquery = + (ProductAnalyticsAudienceUserSubquery) o; + return Objects.equals(this.name, productAnalyticsAudienceUserSubquery.name) + && Objects.equals(this.query, productAnalyticsAudienceUserSubquery.query) + && Objects.equals( + this.additionalProperties, productAnalyticsAudienceUserSubquery.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, query, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsAudienceUserSubquery {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" query: ").append(toIndentedString(query)).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/ProductAnalyticsBaseQuery.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsBaseQuery.java new file mode 100644 index 00000000000..e6434b395e0 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsBaseQuery.java @@ -0,0 +1,286 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.AbstractOpenApiSchema; +import com.datadog.api.client.JSON; +import com.datadog.api.client.UnparsedObject; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.JsonToken; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.MapperFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import jakarta.ws.rs.core.GenericType; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; + +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +@JsonDeserialize(using = ProductAnalyticsBaseQuery.ProductAnalyticsBaseQueryDeserializer.class) +@JsonSerialize(using = ProductAnalyticsBaseQuery.ProductAnalyticsBaseQuerySerializer.class) +public class ProductAnalyticsBaseQuery extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(ProductAnalyticsBaseQuery.class.getName()); + + @JsonIgnore public boolean unparsed = false; + + public static class ProductAnalyticsBaseQuerySerializer + extends StdSerializer { + public ProductAnalyticsBaseQuerySerializer(Class t) { + super(t); + } + + public ProductAnalyticsBaseQuerySerializer() { + this(null); + } + + @Override + public void serialize( + ProductAnalyticsBaseQuery value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.getActualInstance()); + } + } + + public static class ProductAnalyticsBaseQueryDeserializer + extends StdDeserializer { + public ProductAnalyticsBaseQueryDeserializer() { + this(ProductAnalyticsBaseQuery.class); + } + + public ProductAnalyticsBaseQueryDeserializer(Class vc) { + super(vc); + } + + @Override + public ProductAnalyticsBaseQuery deserialize(JsonParser jp, DeserializationContext ctxt) + throws IOException, JsonProcessingException { + JsonNode tree = jp.readValueAsTree(); + Object deserialized = null; + Object tmp = null; + boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); + int match = 0; + JsonToken token = tree.traverse(jp.getCodec()).nextToken(); + // deserialize ProductAnalyticsEventQuery + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (ProductAnalyticsEventQuery.class.equals(Integer.class) + || ProductAnalyticsEventQuery.class.equals(Long.class) + || ProductAnalyticsEventQuery.class.equals(Float.class) + || ProductAnalyticsEventQuery.class.equals(Double.class) + || ProductAnalyticsEventQuery.class.equals(Boolean.class) + || ProductAnalyticsEventQuery.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((ProductAnalyticsEventQuery.class.equals(Integer.class) + || ProductAnalyticsEventQuery.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((ProductAnalyticsEventQuery.class.equals(Float.class) + || ProductAnalyticsEventQuery.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (ProductAnalyticsEventQuery.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (ProductAnalyticsEventQuery.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(ProductAnalyticsEventQuery.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + if (!((ProductAnalyticsEventQuery) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'ProductAnalyticsEventQuery'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'ProductAnalyticsEventQuery'", e); + } + + // deserialize ProductAnalyticsOccurrenceQuery + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (ProductAnalyticsOccurrenceQuery.class.equals(Integer.class) + || ProductAnalyticsOccurrenceQuery.class.equals(Long.class) + || ProductAnalyticsOccurrenceQuery.class.equals(Float.class) + || ProductAnalyticsOccurrenceQuery.class.equals(Double.class) + || ProductAnalyticsOccurrenceQuery.class.equals(Boolean.class) + || ProductAnalyticsOccurrenceQuery.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((ProductAnalyticsOccurrenceQuery.class.equals(Integer.class) + || ProductAnalyticsOccurrenceQuery.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((ProductAnalyticsOccurrenceQuery.class.equals(Float.class) + || ProductAnalyticsOccurrenceQuery.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (ProductAnalyticsOccurrenceQuery.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (ProductAnalyticsOccurrenceQuery.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(ProductAnalyticsOccurrenceQuery.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + if (!((ProductAnalyticsOccurrenceQuery) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'ProductAnalyticsOccurrenceQuery'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log( + Level.FINER, "Input data does not match schema 'ProductAnalyticsOccurrenceQuery'", e); + } + + ProductAnalyticsBaseQuery ret = new ProductAnalyticsBaseQuery(); + if (match == 1) { + ret.setActualInstance(deserialized); + } else { + Map res = + new ObjectMapper() + .readValue( + tree.traverse(jp.getCodec()).readValueAsTree().toString(), + new TypeReference>() {}); + ret.setActualInstance(new UnparsedObject(res)); + } + return ret; + } + + /** Handle deserialization of the 'null' value. */ + @Override + public ProductAnalyticsBaseQuery getNullValue(DeserializationContext ctxt) + throws JsonMappingException { + throw new JsonMappingException(ctxt.getParser(), "ProductAnalyticsBaseQuery cannot be null"); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public ProductAnalyticsBaseQuery() { + super("oneOf", Boolean.FALSE); + } + + public ProductAnalyticsBaseQuery(ProductAnalyticsEventQuery o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public ProductAnalyticsBaseQuery(ProductAnalyticsOccurrenceQuery o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("ProductAnalyticsEventQuery", new GenericType() {}); + schemas.put( + "ProductAnalyticsOccurrenceQuery", new GenericType() {}); + JSON.registerDescendants(ProductAnalyticsBaseQuery.class, Collections.unmodifiableMap(schemas)); + } + + @Override + public Map getSchemas() { + return ProductAnalyticsBaseQuery.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: ProductAnalyticsEventQuery, ProductAnalyticsOccurrenceQuery + * + *

It could be an instance of the 'oneOf' schemas. The oneOf child schemas may themselves be a + * composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (JSON.isInstanceOf(ProductAnalyticsEventQuery.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf( + ProductAnalyticsOccurrenceQuery.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(UnparsedObject.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + throw new RuntimeException( + "Invalid instance type. Must be ProductAnalyticsEventQuery," + + " ProductAnalyticsOccurrenceQuery"); + } + + /** + * Get the actual instance, which can be the following: ProductAnalyticsEventQuery, + * ProductAnalyticsOccurrenceQuery + * + * @return The actual instance (ProductAnalyticsEventQuery, ProductAnalyticsOccurrenceQuery) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `ProductAnalyticsEventQuery`. If the actual instance is not + * `ProductAnalyticsEventQuery`, the ClassCastException will be thrown. + * + * @return The actual instance of `ProductAnalyticsEventQuery` + * @throws ClassCastException if the instance is not `ProductAnalyticsEventQuery` + */ + public ProductAnalyticsEventQuery getProductAnalyticsEventQuery() throws ClassCastException { + return (ProductAnalyticsEventQuery) super.getActualInstance(); + } + + /** + * Get the actual instance of `ProductAnalyticsOccurrenceQuery`. If the actual instance is not + * `ProductAnalyticsOccurrenceQuery`, the ClassCastException will be thrown. + * + * @return The actual instance of `ProductAnalyticsOccurrenceQuery` + * @throws ClassCastException if the instance is not `ProductAnalyticsOccurrenceQuery` + */ + public ProductAnalyticsOccurrenceQuery getProductAnalyticsOccurrenceQuery() + throws ClassCastException { + return (ProductAnalyticsOccurrenceQuery) super.getActualInstance(); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsCompute.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsCompute.java new file mode 100644 index 00000000000..ed11f5c4999 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsCompute.java @@ -0,0 +1,199 @@ +/* + * 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 compute rule for aggregating data. */ +@JsonPropertyOrder({ + ProductAnalyticsCompute.JSON_PROPERTY_AGGREGATION, + ProductAnalyticsCompute.JSON_PROPERTY_INTERVAL, + ProductAnalyticsCompute.JSON_PROPERTY_METRIC +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsCompute { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_AGGREGATION = "aggregation"; + private String aggregation; + + public static final String JSON_PROPERTY_INTERVAL = "interval"; + private Long interval; + + public static final String JSON_PROPERTY_METRIC = "metric"; + private String metric; + + public ProductAnalyticsCompute() {} + + @JsonCreator + public ProductAnalyticsCompute( + @JsonProperty(required = true, value = JSON_PROPERTY_AGGREGATION) String aggregation) { + this.aggregation = aggregation; + } + + public ProductAnalyticsCompute aggregation(String aggregation) { + this.aggregation = aggregation; + return this; + } + + /** + * The aggregation function (count, cardinality, avg, sum, min, max, etc.). + * + * @return aggregation + */ + @JsonProperty(JSON_PROPERTY_AGGREGATION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getAggregation() { + return aggregation; + } + + public void setAggregation(String aggregation) { + this.aggregation = aggregation; + } + + public ProductAnalyticsCompute interval(Long interval) { + this.interval = interval; + return this; + } + + /** + * Time bucket size in milliseconds. Required for timeseries queries. + * + * @return interval + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INTERVAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getInterval() { + return interval; + } + + public void setInterval(Long interval) { + this.interval = interval; + } + + public ProductAnalyticsCompute metric(String metric) { + this.metric = metric; + return this; + } + + /** + * The metric to aggregate on. Required for non-count aggregations. + * + * @return metric + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_METRIC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMetric() { + return metric; + } + + public void setMetric(String metric) { + this.metric = metric; + } + + /** + * 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 ProductAnalyticsCompute + */ + @JsonAnySetter + public ProductAnalyticsCompute 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 ProductAnalyticsCompute object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsCompute productAnalyticsCompute = (ProductAnalyticsCompute) o; + return Objects.equals(this.aggregation, productAnalyticsCompute.aggregation) + && Objects.equals(this.interval, productAnalyticsCompute.interval) + && Objects.equals(this.metric, productAnalyticsCompute.metric) + && Objects.equals(this.additionalProperties, productAnalyticsCompute.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(aggregation, interval, metric, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsCompute {\n"); + sb.append(" aggregation: ").append(toIndentedString(aggregation)).append("\n"); + sb.append(" interval: ").append(toIndentedString(interval)).append("\n"); + sb.append(" metric: ").append(toIndentedString(metric)).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/ProductAnalyticsEventQuery.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsEventQuery.java new file mode 100644 index 00000000000..7926b0fe5eb --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsEventQuery.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.HashMap; +import java.util.Map; +import java.util.Objects; + +/** A standard Product Analytics event query. */ +@JsonPropertyOrder({ + ProductAnalyticsEventQuery.JSON_PROPERTY_DATA_SOURCE, + ProductAnalyticsEventQuery.JSON_PROPERTY_SEARCH +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsEventQuery { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA_SOURCE = "data_source"; + private ProductAnalyticsEventQueryDataSource dataSource; + + public static final String JSON_PROPERTY_SEARCH = "search"; + private ProductAnalyticsEventSearch search; + + public ProductAnalyticsEventQuery() {} + + @JsonCreator + public ProductAnalyticsEventQuery( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA_SOURCE) + ProductAnalyticsEventQueryDataSource dataSource, + @JsonProperty(required = true, value = JSON_PROPERTY_SEARCH) + ProductAnalyticsEventSearch search) { + this.dataSource = dataSource; + this.unparsed |= !dataSource.isValid(); + this.search = search; + this.unparsed |= search.unparsed; + } + + public ProductAnalyticsEventQuery dataSource(ProductAnalyticsEventQueryDataSource dataSource) { + this.dataSource = dataSource; + this.unparsed |= !dataSource.isValid(); + return this; + } + + /** + * The data source identifier. + * + * @return dataSource + */ + @JsonProperty(JSON_PROPERTY_DATA_SOURCE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsEventQueryDataSource getDataSource() { + return dataSource; + } + + public void setDataSource(ProductAnalyticsEventQueryDataSource dataSource) { + if (!dataSource.isValid()) { + this.unparsed = true; + } + this.dataSource = dataSource; + } + + public ProductAnalyticsEventQuery search(ProductAnalyticsEventSearch search) { + this.search = search; + this.unparsed |= search.unparsed; + return this; + } + + /** + * Search parameters for an event query. + * + * @return search + */ + @JsonProperty(JSON_PROPERTY_SEARCH) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsEventSearch getSearch() { + return search; + } + + public void setSearch(ProductAnalyticsEventSearch search) { + this.search = search; + } + + /** + * 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 ProductAnalyticsEventQuery + */ + @JsonAnySetter + public ProductAnalyticsEventQuery 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 ProductAnalyticsEventQuery object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsEventQuery productAnalyticsEventQuery = (ProductAnalyticsEventQuery) o; + return Objects.equals(this.dataSource, productAnalyticsEventQuery.dataSource) + && Objects.equals(this.search, productAnalyticsEventQuery.search) + && Objects.equals( + this.additionalProperties, productAnalyticsEventQuery.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(dataSource, search, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsEventQuery {\n"); + sb.append(" dataSource: ").append(toIndentedString(dataSource)).append("\n"); + sb.append(" search: ").append(toIndentedString(search)).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/ProductAnalyticsEventQueryDataSource.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsEventQueryDataSource.java new file mode 100644 index 00000000000..65c8b3e7497 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsEventQueryDataSource.java @@ -0,0 +1,60 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The data source identifier. */ +@JsonSerialize( + using = + ProductAnalyticsEventQueryDataSource.ProductAnalyticsEventQueryDataSourceSerializer.class) +public class ProductAnalyticsEventQueryDataSource extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("product_analytics")); + + public static final ProductAnalyticsEventQueryDataSource PRODUCT_ANALYTICS = + new ProductAnalyticsEventQueryDataSource("product_analytics"); + + ProductAnalyticsEventQueryDataSource(String value) { + super(value, allowedValues); + } + + public static class ProductAnalyticsEventQueryDataSourceSerializer + extends StdSerializer { + public ProductAnalyticsEventQueryDataSourceSerializer( + Class t) { + super(t); + } + + public ProductAnalyticsEventQueryDataSourceSerializer() { + this(null); + } + + @Override + public void serialize( + ProductAnalyticsEventQueryDataSource value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ProductAnalyticsEventQueryDataSource fromValue(String value) { + return new ProductAnalyticsEventQueryDataSource(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsEventSearch.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsEventSearch.java new file mode 100644 index 00000000000..a7899ad4bf2 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsEventSearch.java @@ -0,0 +1,136 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Search parameters for an event query. */ +@JsonPropertyOrder({ProductAnalyticsEventSearch.JSON_PROPERTY_QUERY}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsEventSearch { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_QUERY = "query"; + private String query; + + public ProductAnalyticsEventSearch query(String query) { + this.query = query; + return this; + } + + /** + * The search query using Datadog search syntax. + * + * @return query + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_QUERY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getQuery() { + return query; + } + + public void setQuery(String query) { + this.query = query; + } + + /** + * 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 ProductAnalyticsEventSearch + */ + @JsonAnySetter + public ProductAnalyticsEventSearch 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 ProductAnalyticsEventSearch object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsEventSearch productAnalyticsEventSearch = (ProductAnalyticsEventSearch) o; + return Objects.equals(this.query, productAnalyticsEventSearch.query) + && Objects.equals( + this.additionalProperties, productAnalyticsEventSearch.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(query, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsEventSearch {\n"); + sb.append(" query: ").append(toIndentedString(query)).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/ProductAnalyticsExecutionType.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsExecutionType.java new file mode 100644 index 00000000000..40addc28a01 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsExecutionType.java @@ -0,0 +1,64 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Override the query execution strategy. */ +@JsonSerialize(using = ProductAnalyticsExecutionType.ProductAnalyticsExecutionTypeSerializer.class) +public class ProductAnalyticsExecutionType extends ModelEnum { + + private static final Set allowedValues = + new HashSet( + Arrays.asList("simple", "background", "trino-multistep", "materialized-view")); + + public static final ProductAnalyticsExecutionType SIMPLE = + new ProductAnalyticsExecutionType("simple"); + public static final ProductAnalyticsExecutionType BACKGROUND = + new ProductAnalyticsExecutionType("background"); + public static final ProductAnalyticsExecutionType TRINO_MULTISTEP = + new ProductAnalyticsExecutionType("trino-multistep"); + public static final ProductAnalyticsExecutionType MATERIALIZED_VIEW = + new ProductAnalyticsExecutionType("materialized-view"); + + ProductAnalyticsExecutionType(String value) { + super(value, allowedValues); + } + + public static class ProductAnalyticsExecutionTypeSerializer + extends StdSerializer { + public ProductAnalyticsExecutionTypeSerializer(Class t) { + super(t); + } + + public ProductAnalyticsExecutionTypeSerializer() { + this(null); + } + + @Override + public void serialize( + ProductAnalyticsExecutionType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ProductAnalyticsExecutionType fromValue(String value) { + return new ProductAnalyticsExecutionType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsGroupBy.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsGroupBy.java new file mode 100644 index 00000000000..822df6b2a85 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsGroupBy.java @@ -0,0 +1,256 @@ +/* + * 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 group-by rule for segmenting results by facet values. */ +@JsonPropertyOrder({ + ProductAnalyticsGroupBy.JSON_PROPERTY_FACET, + ProductAnalyticsGroupBy.JSON_PROPERTY_LIMIT, + ProductAnalyticsGroupBy.JSON_PROPERTY_SHOULD_EXCLUDE_MISSING, + ProductAnalyticsGroupBy.JSON_PROPERTY_SORT, + ProductAnalyticsGroupBy.JSON_PROPERTY_SOURCE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsGroupBy { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_FACET = "facet"; + private String facet; + + public static final String JSON_PROPERTY_LIMIT = "limit"; + private Long limit; + + public static final String JSON_PROPERTY_SHOULD_EXCLUDE_MISSING = "should_exclude_missing"; + private Boolean shouldExcludeMissing = false; + + public static final String JSON_PROPERTY_SORT = "sort"; + private ProductAnalyticsGroupBySort sort; + + public static final String JSON_PROPERTY_SOURCE = "source"; + private String source; + + public ProductAnalyticsGroupBy() {} + + @JsonCreator + public ProductAnalyticsGroupBy( + @JsonProperty(required = true, value = JSON_PROPERTY_FACET) String facet) { + this.facet = facet; + } + + public ProductAnalyticsGroupBy facet(String facet) { + this.facet = facet; + return this; + } + + /** + * The facet to group by. + * + * @return facet + */ + @JsonProperty(JSON_PROPERTY_FACET) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getFacet() { + return facet; + } + + public void setFacet(String facet) { + this.facet = facet; + } + + public ProductAnalyticsGroupBy limit(Long limit) { + this.limit = limit; + return this; + } + + /** + * Maximum number of groups to return. + * + * @return limit + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LIMIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getLimit() { + return limit; + } + + public void setLimit(Long limit) { + this.limit = limit; + } + + public ProductAnalyticsGroupBy shouldExcludeMissing(Boolean shouldExcludeMissing) { + this.shouldExcludeMissing = shouldExcludeMissing; + return this; + } + + /** + * Exclude results with missing facet values. + * + * @return shouldExcludeMissing + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SHOULD_EXCLUDE_MISSING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getShouldExcludeMissing() { + return shouldExcludeMissing; + } + + public void setShouldExcludeMissing(Boolean shouldExcludeMissing) { + this.shouldExcludeMissing = shouldExcludeMissing; + } + + public ProductAnalyticsGroupBy sort(ProductAnalyticsGroupBySort sort) { + this.sort = sort; + this.unparsed |= sort.unparsed; + return this; + } + + /** + * Sort configuration for group-by results. + * + * @return sort + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SORT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ProductAnalyticsGroupBySort getSort() { + return sort; + } + + public void setSort(ProductAnalyticsGroupBySort sort) { + this.sort = sort; + } + + public ProductAnalyticsGroupBy source(String source) { + this.source = source; + return this; + } + + /** + * The source for audience-filter-based group-by. + * + * @return source + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SOURCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSource() { + return source; + } + + public void setSource(String source) { + this.source = source; + } + + /** + * 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 ProductAnalyticsGroupBy + */ + @JsonAnySetter + public ProductAnalyticsGroupBy 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 ProductAnalyticsGroupBy object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsGroupBy productAnalyticsGroupBy = (ProductAnalyticsGroupBy) o; + return Objects.equals(this.facet, productAnalyticsGroupBy.facet) + && Objects.equals(this.limit, productAnalyticsGroupBy.limit) + && Objects.equals(this.shouldExcludeMissing, productAnalyticsGroupBy.shouldExcludeMissing) + && Objects.equals(this.sort, productAnalyticsGroupBy.sort) + && Objects.equals(this.source, productAnalyticsGroupBy.source) + && Objects.equals(this.additionalProperties, productAnalyticsGroupBy.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(facet, limit, shouldExcludeMissing, sort, source, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsGroupBy {\n"); + sb.append(" facet: ").append(toIndentedString(facet)).append("\n"); + sb.append(" limit: ").append(toIndentedString(limit)).append("\n"); + sb.append(" shouldExcludeMissing: ") + .append(toIndentedString(shouldExcludeMissing)) + .append("\n"); + sb.append(" sort: ").append(toIndentedString(sort)).append("\n"); + sb.append(" source: ").append(toIndentedString(source)).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/ProductAnalyticsGroupBySort.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsGroupBySort.java new file mode 100644 index 00000000000..9e055be05be --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsGroupBySort.java @@ -0,0 +1,196 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Sort configuration for group-by results. */ +@JsonPropertyOrder({ + ProductAnalyticsGroupBySort.JSON_PROPERTY_AGGREGATION, + ProductAnalyticsGroupBySort.JSON_PROPERTY_METRIC, + ProductAnalyticsGroupBySort.JSON_PROPERTY_ORDER +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsGroupBySort { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_AGGREGATION = "aggregation"; + private String aggregation; + + public static final String JSON_PROPERTY_METRIC = "metric"; + private String metric; + + public static final String JSON_PROPERTY_ORDER = "order"; + private QuerySortOrder order = QuerySortOrder.DESC; + + public ProductAnalyticsGroupBySort aggregation(String aggregation) { + this.aggregation = aggregation; + return this; + } + + /** + * The aggregation function to sort by. + * + * @return aggregation + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AGGREGATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAggregation() { + return aggregation; + } + + public void setAggregation(String aggregation) { + this.aggregation = aggregation; + } + + public ProductAnalyticsGroupBySort metric(String metric) { + this.metric = metric; + return this; + } + + /** + * The metric to sort by. + * + * @return metric + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_METRIC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMetric() { + return metric; + } + + public void setMetric(String metric) { + this.metric = metric; + } + + public ProductAnalyticsGroupBySort order(QuerySortOrder order) { + this.order = order; + this.unparsed |= !order.isValid(); + return this; + } + + /** + * Direction of sort. + * + * @return order + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public QuerySortOrder getOrder() { + return order; + } + + public void setOrder(QuerySortOrder order) { + if (!order.isValid()) { + this.unparsed = true; + } + this.order = order; + } + + /** + * 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 ProductAnalyticsGroupBySort + */ + @JsonAnySetter + public ProductAnalyticsGroupBySort 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 ProductAnalyticsGroupBySort object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsGroupBySort productAnalyticsGroupBySort = (ProductAnalyticsGroupBySort) o; + return Objects.equals(this.aggregation, productAnalyticsGroupBySort.aggregation) + && Objects.equals(this.metric, productAnalyticsGroupBySort.metric) + && Objects.equals(this.order, productAnalyticsGroupBySort.order) + && Objects.equals( + this.additionalProperties, productAnalyticsGroupBySort.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(aggregation, metric, order, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsGroupBySort {\n"); + sb.append(" aggregation: ").append(toIndentedString(aggregation)).append("\n"); + sb.append(" metric: ").append(toIndentedString(metric)).append("\n"); + sb.append(" order: ").append(toIndentedString(order)).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/ProductAnalyticsInterval.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsInterval.java new file mode 100644 index 00000000000..0b801080360 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsInterval.java @@ -0,0 +1,228 @@ +/* + * 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; + +/** An interval definition in a timeseries response. */ +@JsonPropertyOrder({ + ProductAnalyticsInterval.JSON_PROPERTY_MILLISECONDS, + ProductAnalyticsInterval.JSON_PROPERTY_START_TIME, + ProductAnalyticsInterval.JSON_PROPERTY_TIMES, + ProductAnalyticsInterval.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsInterval { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_MILLISECONDS = "milliseconds"; + private Long milliseconds; + + public static final String JSON_PROPERTY_START_TIME = "start_time"; + private Long startTime; + + public static final String JSON_PROPERTY_TIMES = "times"; + private List times = null; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + public ProductAnalyticsInterval milliseconds(Long milliseconds) { + this.milliseconds = milliseconds; + return this; + } + + /** + * Getmilliseconds + * + * @return milliseconds + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MILLISECONDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getMilliseconds() { + return milliseconds; + } + + public void setMilliseconds(Long milliseconds) { + this.milliseconds = milliseconds; + } + + public ProductAnalyticsInterval startTime(Long startTime) { + this.startTime = startTime; + return this; + } + + /** + * GetstartTime + * + * @return startTime + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_START_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getStartTime() { + return startTime; + } + + public void setStartTime(Long startTime) { + this.startTime = startTime; + } + + public ProductAnalyticsInterval times(List times) { + this.times = times; + return this; + } + + public ProductAnalyticsInterval addTimesItem(Long timesItem) { + if (this.times == null) { + this.times = new ArrayList<>(); + } + this.times.add(timesItem); + return this; + } + + /** + * Gettimes + * + * @return times + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TIMES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTimes() { + return times; + } + + public void setTimes(List times) { + this.times = times; + } + + public ProductAnalyticsInterval type(String type) { + this.type = type; + return this; + } + + /** + * Gettype + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + 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 ProductAnalyticsInterval + */ + @JsonAnySetter + public ProductAnalyticsInterval 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 ProductAnalyticsInterval object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsInterval productAnalyticsInterval = (ProductAnalyticsInterval) o; + return Objects.equals(this.milliseconds, productAnalyticsInterval.milliseconds) + && Objects.equals(this.startTime, productAnalyticsInterval.startTime) + && Objects.equals(this.times, productAnalyticsInterval.times) + && Objects.equals(this.type, productAnalyticsInterval.type) + && Objects.equals(this.additionalProperties, productAnalyticsInterval.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(milliseconds, startTime, times, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsInterval {\n"); + sb.append(" milliseconds: ").append(toIndentedString(milliseconds)).append("\n"); + sb.append(" startTime: ").append(toIndentedString(startTime)).append("\n"); + sb.append(" times: ").append(toIndentedString(times)).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/ProductAnalyticsOccurrenceFilter.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsOccurrenceFilter.java new file mode 100644 index 00000000000..fa74b330c06 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsOccurrenceFilter.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.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Filter for occurrence-based queries. */ +@JsonPropertyOrder({ + ProductAnalyticsOccurrenceFilter.JSON_PROPERTY_META, + ProductAnalyticsOccurrenceFilter.JSON_PROPERTY_OPERATOR, + ProductAnalyticsOccurrenceFilter.JSON_PROPERTY_VALUE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsOccurrenceFilter { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_META = "meta"; + private Map meta = null; + + public static final String JSON_PROPERTY_OPERATOR = "operator"; + private String operator; + + public static final String JSON_PROPERTY_VALUE = "value"; + private String value; + + public ProductAnalyticsOccurrenceFilter() {} + + @JsonCreator + public ProductAnalyticsOccurrenceFilter( + @JsonProperty(required = true, value = JSON_PROPERTY_OPERATOR) String operator, + @JsonProperty(required = true, value = JSON_PROPERTY_VALUE) String value) { + this.operator = operator; + this.value = value; + } + + public ProductAnalyticsOccurrenceFilter meta(Map meta) { + this.meta = meta; + return this; + } + + public ProductAnalyticsOccurrenceFilter putMetaItem(String key, String metaItem) { + if (this.meta == null) { + this.meta = new HashMap<>(); + } + this.meta.put(key, metaItem); + return this; + } + + /** + * Additional metadata. + * + * @return meta + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_META) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMeta() { + return meta; + } + + public void setMeta(Map meta) { + this.meta = meta; + } + + public ProductAnalyticsOccurrenceFilter operator(String operator) { + this.operator = operator; + return this; + } + + /** + * Comparison operator (=, >=, <=, >, <). + * + * @return operator + */ + @JsonProperty(JSON_PROPERTY_OPERATOR) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getOperator() { + return operator; + } + + public void setOperator(String operator) { + this.operator = operator; + } + + public ProductAnalyticsOccurrenceFilter value(String value) { + this.value = value; + return this; + } + + /** + * The occurrence count threshold as a string. + * + * @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 ProductAnalyticsOccurrenceFilter + */ + @JsonAnySetter + public ProductAnalyticsOccurrenceFilter 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 ProductAnalyticsOccurrenceFilter object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsOccurrenceFilter productAnalyticsOccurrenceFilter = + (ProductAnalyticsOccurrenceFilter) o; + return Objects.equals(this.meta, productAnalyticsOccurrenceFilter.meta) + && Objects.equals(this.operator, productAnalyticsOccurrenceFilter.operator) + && Objects.equals(this.value, productAnalyticsOccurrenceFilter.value) + && Objects.equals( + this.additionalProperties, productAnalyticsOccurrenceFilter.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(meta, operator, value, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsOccurrenceFilter {\n"); + sb.append(" meta: ").append(toIndentedString(meta)).append("\n"); + sb.append(" operator: ").append(toIndentedString(operator)).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/ProductAnalyticsOccurrenceQuery.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsOccurrenceQuery.java new file mode 100644 index 00000000000..cf02a6b7d88 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsOccurrenceQuery.java @@ -0,0 +1,185 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** A Product Analytics occurrence-filtered query. */ +@JsonPropertyOrder({ + ProductAnalyticsOccurrenceQuery.JSON_PROPERTY_DATA_SOURCE, + ProductAnalyticsOccurrenceQuery.JSON_PROPERTY_SEARCH +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsOccurrenceQuery { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA_SOURCE = "data_source"; + private ProductAnalyticsOccurrenceQueryDataSource dataSource; + + public static final String JSON_PROPERTY_SEARCH = "search"; + private ProductAnalyticsOccurrenceSearch search; + + public ProductAnalyticsOccurrenceQuery() {} + + @JsonCreator + public ProductAnalyticsOccurrenceQuery( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA_SOURCE) + ProductAnalyticsOccurrenceQueryDataSource dataSource, + @JsonProperty(required = true, value = JSON_PROPERTY_SEARCH) + ProductAnalyticsOccurrenceSearch search) { + this.dataSource = dataSource; + this.unparsed |= !dataSource.isValid(); + this.search = search; + this.unparsed |= search.unparsed; + } + + public ProductAnalyticsOccurrenceQuery dataSource( + ProductAnalyticsOccurrenceQueryDataSource dataSource) { + this.dataSource = dataSource; + this.unparsed |= !dataSource.isValid(); + return this; + } + + /** + * The data source identifier for occurrence queries. + * + * @return dataSource + */ + @JsonProperty(JSON_PROPERTY_DATA_SOURCE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsOccurrenceQueryDataSource getDataSource() { + return dataSource; + } + + public void setDataSource(ProductAnalyticsOccurrenceQueryDataSource dataSource) { + if (!dataSource.isValid()) { + this.unparsed = true; + } + this.dataSource = dataSource; + } + + public ProductAnalyticsOccurrenceQuery search(ProductAnalyticsOccurrenceSearch search) { + this.search = search; + this.unparsed |= search.unparsed; + return this; + } + + /** + * Search parameters for an occurrence query. + * + * @return search + */ + @JsonProperty(JSON_PROPERTY_SEARCH) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsOccurrenceSearch getSearch() { + return search; + } + + public void setSearch(ProductAnalyticsOccurrenceSearch search) { + this.search = search; + } + + /** + * 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 ProductAnalyticsOccurrenceQuery + */ + @JsonAnySetter + public ProductAnalyticsOccurrenceQuery 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 ProductAnalyticsOccurrenceQuery object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsOccurrenceQuery productAnalyticsOccurrenceQuery = + (ProductAnalyticsOccurrenceQuery) o; + return Objects.equals(this.dataSource, productAnalyticsOccurrenceQuery.dataSource) + && Objects.equals(this.search, productAnalyticsOccurrenceQuery.search) + && Objects.equals( + this.additionalProperties, productAnalyticsOccurrenceQuery.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(dataSource, search, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsOccurrenceQuery {\n"); + sb.append(" dataSource: ").append(toIndentedString(dataSource)).append("\n"); + sb.append(" search: ").append(toIndentedString(search)).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/ProductAnalyticsOccurrenceQueryDataSource.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsOccurrenceQueryDataSource.java new file mode 100644 index 00000000000..6dec906c803 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsOccurrenceQueryDataSource.java @@ -0,0 +1,63 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The data source identifier for occurrence queries. */ +@JsonSerialize( + using = + ProductAnalyticsOccurrenceQueryDataSource + .ProductAnalyticsOccurrenceQueryDataSourceSerializer.class) +public class ProductAnalyticsOccurrenceQueryDataSource extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("product_analytics_occurrence")); + + public static final ProductAnalyticsOccurrenceQueryDataSource PRODUCT_ANALYTICS_OCCURRENCE = + new ProductAnalyticsOccurrenceQueryDataSource("product_analytics_occurrence"); + + ProductAnalyticsOccurrenceQueryDataSource(String value) { + super(value, allowedValues); + } + + public static class ProductAnalyticsOccurrenceQueryDataSourceSerializer + extends StdSerializer { + public ProductAnalyticsOccurrenceQueryDataSourceSerializer( + Class t) { + super(t); + } + + public ProductAnalyticsOccurrenceQueryDataSourceSerializer() { + this(null); + } + + @Override + public void serialize( + ProductAnalyticsOccurrenceQueryDataSource value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ProductAnalyticsOccurrenceQueryDataSource fromValue(String value) { + return new ProductAnalyticsOccurrenceQueryDataSource(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsOccurrenceSearch.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsOccurrenceSearch.java new file mode 100644 index 00000000000..241c9f791c6 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsOccurrenceSearch.java @@ -0,0 +1,168 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Search parameters for an occurrence query. */ +@JsonPropertyOrder({ + ProductAnalyticsOccurrenceSearch.JSON_PROPERTY_OCCURRENCES, + ProductAnalyticsOccurrenceSearch.JSON_PROPERTY_QUERY +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsOccurrenceSearch { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_OCCURRENCES = "occurrences"; + private ProductAnalyticsOccurrenceFilter occurrences; + + public static final String JSON_PROPERTY_QUERY = "query"; + private String query; + + public ProductAnalyticsOccurrenceSearch occurrences( + ProductAnalyticsOccurrenceFilter occurrences) { + this.occurrences = occurrences; + this.unparsed |= occurrences.unparsed; + return this; + } + + /** + * Filter for occurrence-based queries. + * + * @return occurrences + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_OCCURRENCES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ProductAnalyticsOccurrenceFilter getOccurrences() { + return occurrences; + } + + public void setOccurrences(ProductAnalyticsOccurrenceFilter occurrences) { + this.occurrences = occurrences; + } + + public ProductAnalyticsOccurrenceSearch query(String query) { + this.query = query; + return this; + } + + /** + * The search query using Datadog search syntax. + * + * @return query + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_QUERY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getQuery() { + return query; + } + + public void setQuery(String query) { + this.query = query; + } + + /** + * 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 ProductAnalyticsOccurrenceSearch + */ + @JsonAnySetter + public ProductAnalyticsOccurrenceSearch 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 ProductAnalyticsOccurrenceSearch object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsOccurrenceSearch productAnalyticsOccurrenceSearch = + (ProductAnalyticsOccurrenceSearch) o; + return Objects.equals(this.occurrences, productAnalyticsOccurrenceSearch.occurrences) + && Objects.equals(this.query, productAnalyticsOccurrenceSearch.query) + && Objects.equals( + this.additionalProperties, productAnalyticsOccurrenceSearch.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(occurrences, query, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsOccurrenceSearch {\n"); + sb.append(" occurrences: ").append(toIndentedString(occurrences)).append("\n"); + sb.append(" query: ").append(toIndentedString(query)).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/ProductAnalyticsResponseMeta.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsResponseMeta.java new file mode 100644 index 00000000000..02f787200fb --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsResponseMeta.java @@ -0,0 +1,169 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Metadata for a Product Analytics query response. */ +@JsonPropertyOrder({ + ProductAnalyticsResponseMeta.JSON_PROPERTY_REQUEST_ID, + ProductAnalyticsResponseMeta.JSON_PROPERTY_STATUS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsResponseMeta { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_REQUEST_ID = "request_id"; + private String requestId; + + public static final String JSON_PROPERTY_STATUS = "status"; + private ProductAnalyticsResponseMetaStatus status; + + public ProductAnalyticsResponseMeta requestId(String requestId) { + this.requestId = requestId; + return this; + } + + /** + * GetrequestId + * + * @return requestId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REQUEST_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getRequestId() { + return requestId; + } + + public void setRequestId(String requestId) { + this.requestId = requestId; + } + + public ProductAnalyticsResponseMeta status(ProductAnalyticsResponseMetaStatus status) { + this.status = status; + this.unparsed |= !status.isValid(); + return this; + } + + /** + * Getstatus + * + * @return status + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ProductAnalyticsResponseMetaStatus getStatus() { + return status; + } + + public void setStatus(ProductAnalyticsResponseMetaStatus status) { + if (!status.isValid()) { + this.unparsed = true; + } + this.status = status; + } + + /** + * 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 ProductAnalyticsResponseMeta + */ + @JsonAnySetter + public ProductAnalyticsResponseMeta 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 ProductAnalyticsResponseMeta object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsResponseMeta productAnalyticsResponseMeta = (ProductAnalyticsResponseMeta) o; + return Objects.equals(this.requestId, productAnalyticsResponseMeta.requestId) + && Objects.equals(this.status, productAnalyticsResponseMeta.status) + && Objects.equals( + this.additionalProperties, productAnalyticsResponseMeta.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(requestId, status, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsResponseMeta {\n"); + sb.append(" requestId: ").append(toIndentedString(requestId)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).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/ProductAnalyticsResponseMetaStatus.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsResponseMetaStatus.java new file mode 100644 index 00000000000..c87c7395c94 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsResponseMetaStatus.java @@ -0,0 +1,63 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** */ +@JsonSerialize( + using = ProductAnalyticsResponseMetaStatus.ProductAnalyticsResponseMetaStatusSerializer.class) +public class ProductAnalyticsResponseMetaStatus extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("done", "running", "timeout")); + + public static final ProductAnalyticsResponseMetaStatus DONE = + new ProductAnalyticsResponseMetaStatus("done"); + public static final ProductAnalyticsResponseMetaStatus RUNNING = + new ProductAnalyticsResponseMetaStatus("running"); + public static final ProductAnalyticsResponseMetaStatus TIMEOUT = + new ProductAnalyticsResponseMetaStatus("timeout"); + + ProductAnalyticsResponseMetaStatus(String value) { + super(value, allowedValues); + } + + public static class ProductAnalyticsResponseMetaStatusSerializer + extends StdSerializer { + public ProductAnalyticsResponseMetaStatusSerializer( + Class t) { + super(t); + } + + public ProductAnalyticsResponseMetaStatusSerializer() { + this(null); + } + + @Override + public void serialize( + ProductAnalyticsResponseMetaStatus value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ProductAnalyticsResponseMetaStatus fromValue(String value) { + return new ProductAnalyticsResponseMetaStatus(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsScalarColumn.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsScalarColumn.java new file mode 100644 index 00000000000..0c1b01e39d0 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsScalarColumn.java @@ -0,0 +1,234 @@ +/* + * 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; + +/** A column in a scalar response. */ +@JsonPropertyOrder({ + ProductAnalyticsScalarColumn.JSON_PROPERTY_META, + ProductAnalyticsScalarColumn.JSON_PROPERTY_NAME, + ProductAnalyticsScalarColumn.JSON_PROPERTY_TYPE, + ProductAnalyticsScalarColumn.JSON_PROPERTY_VALUES +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsScalarColumn { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_META = "meta"; + private ProductAnalyticsScalarColumnMeta meta; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ProductAnalyticsScalarColumnType type; + + public static final String JSON_PROPERTY_VALUES = "values"; + private List values = null; + + public ProductAnalyticsScalarColumn meta(ProductAnalyticsScalarColumnMeta meta) { + this.meta = meta; + this.unparsed |= meta.unparsed; + return this; + } + + /** + * Getmeta + * + * @return meta + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_META) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ProductAnalyticsScalarColumnMeta getMeta() { + return meta; + } + + public void setMeta(ProductAnalyticsScalarColumnMeta meta) { + this.meta = meta; + } + + public ProductAnalyticsScalarColumn name(String name) { + this.name = name; + return this; + } + + /** + * Column name (facet name for group-by, or "query"). + * + * @return name + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public ProductAnalyticsScalarColumn type(ProductAnalyticsScalarColumnType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Column type. + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ProductAnalyticsScalarColumnType getType() { + return type; + } + + public void setType(ProductAnalyticsScalarColumnType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + public ProductAnalyticsScalarColumn values(List values) { + this.values = values; + return this; + } + + public ProductAnalyticsScalarColumn addValuesItem(Object valuesItem) { + if (this.values == null) { + this.values = new ArrayList<>(); + } + this.values.add(valuesItem); + return this; + } + + /** + * Column values. + * + * @return values + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VALUES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getValues() { + return values; + } + + public void setValues(List values) { + this.values = values; + } + + /** + * 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 ProductAnalyticsScalarColumn + */ + @JsonAnySetter + public ProductAnalyticsScalarColumn 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 ProductAnalyticsScalarColumn object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsScalarColumn productAnalyticsScalarColumn = (ProductAnalyticsScalarColumn) o; + return Objects.equals(this.meta, productAnalyticsScalarColumn.meta) + && Objects.equals(this.name, productAnalyticsScalarColumn.name) + && Objects.equals(this.type, productAnalyticsScalarColumn.type) + && Objects.equals(this.values, productAnalyticsScalarColumn.values) + && Objects.equals( + this.additionalProperties, productAnalyticsScalarColumn.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(meta, name, type, values, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsScalarColumn {\n"); + sb.append(" meta: ").append(toIndentedString(meta)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" values: ").append(toIndentedString(values)).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/ProductAnalyticsScalarColumnMeta.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsScalarColumnMeta.java new file mode 100644 index 00000000000..3cdd3076fce --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsScalarColumnMeta.java @@ -0,0 +1,163 @@ +/* + * 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; +import org.openapitools.jackson.nullable.JsonNullable; + +/** */ +@JsonPropertyOrder({ProductAnalyticsScalarColumnMeta.JSON_PROPERTY_UNIT}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsScalarColumnMeta { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_UNIT = "unit"; + private JsonNullable> unit = + JsonNullable.>undefined(); + + public ProductAnalyticsScalarColumnMeta unit(List unit) { + this.unit = JsonNullable.>of(unit); + return this; + } + + public ProductAnalyticsScalarColumnMeta addUnitItem(ProductAnalyticsUnit unitItem) { + if (this.unit == null || !this.unit.isPresent()) { + this.unit = JsonNullable.>of(new ArrayList<>()); + } + try { + this.unit.get().add(unitItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + } + + /** + * Getunit + * + * @return unit + */ + @jakarta.annotation.Nullable + @JsonIgnore + public List getUnit() { + return unit.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_UNIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable> getUnit_JsonNullable() { + return unit; + } + + @JsonProperty(JSON_PROPERTY_UNIT) + public void setUnit_JsonNullable(JsonNullable> unit) { + this.unit = unit; + } + + public void setUnit(List unit) { + this.unit = JsonNullable.>of(unit); + } + + /** + * 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 ProductAnalyticsScalarColumnMeta + */ + @JsonAnySetter + public ProductAnalyticsScalarColumnMeta 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 ProductAnalyticsScalarColumnMeta object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsScalarColumnMeta productAnalyticsScalarColumnMeta = + (ProductAnalyticsScalarColumnMeta) o; + return Objects.equals(this.unit, productAnalyticsScalarColumnMeta.unit) + && Objects.equals( + this.additionalProperties, productAnalyticsScalarColumnMeta.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(unit, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsScalarColumnMeta {\n"); + sb.append(" unit: ").append(toIndentedString(unit)).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/ProductAnalyticsScalarColumnType.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsScalarColumnType.java new file mode 100644 index 00000000000..53a023d6eb0 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsScalarColumnType.java @@ -0,0 +1,60 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Column type. */ +@JsonSerialize( + using = ProductAnalyticsScalarColumnType.ProductAnalyticsScalarColumnTypeSerializer.class) +public class ProductAnalyticsScalarColumnType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("number", "group")); + + public static final ProductAnalyticsScalarColumnType NUMBER = + new ProductAnalyticsScalarColumnType("number"); + public static final ProductAnalyticsScalarColumnType GROUP = + new ProductAnalyticsScalarColumnType("group"); + + ProductAnalyticsScalarColumnType(String value) { + super(value, allowedValues); + } + + public static class ProductAnalyticsScalarColumnTypeSerializer + extends StdSerializer { + public ProductAnalyticsScalarColumnTypeSerializer(Class t) { + super(t); + } + + public ProductAnalyticsScalarColumnTypeSerializer() { + this(null); + } + + @Override + public void serialize( + ProductAnalyticsScalarColumnType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ProductAnalyticsScalarColumnType fromValue(String value) { + return new ProductAnalyticsScalarColumnType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsScalarResponse.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsScalarResponse.java new file mode 100644 index 00000000000..eccc47ff339 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsScalarResponse.java @@ -0,0 +1,168 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Response for a scalar analytics query. */ +@JsonPropertyOrder({ + ProductAnalyticsScalarResponse.JSON_PROPERTY_DATA, + ProductAnalyticsScalarResponse.JSON_PROPERTY_META +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsScalarResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private ProductAnalyticsScalarResponseData data; + + public static final String JSON_PROPERTY_META = "meta"; + private ProductAnalyticsResponseMeta meta; + + public ProductAnalyticsScalarResponse data(ProductAnalyticsScalarResponseData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data object for a scalar response. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ProductAnalyticsScalarResponseData getData() { + return data; + } + + public void setData(ProductAnalyticsScalarResponseData data) { + this.data = data; + } + + public ProductAnalyticsScalarResponse meta(ProductAnalyticsResponseMeta meta) { + this.meta = meta; + this.unparsed |= meta.unparsed; + return this; + } + + /** + * Metadata for a Product Analytics query response. + * + * @return meta + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_META) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ProductAnalyticsResponseMeta getMeta() { + return meta; + } + + public void setMeta(ProductAnalyticsResponseMeta 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 ProductAnalyticsScalarResponse + */ + @JsonAnySetter + public ProductAnalyticsScalarResponse 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 ProductAnalyticsScalarResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsScalarResponse productAnalyticsScalarResponse = + (ProductAnalyticsScalarResponse) o; + return Objects.equals(this.data, productAnalyticsScalarResponse.data) + && Objects.equals(this.meta, productAnalyticsScalarResponse.meta) + && Objects.equals( + this.additionalProperties, productAnalyticsScalarResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, meta, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsScalarResponse {\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/ProductAnalyticsScalarResponseAttributes.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsScalarResponseAttributes.java new file mode 100644 index 00000000000..257a8d3d212 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsScalarResponseAttributes.java @@ -0,0 +1,154 @@ +/* + * 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; + +/** */ +@JsonPropertyOrder({ProductAnalyticsScalarResponseAttributes.JSON_PROPERTY_COLUMNS}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsScalarResponseAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_COLUMNS = "columns"; + private List columns = null; + + public ProductAnalyticsScalarResponseAttributes columns( + List columns) { + this.columns = columns; + for (ProductAnalyticsScalarColumn item : columns) { + this.unparsed |= item.unparsed; + } + return this; + } + + public ProductAnalyticsScalarResponseAttributes addColumnsItem( + ProductAnalyticsScalarColumn columnsItem) { + if (this.columns == null) { + this.columns = new ArrayList<>(); + } + this.columns.add(columnsItem); + this.unparsed |= columnsItem.unparsed; + return this; + } + + /** + * Getcolumns + * + * @return columns + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COLUMNS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getColumns() { + return columns; + } + + public void setColumns(List columns) { + this.columns = columns; + } + + /** + * 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 ProductAnalyticsScalarResponseAttributes + */ + @JsonAnySetter + public ProductAnalyticsScalarResponseAttributes 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 ProductAnalyticsScalarResponseAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsScalarResponseAttributes productAnalyticsScalarResponseAttributes = + (ProductAnalyticsScalarResponseAttributes) o; + return Objects.equals(this.columns, productAnalyticsScalarResponseAttributes.columns) + && Objects.equals( + this.additionalProperties, + productAnalyticsScalarResponseAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(columns, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsScalarResponseAttributes {\n"); + sb.append(" columns: ").append(toIndentedString(columns)).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/ProductAnalyticsScalarResponseData.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsScalarResponseData.java new file mode 100644 index 00000000000..b2538996d5d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsScalarResponseData.java @@ -0,0 +1,199 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data object for a scalar response. */ +@JsonPropertyOrder({ + ProductAnalyticsScalarResponseData.JSON_PROPERTY_ATTRIBUTES, + ProductAnalyticsScalarResponseData.JSON_PROPERTY_ID, + ProductAnalyticsScalarResponseData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsScalarResponseData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private ProductAnalyticsScalarResponseAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ProductAnalyticsScalarResponseType type; + + public ProductAnalyticsScalarResponseData attributes( + ProductAnalyticsScalarResponseAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Getattributes + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ProductAnalyticsScalarResponseAttributes getAttributes() { + return attributes; + } + + public void setAttributes(ProductAnalyticsScalarResponseAttributes attributes) { + this.attributes = attributes; + } + + public ProductAnalyticsScalarResponseData id(String id) { + this.id = id; + return this; + } + + /** + * Getid + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public ProductAnalyticsScalarResponseData type(ProductAnalyticsScalarResponseType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Gettype + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ProductAnalyticsScalarResponseType getType() { + return type; + } + + public void setType(ProductAnalyticsScalarResponseType 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 ProductAnalyticsScalarResponseData + */ + @JsonAnySetter + public ProductAnalyticsScalarResponseData 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 ProductAnalyticsScalarResponseData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsScalarResponseData productAnalyticsScalarResponseData = + (ProductAnalyticsScalarResponseData) o; + return Objects.equals(this.attributes, productAnalyticsScalarResponseData.attributes) + && Objects.equals(this.id, productAnalyticsScalarResponseData.id) + && Objects.equals(this.type, productAnalyticsScalarResponseData.type) + && Objects.equals( + this.additionalProperties, productAnalyticsScalarResponseData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsScalarResponseData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsScalarResponseType.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsScalarResponseType.java new file mode 100644 index 00000000000..c9097d39402 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsScalarResponseType.java @@ -0,0 +1,59 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** */ +@JsonSerialize( + using = ProductAnalyticsScalarResponseType.ProductAnalyticsScalarResponseTypeSerializer.class) +public class ProductAnalyticsScalarResponseType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("scalar_response")); + + public static final ProductAnalyticsScalarResponseType SCALAR_RESPONSE = + new ProductAnalyticsScalarResponseType("scalar_response"); + + ProductAnalyticsScalarResponseType(String value) { + super(value, allowedValues); + } + + public static class ProductAnalyticsScalarResponseTypeSerializer + extends StdSerializer { + public ProductAnalyticsScalarResponseTypeSerializer( + Class t) { + super(t); + } + + public ProductAnalyticsScalarResponseTypeSerializer() { + this(null); + } + + @Override + public void serialize( + ProductAnalyticsScalarResponseType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ProductAnalyticsScalarResponseType fromValue(String value) { + return new ProductAnalyticsScalarResponseType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsSerie.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsSerie.java new file mode 100644 index 00000000000..52a0e2a59e3 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsSerie.java @@ -0,0 +1,213 @@ +/* + * 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; + +/** A series in a timeseries response. */ +@JsonPropertyOrder({ + ProductAnalyticsSerie.JSON_PROPERTY_GROUP_TAGS, + ProductAnalyticsSerie.JSON_PROPERTY_QUERY_INDEX, + ProductAnalyticsSerie.JSON_PROPERTY_UNIT +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsSerie { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_GROUP_TAGS = "group_tags"; + private List groupTags = null; + + public static final String JSON_PROPERTY_QUERY_INDEX = "query_index"; + private Long queryIndex; + + public static final String JSON_PROPERTY_UNIT = "unit"; + private List unit = null; + + public ProductAnalyticsSerie groupTags(List groupTags) { + this.groupTags = groupTags; + return this; + } + + public ProductAnalyticsSerie addGroupTagsItem(String groupTagsItem) { + if (this.groupTags == null) { + this.groupTags = new ArrayList<>(); + } + this.groupTags.add(groupTagsItem); + return this; + } + + /** + * GetgroupTags + * + * @return groupTags + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_GROUP_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getGroupTags() { + return groupTags; + } + + public void setGroupTags(List groupTags) { + this.groupTags = groupTags; + } + + public ProductAnalyticsSerie queryIndex(Long queryIndex) { + this.queryIndex = queryIndex; + return this; + } + + /** + * GetqueryIndex + * + * @return queryIndex + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_QUERY_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getQueryIndex() { + return queryIndex; + } + + public void setQueryIndex(Long queryIndex) { + this.queryIndex = queryIndex; + } + + public ProductAnalyticsSerie unit(List unit) { + this.unit = unit; + for (ProductAnalyticsUnit item : unit) { + this.unparsed |= item.unparsed; + } + return this; + } + + public ProductAnalyticsSerie addUnitItem(ProductAnalyticsUnit unitItem) { + if (this.unit == null) { + this.unit = new ArrayList<>(); + } + this.unit.add(unitItem); + this.unparsed |= unitItem.unparsed; + return this; + } + + /** + * Getunit + * + * @return unit + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UNIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getUnit() { + return unit; + } + + public void setUnit(List unit) { + this.unit = unit; + } + + /** + * 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 ProductAnalyticsSerie + */ + @JsonAnySetter + public ProductAnalyticsSerie 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 ProductAnalyticsSerie object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsSerie productAnalyticsSerie = (ProductAnalyticsSerie) o; + return Objects.equals(this.groupTags, productAnalyticsSerie.groupTags) + && Objects.equals(this.queryIndex, productAnalyticsSerie.queryIndex) + && Objects.equals(this.unit, productAnalyticsSerie.unit) + && Objects.equals(this.additionalProperties, productAnalyticsSerie.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(groupTags, queryIndex, unit, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsSerie {\n"); + sb.append(" groupTags: ").append(toIndentedString(groupTags)).append("\n"); + sb.append(" queryIndex: ").append(toIndentedString(queryIndex)).append("\n"); + sb.append(" unit: ").append(toIndentedString(unit)).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/ProductAnalyticsTimeseriesResponse.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsTimeseriesResponse.java new file mode 100644 index 00000000000..7d05d96dbda --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsTimeseriesResponse.java @@ -0,0 +1,168 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Response for a timeseries analytics query. */ +@JsonPropertyOrder({ + ProductAnalyticsTimeseriesResponse.JSON_PROPERTY_DATA, + ProductAnalyticsTimeseriesResponse.JSON_PROPERTY_META +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsTimeseriesResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private ProductAnalyticsTimeseriesResponseData data; + + public static final String JSON_PROPERTY_META = "meta"; + private ProductAnalyticsResponseMeta meta; + + public ProductAnalyticsTimeseriesResponse data(ProductAnalyticsTimeseriesResponseData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Getdata + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ProductAnalyticsTimeseriesResponseData getData() { + return data; + } + + public void setData(ProductAnalyticsTimeseriesResponseData data) { + this.data = data; + } + + public ProductAnalyticsTimeseriesResponse meta(ProductAnalyticsResponseMeta meta) { + this.meta = meta; + this.unparsed |= meta.unparsed; + return this; + } + + /** + * Metadata for a Product Analytics query response. + * + * @return meta + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_META) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ProductAnalyticsResponseMeta getMeta() { + return meta; + } + + public void setMeta(ProductAnalyticsResponseMeta 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 ProductAnalyticsTimeseriesResponse + */ + @JsonAnySetter + public ProductAnalyticsTimeseriesResponse 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 ProductAnalyticsTimeseriesResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsTimeseriesResponse productAnalyticsTimeseriesResponse = + (ProductAnalyticsTimeseriesResponse) o; + return Objects.equals(this.data, productAnalyticsTimeseriesResponse.data) + && Objects.equals(this.meta, productAnalyticsTimeseriesResponse.meta) + && Objects.equals( + this.additionalProperties, productAnalyticsTimeseriesResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, meta, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsTimeseriesResponse {\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/ProductAnalyticsTimeseriesResponseAttributes.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsTimeseriesResponseAttributes.java new file mode 100644 index 00000000000..919b74e10f3 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsTimeseriesResponseAttributes.java @@ -0,0 +1,267 @@ +/* + * 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; + +/** */ +@JsonPropertyOrder({ + ProductAnalyticsTimeseriesResponseAttributes.JSON_PROPERTY_INTERVALS, + ProductAnalyticsTimeseriesResponseAttributes.JSON_PROPERTY_SERIES, + ProductAnalyticsTimeseriesResponseAttributes.JSON_PROPERTY_TIMES, + ProductAnalyticsTimeseriesResponseAttributes.JSON_PROPERTY_VALUES +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsTimeseriesResponseAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_INTERVALS = "intervals"; + private List intervals = null; + + public static final String JSON_PROPERTY_SERIES = "series"; + private List series = null; + + public static final String JSON_PROPERTY_TIMES = "times"; + private List times = null; + + public static final String JSON_PROPERTY_VALUES = "values"; + private List> values = null; + + public ProductAnalyticsTimeseriesResponseAttributes intervals( + List intervals) { + this.intervals = intervals; + for (ProductAnalyticsInterval item : intervals) { + this.unparsed |= item.unparsed; + } + return this; + } + + public ProductAnalyticsTimeseriesResponseAttributes addIntervalsItem( + ProductAnalyticsInterval intervalsItem) { + if (this.intervals == null) { + this.intervals = new ArrayList<>(); + } + this.intervals.add(intervalsItem); + this.unparsed |= intervalsItem.unparsed; + return this; + } + + /** + * Getintervals + * + * @return intervals + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INTERVALS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getIntervals() { + return intervals; + } + + public void setIntervals(List intervals) { + this.intervals = intervals; + } + + public ProductAnalyticsTimeseriesResponseAttributes series(List series) { + this.series = series; + for (ProductAnalyticsSerie item : series) { + this.unparsed |= item.unparsed; + } + return this; + } + + public ProductAnalyticsTimeseriesResponseAttributes addSeriesItem( + ProductAnalyticsSerie seriesItem) { + if (this.series == null) { + this.series = new ArrayList<>(); + } + this.series.add(seriesItem); + this.unparsed |= seriesItem.unparsed; + return this; + } + + /** + * Getseries + * + * @return series + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SERIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getSeries() { + return series; + } + + public void setSeries(List series) { + this.series = series; + } + + public ProductAnalyticsTimeseriesResponseAttributes times(List times) { + this.times = times; + return this; + } + + public ProductAnalyticsTimeseriesResponseAttributes addTimesItem(Long timesItem) { + if (this.times == null) { + this.times = new ArrayList<>(); + } + this.times.add(timesItem); + return this; + } + + /** + * Timestamps for each data point (epoch milliseconds). + * + * @return times + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TIMES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTimes() { + return times; + } + + public void setTimes(List times) { + this.times = times; + } + + public ProductAnalyticsTimeseriesResponseAttributes values(List> values) { + this.values = values; + return this; + } + + public ProductAnalyticsTimeseriesResponseAttributes addValuesItem(List valuesItem) { + if (this.values == null) { + this.values = new ArrayList<>(); + } + this.values.add(valuesItem); + return this; + } + + /** + * Values for each series at each time point. + * + * @return values + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VALUES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List> getValues() { + return values; + } + + public void setValues(List> values) { + this.values = values; + } + + /** + * 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 ProductAnalyticsTimeseriesResponseAttributes + */ + @JsonAnySetter + public ProductAnalyticsTimeseriesResponseAttributes 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 ProductAnalyticsTimeseriesResponseAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsTimeseriesResponseAttributes productAnalyticsTimeseriesResponseAttributes = + (ProductAnalyticsTimeseriesResponseAttributes) o; + return Objects.equals(this.intervals, productAnalyticsTimeseriesResponseAttributes.intervals) + && Objects.equals(this.series, productAnalyticsTimeseriesResponseAttributes.series) + && Objects.equals(this.times, productAnalyticsTimeseriesResponseAttributes.times) + && Objects.equals(this.values, productAnalyticsTimeseriesResponseAttributes.values) + && Objects.equals( + this.additionalProperties, + productAnalyticsTimeseriesResponseAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(intervals, series, times, values, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsTimeseriesResponseAttributes {\n"); + sb.append(" intervals: ").append(toIndentedString(intervals)).append("\n"); + sb.append(" series: ").append(toIndentedString(series)).append("\n"); + sb.append(" times: ").append(toIndentedString(times)).append("\n"); + sb.append(" values: ").append(toIndentedString(values)).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/ProductAnalyticsTimeseriesResponseData.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsTimeseriesResponseData.java new file mode 100644 index 00000000000..bf28bf7278f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsTimeseriesResponseData.java @@ -0,0 +1,199 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** */ +@JsonPropertyOrder({ + ProductAnalyticsTimeseriesResponseData.JSON_PROPERTY_ATTRIBUTES, + ProductAnalyticsTimeseriesResponseData.JSON_PROPERTY_ID, + ProductAnalyticsTimeseriesResponseData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsTimeseriesResponseData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private ProductAnalyticsTimeseriesResponseAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ProductAnalyticsTimeseriesResponseType type; + + public ProductAnalyticsTimeseriesResponseData attributes( + ProductAnalyticsTimeseriesResponseAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Getattributes + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ProductAnalyticsTimeseriesResponseAttributes getAttributes() { + return attributes; + } + + public void setAttributes(ProductAnalyticsTimeseriesResponseAttributes attributes) { + this.attributes = attributes; + } + + public ProductAnalyticsTimeseriesResponseData id(String id) { + this.id = id; + return this; + } + + /** + * Getid + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public ProductAnalyticsTimeseriesResponseData type(ProductAnalyticsTimeseriesResponseType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Gettype + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ProductAnalyticsTimeseriesResponseType getType() { + return type; + } + + public void setType(ProductAnalyticsTimeseriesResponseType 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 ProductAnalyticsTimeseriesResponseData + */ + @JsonAnySetter + public ProductAnalyticsTimeseriesResponseData 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 ProductAnalyticsTimeseriesResponseData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsTimeseriesResponseData productAnalyticsTimeseriesResponseData = + (ProductAnalyticsTimeseriesResponseData) o; + return Objects.equals(this.attributes, productAnalyticsTimeseriesResponseData.attributes) + && Objects.equals(this.id, productAnalyticsTimeseriesResponseData.id) + && Objects.equals(this.type, productAnalyticsTimeseriesResponseData.type) + && Objects.equals( + this.additionalProperties, productAnalyticsTimeseriesResponseData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsTimeseriesResponseData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsTimeseriesResponseType.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsTimeseriesResponseType.java new file mode 100644 index 00000000000..21617f3fd69 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsTimeseriesResponseType.java @@ -0,0 +1,63 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** */ +@JsonSerialize( + using = + ProductAnalyticsTimeseriesResponseType.ProductAnalyticsTimeseriesResponseTypeSerializer + .class) +public class ProductAnalyticsTimeseriesResponseType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("timeseries_response")); + + public static final ProductAnalyticsTimeseriesResponseType TIMESERIES_RESPONSE = + new ProductAnalyticsTimeseriesResponseType("timeseries_response"); + + ProductAnalyticsTimeseriesResponseType(String value) { + super(value, allowedValues); + } + + public static class ProductAnalyticsTimeseriesResponseTypeSerializer + extends StdSerializer { + public ProductAnalyticsTimeseriesResponseTypeSerializer( + Class t) { + super(t); + } + + public ProductAnalyticsTimeseriesResponseTypeSerializer() { + this(null); + } + + @Override + public void serialize( + ProductAnalyticsTimeseriesResponseType value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ProductAnalyticsTimeseriesResponseType fromValue(String value) { + return new ProductAnalyticsTimeseriesResponseType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsUnit.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsUnit.java new file mode 100644 index 00000000000..5defb42c724 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsUnit.java @@ -0,0 +1,272 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** A unit definition for metric values. */ +@JsonPropertyOrder({ + ProductAnalyticsUnit.JSON_PROPERTY_FAMILY, + ProductAnalyticsUnit.JSON_PROPERTY_ID, + ProductAnalyticsUnit.JSON_PROPERTY_NAME, + ProductAnalyticsUnit.JSON_PROPERTY_PLURAL, + ProductAnalyticsUnit.JSON_PROPERTY_SCALE_FACTOR, + ProductAnalyticsUnit.JSON_PROPERTY_SHORT_NAME +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsUnit { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_FAMILY = "family"; + private String family; + + public static final String JSON_PROPERTY_ID = "id"; + private Long id; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_PLURAL = "plural"; + private String plural; + + public static final String JSON_PROPERTY_SCALE_FACTOR = "scale_factor"; + private Double scaleFactor; + + public static final String JSON_PROPERTY_SHORT_NAME = "short_name"; + private String shortName; + + public ProductAnalyticsUnit family(String family) { + this.family = family; + return this; + } + + /** + * Getfamily + * + * @return family + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FAMILY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFamily() { + return family; + } + + public void setFamily(String family) { + this.family = family; + } + + public ProductAnalyticsUnit id(Long id) { + this.id = id; + return this; + } + + /** + * Getid + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public ProductAnalyticsUnit name(String name) { + this.name = name; + return this; + } + + /** + * Getname + * + * @return name + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public ProductAnalyticsUnit plural(String plural) { + this.plural = plural; + return this; + } + + /** + * Getplural + * + * @return plural + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PLURAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPlural() { + return plural; + } + + public void setPlural(String plural) { + this.plural = plural; + } + + public ProductAnalyticsUnit scaleFactor(Double scaleFactor) { + this.scaleFactor = scaleFactor; + return this; + } + + /** + * GetscaleFactor + * + * @return scaleFactor + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SCALE_FACTOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getScaleFactor() { + return scaleFactor; + } + + public void setScaleFactor(Double scaleFactor) { + this.scaleFactor = scaleFactor; + } + + public ProductAnalyticsUnit shortName(String shortName) { + this.shortName = shortName; + return this; + } + + /** + * GetshortName + * + * @return shortName + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SHORT_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getShortName() { + return shortName; + } + + public void setShortName(String shortName) { + this.shortName = shortName; + } + + /** + * 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 ProductAnalyticsUnit + */ + @JsonAnySetter + public ProductAnalyticsUnit 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 ProductAnalyticsUnit object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsUnit productAnalyticsUnit = (ProductAnalyticsUnit) o; + return Objects.equals(this.family, productAnalyticsUnit.family) + && Objects.equals(this.id, productAnalyticsUnit.id) + && Objects.equals(this.name, productAnalyticsUnit.name) + && Objects.equals(this.plural, productAnalyticsUnit.plural) + && Objects.equals(this.scaleFactor, productAnalyticsUnit.scaleFactor) + && Objects.equals(this.shortName, productAnalyticsUnit.shortName) + && Objects.equals(this.additionalProperties, productAnalyticsUnit.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(family, id, name, plural, scaleFactor, shortName, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsUnit {\n"); + sb.append(" family: ").append(toIndentedString(family)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" plural: ").append(toIndentedString(plural)).append("\n"); + sb.append(" scaleFactor: ").append(toIndentedString(scaleFactor)).append("\n"); + sb.append(" shortName: ").append(toIndentedString(shortName)).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/product_analytics.feature b/src/test/resources/com/datadog/api/client/v2/api/product_analytics.feature index a915c213041..3b59a3a0f64 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/product_analytics.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/product_analytics.feature @@ -11,25 +11,63 @@ Feature: Product Analytics Background: Given a valid "apiKeyAuth" key in the system And an instance of "ProductAnalytics" API - And new "SubmitProductAnalyticsEvent" request - And body with value {"account": {"id": "account-67890"}, "application": {"id": "123abcde-123a-123b-1234-123456789abc"}, "event": {"name": "payment.processed"}, "session": {"id": "session-abcdef"}, "type": "server", "usr": {"id": "user-12345"}} + + @generated @skip @team:DataDog/product-analytics-backend + Scenario: Compute scalar analytics returns "Bad Request" response + Given a valid "appKeyAuth" key in the system + And new "QueryProductAnalyticsScalar" request + And body with value {"data": {"attributes": {"from": 1771232048460, "query": {"compute": {"aggregation": "count"}, "query": {"data_source": "product_analytics", "search": {"query": "@type:view"}}}, "to": 1771836848262}, "type": "formula_analytics_extended_request"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/product-analytics-backend + Scenario: Compute scalar analytics returns "OK" response + Given a valid "appKeyAuth" key in the system + And new "QueryProductAnalyticsScalar" request + And body with value {"data": {"attributes": {"from": 1771232048460, "query": {"compute": {"aggregation": "count"}, "query": {"data_source": "product_analytics", "search": {"query": "@type:view"}}}, "to": 1771836848262}, "type": "formula_analytics_extended_request"}} + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/product-analytics-backend + Scenario: Compute timeseries analytics returns "Bad Request" response + Given a valid "appKeyAuth" key in the system + And new "QueryProductAnalyticsTimeseries" request + And body with value {"data": {"attributes": {"from": 1771232048460, "query": {"compute": {"aggregation": "count"}, "query": {"data_source": "product_analytics", "search": {"query": "@type:view"}}}, "to": 1771836848262}, "type": "formula_analytics_extended_request"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/product-analytics-backend + Scenario: Compute timeseries analytics returns "OK" response + Given a valid "appKeyAuth" key in the system + And new "QueryProductAnalyticsTimeseries" request + And body with value {"data": {"attributes": {"from": 1771232048460, "query": {"compute": {"aggregation": "count"}, "query": {"data_source": "product_analytics", "search": {"query": "@type:view"}}}, "to": 1771836848262}, "type": "formula_analytics_extended_request"}} + When the request is sent + Then the response status is 200 OK @generated @skip @team:DataDog/product-analytics-backend Scenario: Send server-side events returns "Bad Request" response + Given new "SubmitProductAnalyticsEvent" request + And body with value {"account": {"id": "account-67890"}, "application": {"id": "123abcde-123a-123b-1234-123456789abc"}, "event": {"name": "payment.processed"}, "session": {"id": "session-abcdef"}, "type": "server", "usr": {"id": "user-12345"}} When the request is sent Then the response status is 400 Bad Request @generated @skip @team:DataDog/product-analytics-backend Scenario: Send server-side events returns "Payload Too Large" response + Given new "SubmitProductAnalyticsEvent" request + And body with value {"account": {"id": "account-67890"}, "application": {"id": "123abcde-123a-123b-1234-123456789abc"}, "event": {"name": "payment.processed"}, "session": {"id": "session-abcdef"}, "type": "server", "usr": {"id": "user-12345"}} When the request is sent Then the response status is 413 Payload Too Large @generated @skip @team:DataDog/product-analytics-backend Scenario: Send server-side events returns "Request Timeout" response + Given new "SubmitProductAnalyticsEvent" request + And body with value {"account": {"id": "account-67890"}, "application": {"id": "123abcde-123a-123b-1234-123456789abc"}, "event": {"name": "payment.processed"}, "session": {"id": "session-abcdef"}, "type": "server", "usr": {"id": "user-12345"}} When the request is sent Then the response status is 408 Request Timeout @generated @skip @team:DataDog/product-analytics-backend Scenario: Send server-side events returns "Request accepted for processing (always 202 empty JSON)." response + Given new "SubmitProductAnalyticsEvent" request + And body with value {"account": {"id": "account-67890"}, "application": {"id": "123abcde-123a-123b-1234-123456789abc"}, "event": {"name": "payment.processed"}, "session": {"id": "session-abcdef"}, "type": "server", "usr": {"id": "user-12345"}} When the request is sent Then the response status is 202 Request accepted for processing (always 202 empty JSON). 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 3b052977c20..09186eef673 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 @@ -3719,6 +3719,18 @@ "type": "unsafe" } }, + "QueryProductAnalyticsScalar": { + "tag": "Product Analytics", + "undo": { + "type": "safe" + } + }, + "QueryProductAnalyticsTimeseries": { + "tag": "Product Analytics", + "undo": { + "type": "safe" + } + }, "QueryEventFilteredUsers": { "tag": "Rum Audience Management", "undo": {