diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 560b3188e9f..a26a0e24d5b 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -82738,6 +82738,166 @@ components: - name - metric type: object + ProductAnalyticsAnalyticsListQuery: + description: |- + The analytics list query definition. It selects the events to return with `query`, then + chooses the columns on each event row, the sort applied to those rows, and a row limit. + Unlike the scalar and timeseries queries, a list query returns raw event rows rather than + aggregates, so it takes no compute or group-by rule. + properties: + audience_filters: + $ref: "#/components/schemas/ProductAnalyticsAudienceFilters" + columns: + description: Attribute columns to include in each event row. + items: + description: The name of an attribute to return as a column. + type: string + type: array + limit: + description: Maximum number of event rows to return. + example: 100 + format: int64 + maximum: 1000 + minimum: 1 + type: integer + query: + $ref: "#/components/schemas/ProductAnalyticsBaseQuery" + sort: + $ref: "#/components/schemas/ProductAnalyticsAnalyticsListSort" + required: + - query + type: object + ProductAnalyticsAnalyticsListRecord: + additionalProperties: + description: The value of one column of the event row. + description: A single event row, keyed by column name. + type: object + ProductAnalyticsAnalyticsListRequest: + description: Request for listing the individual event records matching an analytics query. + example: + data: + attributes: + from: 1771232048460 + query: + columns: + - "@view.name" + limit: 100 + query: + data_source: product_analytics + search: + query: "@type:view" + to: 1771836848262 + type: formula_analytics_extended_list_request + properties: + data: + $ref: "#/components/schemas/ProductAnalyticsAnalyticsListRequestData" + required: + - data + type: object + ProductAnalyticsAnalyticsListRequestAttributes: + description: Attributes for an analytics list request. + properties: + from: + description: Start time in epoch milliseconds. Must be less than `to`. + example: 1771232048460 + format: int64 + type: integer + query: + $ref: "#/components/schemas/ProductAnalyticsAnalyticsListQuery" + to: + description: End time in epoch milliseconds. + example: 1771836848262 + format: int64 + type: integer + required: + - from + - to + - query + type: object + ProductAnalyticsAnalyticsListRequestData: + description: Data object for an analytics list request. + properties: + attributes: + $ref: "#/components/schemas/ProductAnalyticsAnalyticsListRequestAttributes" + type: + $ref: "#/components/schemas/ProductAnalyticsAnalyticsListRequestType" + required: + - type + - attributes + type: object + ProductAnalyticsAnalyticsListRequestType: + description: The resource type for analytics list requests. + enum: + - formula_analytics_extended_list_request + example: formula_analytics_extended_list_request + type: string + x-enum-varnames: + - FORMULA_ANALYTICS_EXTENDED_LIST_REQUEST + ProductAnalyticsAnalyticsListResponse: + description: Response for an analytics list query, containing individual event records. + properties: + data: + $ref: "#/components/schemas/ProductAnalyticsAnalyticsListResponseData" + meta: + $ref: "#/components/schemas/ProductAnalyticsResponseMeta" + required: + - data + type: object + ProductAnalyticsAnalyticsListResponseAttributes: + description: Attributes of an analytics list response, containing the matching event rows. + properties: + records: + description: The event rows, each holding the values of the requested columns. + items: + $ref: "#/components/schemas/ProductAnalyticsAnalyticsListRecord" + type: array + total_count: + description: Total number of records matching the query, before the row limit is applied. + format: int64 + type: integer + type: object + ProductAnalyticsAnalyticsListResponseData: + description: Data object for an analytics list response. + properties: + attributes: + $ref: "#/components/schemas/ProductAnalyticsAnalyticsListResponseAttributes" + id: + description: Unique identifier for this response data object. + example: 00000000-0000-0000-0000-000000000000 + type: string + type: + $ref: "#/components/schemas/ProductAnalyticsAnalyticsListResponseType" + required: + - id + - type + - attributes + type: object + ProductAnalyticsAnalyticsListResponseType: + description: The resource type identifier for an analytics list response. + enum: + - list_response + example: list_response + type: string + x-enum-varnames: + - LIST_RESPONSE + ProductAnalyticsAnalyticsListSort: + description: The sort applied to the returned event rows. + properties: + facet: + description: Name of the facet to sort the rows by. + type: string + order: + $ref: "#/components/schemas/ProductAnalyticsAnalyticsListSortOrder" + type: object + ProductAnalyticsAnalyticsListSortOrder: + description: The direction rows are sorted in. + enum: + - asc + - desc + type: string + x-enum-varnames: + - ASC + - DESC ProductAnalyticsAnalyticsQuery: description: The analytics query definition containing a base query, compute rule, and optional grouping. properties: @@ -82751,7 +82911,10 @@ components: $ref: "#/components/schemas/ProductAnalyticsGroupBy" type: array indexes: - description: Restrict the query to specific indexes. Max 1 entry. + deprecated: true + description: |- + Deprecated. Index selection is a rollout detail and will be removed. + Do not set this field. items: description: Index name to restrict the query to. type: string @@ -82789,6 +82952,10 @@ components: properties: enforced_execution_type: $ref: "#/components/schemas/ProductAnalyticsExecutionType" + deprecated: true + description: |- + Deprecated. Selects the internal query execution infrastructure and will be removed. + Do not set this field. from: description: Start time in epoch milliseconds. Must be less than `to`. example: 1771232048460 @@ -82797,7 +82964,7 @@ components: query: $ref: "#/components/schemas/ProductAnalyticsAnalyticsQuery" request_id: - description: Optional request ID for multi-step query continuation. + description: Unique identifier of the query. type: string to: description: End time in epoch milliseconds. @@ -82873,7 +83040,7 @@ components: type: string segment_id: description: UUID of the segment to filter by. - example: "" + example: 00000000-0000-0000-0000-000000000000 format: uuid type: string required: @@ -82902,6 +83069,50 @@ components: oneOf: - $ref: "#/components/schemas/ProductAnalyticsEventQuery" - $ref: "#/components/schemas/ProductAnalyticsOccurrenceQuery" + ProductAnalyticsCalendarInterval: + description: A calendar-aligned bucket definition, such as "every 1 week starting on Monday". + properties: + alignment: + description: |- + Where each bucket starts within the calendar unit. Use an hour for `day` (for example `1am` or `14`), + a day name for `week` (for example `monday`), or an ordinal for `month` (for example `1st`). + example: monday + type: string + quantity: + description: Number of calendar units per bucket. + example: 1 + format: int64 + minimum: 1 + type: integer + timezone: + description: Timezone used to align the buckets. + example: UTC + type: string + type: + $ref: "#/components/schemas/ProductAnalyticsCalendarIntervalType" + required: + - type + type: object + ProductAnalyticsCalendarIntervalType: + description: Calendar unit used to bucket cohorts. + enum: + - minute + - hour + - day + - week + - month + - quarter + - year + example: week + type: string + x-enum-varnames: + - MINUTE + - HOUR + - DAY + - WEEK + - MONTH + - QUARTER + - YEAR ProductAnalyticsCompute: description: A compute rule for aggregating data. properties: @@ -82910,7 +83121,9 @@ components: example: count type: string interval: - description: Time bucket size in milliseconds. Required for timeseries queries. + description: |- + Time bucket size in milliseconds. Required for timeseries queries; ignored by the + scalar endpoint, which returns a single value. example: 3600000 format: int64 type: integer @@ -82921,6 +83134,29 @@ components: required: - aggregation type: object + ProductAnalyticsElapsedTime: + description: Elapsed time statistics (min/max/avg in milliseconds). + properties: + avg: + description: Average elapsed time to reach the next step, in milliseconds. + example: 5100 + format: int64 + type: integer + max: + description: Maximum elapsed time to reach the next step, in milliseconds. + example: 42000 + format: int64 + type: integer + min: + description: Minimum elapsed time to reach the next step, in milliseconds. + example: 900 + format: int64 + type: integer + required: + - min + - max + - avg + type: object ProductAnalyticsEventQuery: description: A standard Product Analytics event query. properties: @@ -82961,6 +83197,215 @@ components: - BACKGROUND - TRINO_MULTISTEP - MATERIALIZED_VIEW + ProductAnalyticsFormulaJourneyQuery: + description: Query definition for a journey timeseries request. + properties: + compute: + $ref: "#/components/schemas/ProductAnalyticsGraphQueryCompute" + group_by: + description: Segments the results by the values of one or more facets. + items: + $ref: "#/components/schemas/ProductAnalyticsGraphQueryGroupBy" + type: array + query_id: + description: Caller-defined identifier echoed back in the results. + type: string + search: + $ref: "#/components/schemas/ProductAnalyticsJourneySearch" + required: + - search + - compute + type: object + ProductAnalyticsFormulaJourneyRequest: + description: Request body for a journey timeseries query. + properties: + data: + $ref: "#/components/schemas/ProductAnalyticsFormulaJourneyRequestData" + required: + - data + type: object + ProductAnalyticsFormulaJourneyRequestAttributes: + description: Attributes of a journey timeseries request. + properties: + from: + description: Start of the query window, in epoch milliseconds. + example: 1756425600000 + format: int64 + type: integer + interval: + description: Time bucket interval in milliseconds. + format: int64 + type: integer + query: + $ref: "#/components/schemas/ProductAnalyticsFormulaJourneyQuery" + to: + description: End of the query window, in epoch milliseconds. + example: 1756857600000 + format: int64 + type: integer + required: + - from + - to + - query + type: object + ProductAnalyticsFormulaJourneyRequestData: + description: |- + The single JSON:API resource carrying a journey timeseries query. Its attributes hold the time + window, the bucket interval that splits it, and the journey metric to compute per bucket. + properties: + attributes: + $ref: "#/components/schemas/ProductAnalyticsFormulaJourneyRequestAttributes" + type: + $ref: "#/components/schemas/ProductAnalyticsFormulaJourneyRequestType" + required: + - type + - attributes + type: object + ProductAnalyticsFormulaJourneyRequestType: + description: The resource type identifier for a journey timeseries or scalar request. + enum: + - formula_journey_request + example: formula_journey_request + type: string + x-enum-varnames: + - FORMULA_JOURNEY_REQUEST + ProductAnalyticsFormulaRetentionQuery: + description: Query definition for a retention scalar or retention timeseries request. + properties: + computation_scope: + $ref: "#/components/schemas/ProductAnalyticsRetentionScope" + compute: + $ref: "#/components/schemas/ProductAnalyticsRetentionCompute" + group_by: + description: Splits the results by the values of one or more facets. + items: + $ref: "#/components/schemas/ProductAnalyticsRetentionGroupBy" + type: array + search: + $ref: "#/components/schemas/ProductAnalyticsRetentionSearch" + required: + - search + - compute + type: object + ProductAnalyticsFormulaRetentionRequest: + description: Request body for a retention scalar or retention timeseries query. + properties: + data: + $ref: "#/components/schemas/ProductAnalyticsFormulaRetentionRequestData" + required: + - data + type: object + ProductAnalyticsFormulaRetentionRequestAttributes: + description: Attributes of a retention scalar or retention timeseries request. + properties: + exclude_anonymous_traffic: + default: false + description: Whether to exclude sessions that are not tied to an identified user. + type: boolean + from: + description: Start of the query window, in epoch milliseconds. + example: 1756425600000 + format: int64 + type: integer + query: + $ref: "#/components/schemas/ProductAnalyticsFormulaRetentionQuery" + to: + description: End of the query window, in epoch milliseconds. + example: 1756857600000 + format: int64 + type: integer + required: + - from + - to + - query + type: object + ProductAnalyticsFormulaRetentionRequestData: + description: |- + The single JSON:API resource carrying a retention scalar or timeseries query. Its attributes + hold the time window to query and the retention query definition to evaluate. + properties: + attributes: + $ref: "#/components/schemas/ProductAnalyticsFormulaRetentionRequestAttributes" + type: + $ref: "#/components/schemas/ProductAnalyticsFormulaRetentionRequestType" + required: + - type + - attributes + type: object + ProductAnalyticsFormulaRetentionRequestType: + description: The resource type identifier for a retention scalar or retention timeseries request. + enum: + - formula_retention_request + example: formula_retention_request + type: string + x-enum-varnames: + - FORMULA_RETENTION_REQUEST + ProductAnalyticsGraphQueryCompute: + description: Defines the metric computed over the journey. + properties: + aggregation: + description: |- + Aggregation function: `count`, `cardinality`, `avg`, `median`, `min`, `max`, `sum`, + or a percentile of the form `pc` such as `pc95`. Defaults to `cardinality`. + example: count + pattern: "^(count|cardinality|avg|median|min|max|sum|pc[0-9]{1,2})$" + type: string + interval: + description: Time bucket interval in milliseconds, used by timeseries queries. + format: int64 + type: integer + metric: + description: |- + Metric to aggregate on. Use a facet path such as `@view.time_spent`, or one of the + journey metrics `__dd.conversion`, `__dd.conversion_rate`, `__dd.time_to_convert`, + or `__dd.dropoff_rate`. Defaults to `__dd.conversion`. + type: string + target: + $ref: "#/components/schemas/ProductAnalyticsJourneyTarget" + required: + - aggregation + type: object + ProductAnalyticsGraphQueryGroupBy: + description: Segments journey results by the values of a facet. + properties: + facet: + description: Attribute path to group by. + example: "@geo.country" + type: string + limit: + description: Maximum number of groups to return. Omit it to let the service choose. + format: int64 + minimum: 1 + type: integer + should_exclude_missing: + default: false + description: Whether to exclude entities that have no value for this facet. + type: boolean + sort: + $ref: "#/components/schemas/ProductAnalyticsGroupBySort" + source: + $ref: "#/components/schemas/ProductAnalyticsGraphQueryGroupBySource" + target: + $ref: "#/components/schemas/ProductAnalyticsJourneyTarget" + value_filters: + description: Restricts the results to these facet values. + items: + description: A facet value to keep. + type: string + type: array + required: + - facet + type: object + ProductAnalyticsGraphQueryGroupBySource: + description: Audience dimension to group by, instead of an event facet. + enum: + - product_analytics_audience_filters.users + - product_analytics_audience_filters.accounts + example: product_analytics_audience_filters.users + type: string + x-enum-varnames: + - USERS + - ACCOUNTS ProductAnalyticsGroupBy: description: A group-by rule for segmenting results by facet values. properties: @@ -83020,169 +83465,1882 @@ components: description: The interval type (e.g., fixed or auto-computed bucket size). type: string type: object - ProductAnalyticsOccurrenceFilter: - description: Filter for occurrence-based queries. + ProductAnalyticsJoinKeys: + description: Identity join keys used to stitch events belonging to the same user or session. properties: - meta: - additionalProperties: + primary: + description: Primary identity join key. Defaults to `@session.id`. + example: "@session.id" + type: string + secondary: + description: Additional identity join keys. + items: + description: An identity join key facet. type: string - description: Additional metadata. - type: object - operator: - description: Comparison operator (=, >=, <=, >, <). - example: ">=" + type: array + type: object + ProductAnalyticsJourneyAudienceAccountQuery: + description: A named sub-query selecting a set of accounts. + properties: + name: + description: Unique name for this sub-query, referenced from `formula`. + example: enterprise_accounts type: string - value: - description: The occurrence count threshold as a string. - example: "1" + query: + description: Search query selecting the accounts. type: string required: - - operator - - value + - name type: object - ProductAnalyticsOccurrenceQuery: - description: A Product Analytics occurrence-filtered query. + ProductAnalyticsJourneyAudienceFilters: + description: |- + Restricts the journey to an audience built from named sub-queries. + Sub-query names must be unique across `users`, `segments`, and `accounts`. properties: - data_source: - $ref: "#/components/schemas/ProductAnalyticsOccurrenceQueryDataSource" - search: - $ref: "#/components/schemas/ProductAnalyticsOccurrenceSearch" + accounts: + description: Named account sub-queries. + items: + $ref: "#/components/schemas/ProductAnalyticsJourneyAudienceAccountQuery" + type: array + formula: + description: |- + Boolean expression combining the sub-query names with `AND`, `OR`, and `NOT`. + When empty, all sub-queries are combined with `AND`. + example: power_users AND NOT trial_segment + type: string + segments: + description: Named segment sub-queries. + items: + $ref: "#/components/schemas/ProductAnalyticsJourneyAudienceSegmentQuery" + type: array + users: + description: Named user sub-queries. + items: + $ref: "#/components/schemas/ProductAnalyticsJourneyAudienceUserQuery" + type: array + type: object + ProductAnalyticsJourneyAudienceSegmentQuery: + description: A named sub-query selecting a saved segment. + properties: + name: + description: Unique name for this sub-query, referenced from `formula`. + example: trial_segment + type: string + segment_id: + description: Identifier of the saved segment. + example: 00000000-0000-0000-0000-000000000000 + type: string required: - - data_source - - search + - name + - segment_id 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. + ProductAnalyticsJourneyAudienceUserQuery: + description: A named sub-query selecting a set of users. properties: - occurrences: - $ref: "#/components/schemas/ProductAnalyticsOccurrenceFilter" + name: + description: Unique name for this sub-query, referenced from `formula`. + example: power_users + type: string query: - description: The search query using Datadog search syntax. - example: "@type:action" + description: Search query selecting the users. type: string + required: + - name type: object - ProductAnalyticsResponseMeta: - description: Metadata for a Product Analytics query response. + ProductAnalyticsJourneyComputedColumn: + description: |- + A computed column added to each row. Requesting `first_conversion_timestamps` adds one + `_timestamp` key per step. properties: - request_id: - description: Unique identifier for the request, used for multi-step query continuation. - type: string - status: - $ref: "#/components/schemas/ProductAnalyticsResponseMetaStatus" + name: + $ref: "#/components/schemas/ProductAnalyticsJourneyComputedColumnName" + required: + - name type: object - ProductAnalyticsResponseMetaStatus: - description: The execution status of a Product Analytics query. + ProductAnalyticsJourneyComputedColumnName: + description: Name of a computed column to add to each row. enum: - - done - - running - - timeout + - first_conversion_timestamps + example: first_conversion_timestamps type: string x-enum-varnames: - - DONE - - RUNNING - - TIMEOUT - ProductAnalyticsScalarColumn: - description: A column in a scalar response. + - FIRST_CONVERSION_TIMESTAMPS + ProductAnalyticsJourneyConversionType: + description: Whether to return the entities that converted at the target step, or those that dropped off. + enum: + - conversion + - drop-off + example: conversion + type: string + x-enum-varnames: + - CONVERSION + - DROP_OFF + ProductAnalyticsJourneyEntity: + description: The kind of entity returned by a journey list query. + enum: + - session + - user + - account + example: session + type: string + x-enum-varnames: + - SESSION + - USER + - ACCOUNT + ProductAnalyticsJourneyFunnelCompute: + description: Defines the metric computed at each funnel step. properties: - meta: - $ref: "#/components/schemas/ProductAnalyticsScalarColumnMeta" - name: - description: Column name (facet name for group-by, or "query"). + aggregation: + description: |- + Aggregation function: `count`, `cardinality`, `avg`, `median`, `min`, `max`, `sum`, + or a percentile of the form `pc` such as `pc95`. Defaults to `cardinality`. + pattern: "^(count|cardinality|avg|median|min|max|sum|pc[0-9]{1,2})$" + type: string + metric: + description: Metric to aggregate on. Defaults to the identity join key. type: string - type: - $ref: "#/components/schemas/ProductAnalyticsScalarColumnType" - values: - description: Column values. - items: - description: A single cell value within the column (string for group-by columns, number for metric columns). - type: array type: object - ProductAnalyticsScalarColumnMeta: - description: Metadata associated with a scalar response column, including optional unit information. + ProductAnalyticsJourneyFunnelQuery: + description: Query definition for a journey funnel request. properties: - unit: - description: Unit definitions for the column values, if applicable. + compute: + $ref: "#/components/schemas/ProductAnalyticsJourneyFunnelCompute" + group_by: + description: Segments the funnel by the values of one or more facets. items: - $ref: "#/components/schemas/ProductAnalyticsUnit" - nullable: true + $ref: "#/components/schemas/ProductAnalyticsGraphQueryGroupBy" type: array + search: + $ref: "#/components/schemas/ProductAnalyticsJourneySearch" + required: + - search type: object - ProductAnalyticsScalarColumnType: - description: Column type. - enum: - - number - - group - type: string - x-enum-varnames: - - NUMBER - - GROUP - ProductAnalyticsScalarResponse: - description: Response for a scalar analytics query. + ProductAnalyticsJourneyFunnelRequest: + description: Request body for a journey funnel analysis. properties: data: - $ref: "#/components/schemas/ProductAnalyticsScalarResponseData" - meta: - $ref: "#/components/schemas/ProductAnalyticsResponseMeta" + $ref: "#/components/schemas/ProductAnalyticsJourneyFunnelRequestData" + required: + - data type: object - ProductAnalyticsScalarResponseAttributes: - description: Attributes of a scalar analytics response, containing the result columns. + ProductAnalyticsJourneyFunnelRequestAttributes: + description: Attributes of a journey funnel request. properties: - columns: - description: The list of result columns, each containing values and metadata. + exclude_anonymous_traffic: + default: false + description: Whether to exclude sessions that are not tied to an identified user. + type: boolean + from: + description: Start of the query window, in epoch milliseconds. + example: 1756425600000 + format: int64 + type: integer + query: + $ref: "#/components/schemas/ProductAnalyticsJourneyFunnelQuery" + to: + description: End of the query window, in epoch milliseconds. + example: 1756857600000 + format: int64 + type: integer + required: + - from + - to + - query + type: object + ProductAnalyticsJourneyFunnelRequestData: + description: |- + The single JSON:API resource carrying a funnel query. Its attributes hold the time window to + query and the journey whose step-to-step conversion should be measured. + properties: + attributes: + $ref: "#/components/schemas/ProductAnalyticsJourneyFunnelRequestAttributes" + type: + $ref: "#/components/schemas/ProductAnalyticsJourneyRequestType" + required: + - type + - attributes + type: object + ProductAnalyticsJourneyFunnelResponse: + description: Response for a journey funnel analysis. + properties: + data: + $ref: "#/components/schemas/ProductAnalyticsJourneyFunnelResponseData" + required: + - data + type: object + ProductAnalyticsJourneyFunnelResponseAttributes: + description: Attributes of a journey funnel response. + properties: + end_to_end_conversion_rate: + description: Conversion rate from the first step to the last step. + example: 0.42 + format: double + type: number + end_to_end_elapsed_time: + $ref: "#/components/schemas/ProductAnalyticsElapsedTime" + funnel_steps: + description: The funnel steps, in the order given by the search expression. items: - $ref: "#/components/schemas/ProductAnalyticsScalarColumn" + $ref: "#/components/schemas/ProductAnalyticsJourneyFunnelStep" type: array + initial_count: + description: Number of entities that entered the funnel. + example: 1200 + format: int64 + type: integer + required: + - initial_count + - end_to_end_conversion_rate + - end_to_end_elapsed_time + - funnel_steps type: object - ProductAnalyticsScalarResponseData: - description: Data object for a scalar response. + ProductAnalyticsJourneyFunnelResponseData: + description: |- + The single JSON:API resource holding a computed funnel. Its attributes contain the number of + entities that entered, the end-to-end conversion, and one entry per funnel step. properties: attributes: - $ref: "#/components/schemas/ProductAnalyticsScalarResponseAttributes" + $ref: "#/components/schemas/ProductAnalyticsJourneyFunnelResponseAttributes" id: - description: Unique identifier for this response data object. + description: Identifier of this result. + example: 00000000-0000-0000-0000-000000000000 type: string type: - $ref: "#/components/schemas/ProductAnalyticsScalarResponseType" + $ref: "#/components/schemas/ProductAnalyticsJourneyFunnelResponseType" + required: + - id + - type + - attributes type: object - ProductAnalyticsScalarResponseType: - description: The resource type identifier for a scalar analytics response. + ProductAnalyticsJourneyFunnelResponseType: + description: The resource type identifier for a journey funnel response. enum: - - scalar_response + - funnel_response + example: funnel_response type: string x-enum-varnames: - - SCALAR_RESPONSE - ProductAnalyticsSerie: - description: A series in a timeseries response. + - FUNNEL_RESPONSE + ProductAnalyticsJourneyFunnelStep: + description: A single step of the funnel with its conversion counts and timings. properties: - group_tags: - description: The group-by tag values that identify this series. + elapsed_time_to_next_step: + $ref: "#/components/schemas/ProductAnalyticsElapsedTime" + groups: + description: Breakdown of this step by the requested group-by facets. items: - description: A tag value for a group-by facet. - type: string + $ref: "#/components/schemas/ProductAnalyticsJourneyFunnelStepGroup" type: array - query_index: - description: The index of the query that produced this series. + label: + description: Label of the step, derived from the node alias. + example: A + type: string + unit: + description: Unit of the elapsed time values. + example: millisecond + type: string + value: + description: Value of the computed metric at this step. + example: 1200 + format: double + type: number + required: + - value + - label + - unit + - elapsed_time_to_next_step + - groups + type: object + ProductAnalyticsJourneyFunnelStepGroup: + description: Breakdown of a funnel step for one combination of group-by values. + properties: + conversion_count: + description: Number of entities in this group that reached the next step. + example: 210 format: int64 type: integer - unit: - description: Unit definitions for the series values. + elapsed_time_to_next_step: + $ref: "#/components/schemas/ProductAnalyticsElapsedTime" + group_tags: + description: Group-by values identifying this cohort. + example: + - United States items: - $ref: "#/components/schemas/ProductAnalyticsUnit" + description: A group-by value. + type: string type: array + value: + description: Value of the computed metric for this group at this step. + example: 480 + format: double + type: number + required: + - group_tags + - value + - conversion_count + - elapsed_time_to_next_step type: object - ProductAnalyticsServerSideEventError: - description: Error details. + ProductAnalyticsJourneyListQuery: + description: Query definition for a journey list request. properties: - detail: - description: Error message. + computed_columns: + description: Computed columns to add to each row. + items: + $ref: "#/components/schemas/ProductAnalyticsJourneyComputedColumn" + type: array + conversion_type: + $ref: "#/components/schemas/ProductAnalyticsJourneyConversionType" + entity_columns: + description: Attribute columns to return for each row, in addition to the identity join key and `timestamp`. + items: + description: An attribute column to return. + type: string + type: array + entity_filters: + description: Additional search query applied to the returned rows. + type: string + group_by: + description: Segments the results by the values of one or more facets. + items: + $ref: "#/components/schemas/ProductAnalyticsGraphQueryGroupBy" + type: array + limit: + description: Maximum number of rows to return. Omit it to let the service choose. + format: int64 + minimum: 1 + type: integer + search: + $ref: "#/components/schemas/ProductAnalyticsJourneySearch" + sort: + $ref: "#/components/schemas/ProductAnalyticsJourneyListSort" + target: + $ref: "#/components/schemas/ProductAnalyticsJourneyTarget" + required: + - search + type: object + ProductAnalyticsJourneyListRecord: + additionalProperties: {} + description: |- + A single row. Keys are the returned column names: the identity join key, `timestamp`, + each entry of `entity_columns`, and any computed columns. A value is null when the + column has no value for that row. + type: object + ProductAnalyticsJourneyListRequest: + description: Request body for a journey list query. + properties: + data: + $ref: "#/components/schemas/ProductAnalyticsJourneyListRequestData" + required: + - data + type: object + ProductAnalyticsJourneyListRequestAttributes: + description: Attributes of a journey list request. + properties: + from: + description: Start of the query window, in epoch milliseconds. + example: 1756425600000 + format: int64 + type: integer + query: + $ref: "#/components/schemas/ProductAnalyticsJourneyListQuery" + to: + description: End of the query window, in epoch milliseconds. + example: 1756857600000 + format: int64 + type: integer + required: + - from + - to + - query + type: object + ProductAnalyticsJourneyListRequestData: + description: |- + The single JSON:API resource carrying a journey list query. Its attributes hold the time window + and the journey whose matching entities should be listed, one row each. + properties: + attributes: + $ref: "#/components/schemas/ProductAnalyticsJourneyListRequestAttributes" + type: + $ref: "#/components/schemas/ProductAnalyticsJourneyListRequestType" + required: + - type + - attributes + type: object + ProductAnalyticsJourneyListRequestType: + description: The resource type identifier for a journey list request. + enum: + - journey_list_request + example: journey_list_request + type: string + x-enum-varnames: + - JOURNEY_LIST_REQUEST + ProductAnalyticsJourneyListResponse: + description: Response for a journey list query. + properties: + data: + $ref: "#/components/schemas/ProductAnalyticsJourneyListResponseData" + required: + - data + type: object + ProductAnalyticsJourneyListResponseAttributes: + description: Attributes of a journey list response. + properties: + entity: + $ref: "#/components/schemas/ProductAnalyticsJourneyEntity" + records: + description: The returned rows. + items: + $ref: "#/components/schemas/ProductAnalyticsJourneyListRecord" + type: array + total_count: + description: Total number of rows matching the query, ignoring `limit`. + example: 231 + format: int64 + type: integer + required: + - entity + - total_count + - records + type: object + ProductAnalyticsJourneyListResponseData: + description: |- + The single JSON:API resource holding the entities matching a journey. Its attributes contain + the returned rows and the total number of rows that matched, ignoring `limit`. + properties: + attributes: + $ref: "#/components/schemas/ProductAnalyticsJourneyListResponseAttributes" + id: + description: Identifier of this result. + example: 00000000-0000-0000-0000-000000000000 + type: string + type: + $ref: "#/components/schemas/ProductAnalyticsJourneyListResponseType" + required: + - id + - type + - attributes + type: object + ProductAnalyticsJourneyListResponseType: + description: The resource type identifier for a journey list response. + enum: + - journey_list_response + example: journey_list_response + type: string + x-enum-varnames: + - JOURNEY_LIST_RESPONSE + ProductAnalyticsJourneyListSort: + description: |- + Sort configuration for the returned rows. The sort is applied only when `facet` + is one of the returned columns; otherwise it is ignored. + properties: + facet: + description: Column to sort on. + type: string + order: + $ref: "#/components/schemas/QuerySortOrder" + type: object + ProductAnalyticsJourneyNodeTarget: + description: A reference to a single step of the journey. + properties: + type: + $ref: "#/components/schemas/ProductAnalyticsJourneyNodeTargetType" + value: + description: Alias of the targeted node. + example: A + type: string + required: + - type + - value + type: object + ProductAnalyticsJourneyNodeTargetType: + description: The discriminator identifying a target that references a single step. + enum: + - node + example: node + type: string + x-enum-varnames: + - NODE + ProductAnalyticsJourneyPathTarget: + description: A reference to the range of steps between two nodes of the journey. + properties: + end: + description: Alias of the node the path ends at. + example: B + type: string + start: + description: Alias of the node the path starts at. + example: A + type: string + type: + $ref: "#/components/schemas/ProductAnalyticsJourneyPathTargetType" + required: + - type + - start + - end + type: object + ProductAnalyticsJourneyPathTargetType: + description: The discriminator identifying a target that references a range of steps. + enum: + - path + example: path + type: string + x-enum-varnames: + - PATH + ProductAnalyticsJourneyRequestType: + description: The resource type identifier for a journey funnel request. + enum: + - journey_request + example: journey_request + type: string + x-enum-varnames: + - JOURNEY_REQUEST + ProductAnalyticsJourneyScalarCompute: + description: Defines the metric computed over the journey for a scalar query. + properties: + aggregation: + description: |- + Aggregation function: `count`, `cardinality`, `avg`, `median`, `min`, `max`, `sum`, + or a percentile of the form `pc` such as `pc95`. Defaults to `cardinality`. + example: count + pattern: "^(count|cardinality|avg|median|min|max|sum|pc[0-9]{1,2})$" + type: string + metric: + description: |- + Metric to aggregate on. Use a facet path such as `@view.time_spent`, or one of the + journey metrics `__dd.conversion`, `__dd.conversion_rate`, `__dd.time_to_convert`, + or `__dd.dropoff_rate`. Defaults to `__dd.conversion`. + type: string + target: + $ref: "#/components/schemas/ProductAnalyticsJourneyTarget" + required: + - aggregation + type: object + ProductAnalyticsJourneyScalarQuery: + description: Query definition for a journey scalar request. + properties: + compute: + $ref: "#/components/schemas/ProductAnalyticsJourneyScalarCompute" + group_by: + description: Segments the results by the values of one or more facets. + items: + $ref: "#/components/schemas/ProductAnalyticsGraphQueryGroupBy" + type: array + query_id: + description: Caller-defined identifier echoed back in the results. + type: string + search: + $ref: "#/components/schemas/ProductAnalyticsJourneySearch" + required: + - search + - compute + type: object + ProductAnalyticsJourneyScalarRequest: + description: Request body for a journey scalar query. + properties: + data: + $ref: "#/components/schemas/ProductAnalyticsJourneyScalarRequestData" + required: + - data + type: object + ProductAnalyticsJourneyScalarRequestAttributes: + description: Attributes of a journey scalar request. + properties: + from: + description: Start of the query window, in epoch milliseconds. + example: 1756425600000 + format: int64 + type: integer + query: + $ref: "#/components/schemas/ProductAnalyticsJourneyScalarQuery" + to: + description: End of the query window, in epoch milliseconds. + example: 1756857600000 + format: int64 + type: integer + required: + - from + - to + - query + type: object + ProductAnalyticsJourneyScalarRequestData: + description: |- + The single JSON:API resource carrying a journey scalar query. Its attributes hold the time + window and the journey metric to reduce to one value over that window. + properties: + attributes: + $ref: "#/components/schemas/ProductAnalyticsJourneyScalarRequestAttributes" + type: + $ref: "#/components/schemas/ProductAnalyticsFormulaJourneyRequestType" + required: + - type + - attributes + type: object + ProductAnalyticsJourneyScalarResponse: + description: Response for a journey scalar query. + properties: + data: + $ref: "#/components/schemas/ProductAnalyticsJourneyScalarResponseData" + required: + - data + type: object + ProductAnalyticsJourneyScalarResponseData: + description: |- + The single JSON:API resource holding journey scalar results. Its attributes contain one value + per group, suitable for a query value or top list widget. + properties: + attributes: + $ref: "#/components/schemas/ProductAnalyticsScalarResponseAttributes" + id: + description: Identifier of this result. + example: 00000000-0000-0000-0000-000000000000 + type: string + type: + $ref: "#/components/schemas/ProductAnalyticsJourneyScalarResponseType" + required: + - id + - type + - attributes + type: object + ProductAnalyticsJourneyScalarResponseType: + description: The resource type identifier for a journey scalar response. + enum: + - journey_scalar_response + example: journey_scalar_response + type: string + x-enum-varnames: + - JOURNEY_SCALAR_RESPONSE + ProductAnalyticsJourneySearch: + description: Defines the steps of the journey and the filters applied to it. + properties: + expression: + description: Expression combining the node aliases in order, for example `A -> B -> C`. + example: A -> B + type: string + filters: + $ref: "#/components/schemas/ProductAnalyticsJourneySearchFilters" + join_keys: + $ref: "#/components/schemas/ProductAnalyticsJoinKeys" + node_objects: + additionalProperties: + $ref: "#/components/schemas/ProductAnalyticsBaseQuery" + description: |- + Map of node alias to the query matching that step of the journey. + Every alias used in `expression` must have an entry here. + example: + A: + data_source: product_analytics + search: + query: "@type:view @view.name:Login" + B: + data_source: product_analytics + search: + query: "@type:action @action.target.name:Submit" + type: object + required: + - expression + - node_objects + type: object + ProductAnalyticsJourneySearchFilters: + description: Filters applied on top of the journey step expression. + properties: + audience_filters: + $ref: "#/components/schemas/ProductAnalyticsJourneyAudienceFilters" + graph_filters: + description: Filters on journey-level metrics such as time to convert. + items: + $ref: "#/components/schemas/ProductAnalyticsJourneySearchGraphFilter" + type: array + string_filter: + description: Free-text search query applied to the whole journey. + type: string + type: object + ProductAnalyticsJourneySearchGraphFilter: + description: A filter applied to a step, or a range of steps, of the journey graph. + properties: + name: + $ref: "#/components/schemas/ProductAnalyticsJourneySearchGraphFilterName" + operator: + $ref: "#/components/schemas/ProductAnalyticsJourneySearchGraphFilterOperator" + target: + $ref: "#/components/schemas/ProductAnalyticsJourneyTarget" + value: + description: Value compared against the metric. Durations are expressed in milliseconds. + example: 60000 + format: int64 + type: integer + required: + - name + - operator + - value + type: object + ProductAnalyticsJourneySearchGraphFilterName: + description: The journey-level metric the graph filter applies to. + enum: + - __dd.time_to_convert + - __dd.session + - __dd.dropoff_rate + example: __dd.time_to_convert + type: string + x-enum-varnames: + - TIME_TO_CONVERT + - SESSION + - DROPOFF_RATE + ProductAnalyticsJourneySearchGraphFilterOperator: + description: Comparison operator applied to the graph filter value. + enum: + - "=" + - "<" + - ">" + - "<=" + - ">=" + example: "<=" + type: string + x-enum-varnames: + - EQUAL + - LESS_THAN + - GREATER_THAN + - LESS_THAN_OR_EQUAL + - GREATER_THAN_OR_EQUAL + ProductAnalyticsJourneyTarget: + description: |- + A reference to a step, or a range of steps, in the journey. + Use a `node` target to name a single step, or a `path` target to name the range + between two steps. + oneOf: + - $ref: "#/components/schemas/ProductAnalyticsJourneyNodeTarget" + - $ref: "#/components/schemas/ProductAnalyticsJourneyPathTarget" + ProductAnalyticsJourneyTimeseriesResponse: + description: Response for a journey timeseries query. + properties: + data: + $ref: "#/components/schemas/ProductAnalyticsJourneyTimeseriesResponseData" + required: + - data + type: object + ProductAnalyticsJourneyTimeseriesResponseData: + description: |- + The single JSON:API resource holding journey timeseries results. Its attributes contain one + series per group along with the timestamps the points fall on. + properties: + attributes: + $ref: "#/components/schemas/ProductAnalyticsTimeseriesResponseAttributes" + id: + description: Identifier of this result. + example: 00000000-0000-0000-0000-000000000000 + type: string + type: + $ref: "#/components/schemas/ProductAnalyticsJourneyTimeseriesResponseType" + required: + - id + - type + - attributes + type: object + ProductAnalyticsJourneyTimeseriesResponseType: + description: The resource type identifier for a journey timeseries response. + enum: + - journey_timeseries_response + example: journey_timeseries_response + type: string + x-enum-varnames: + - JOURNEY_TIMESERIES_RESPONSE + 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: + description: Unique identifier of the query. + type: string + status: + $ref: "#/components/schemas/ProductAnalyticsResponseMetaStatus" + type: object + ProductAnalyticsResponseMetaStatus: + description: The execution status of a Product Analytics query. + enum: + - done + - running + - timeout + type: string + x-enum-varnames: + - DONE + - RUNNING + - TIMEOUT + ProductAnalyticsRetentionAggregationTarget: + description: Selects the rolled-up row that aggregates every cohort, rather than a single cohort. + properties: + type: + $ref: "#/components/schemas/ProductAnalyticsRetentionAggregationTargetType" + value: + description: The aggregation that produced the rolled-up row. + example: weighted_avg + type: string + required: + - type + - value + type: object + ProductAnalyticsRetentionAggregationTargetType: + description: The discriminator identifying a target selected by aggregation. + enum: + - aggregation + example: aggregation + type: string + x-enum-varnames: + - AGGREGATION + ProductAnalyticsRetentionCalendarTimeInterval: + description: A retention interval aligned to calendar boundaries. + properties: + type: + $ref: "#/components/schemas/ProductAnalyticsRetentionCalendarTimeIntervalType" + value: + $ref: "#/components/schemas/ProductAnalyticsCalendarInterval" + required: + - type + - value + type: object + ProductAnalyticsRetentionCalendarTimeIntervalType: + description: The discriminator identifying a calendar-aligned retention interval. + enum: + - calendar + example: calendar + type: string + x-enum-varnames: + - CALENDAR + ProductAnalyticsRetentionCellScope: + description: Narrows a retention query to a single cell, at the intersection of one cohort and one return period. + properties: + cohort_target: + $ref: "#/components/schemas/ProductAnalyticsRetentionCohortTarget" + return_period_target: + $ref: "#/components/schemas/ProductAnalyticsRetentionIndexTarget" + type: + $ref: "#/components/schemas/ProductAnalyticsRetentionCellScopeType" + required: + - type + - cohort_target + - return_period_target + type: object + ProductAnalyticsRetentionCellScopeType: + description: The discriminator identifying a scope narrowed to one grid cell. + enum: + - cell + example: cell + type: string + x-enum-varnames: + - CELL + ProductAnalyticsRetentionCohortCriteria: + description: Defines the event that places an entity into a cohort, and how cohorts are bucketed over time. + properties: + base_query: + $ref: "#/components/schemas/ProductAnalyticsBaseQuery" + time_interval: + $ref: "#/components/schemas/ProductAnalyticsRetentionTimeInterval" + required: + - base_query + - time_interval + type: object + ProductAnalyticsRetentionCohortScope: + description: Narrows a retention query to a single cohort row. + properties: + target: + $ref: "#/components/schemas/ProductAnalyticsRetentionCohortTarget" + type: + $ref: "#/components/schemas/ProductAnalyticsRetentionCohortScopeType" + required: + - type + - target + type: object + ProductAnalyticsRetentionCohortScopeType: + description: The discriminator identifying a scope narrowed to one cohort. + enum: + - cohort + example: cohort + type: string + x-enum-varnames: + - COHORT + ProductAnalyticsRetentionCohortTarget: + description: Selects a cohort, either by index or by the aggregation that rolls all cohorts together. + oneOf: + - $ref: "#/components/schemas/ProductAnalyticsRetentionIndexTarget" + - $ref: "#/components/schemas/ProductAnalyticsRetentionAggregationTarget" + ProductAnalyticsRetentionCompute: + description: The metric and aggregation applied to a retention query. + properties: + aggregation: + description: The aggregation function applied to the metric, such as `count` or `avg`. + example: count + type: string + metric: + $ref: "#/components/schemas/ProductAnalyticsRetentionComputeMetric" + required: + - metric + - aggregation + type: object + ProductAnalyticsRetentionComputeMetric: + description: The retention metric to compute, either an absolute count or a rate. + enum: + - "__dd.retention" + - "__dd.retention_rate" + example: "__dd.retention_rate" + type: string + x-enum-varnames: + - RETENTION + - RETENTION_RATE + ProductAnalyticsRetentionEntity: + description: The entity whose retention is measured. + enum: + - "@usr.id" + - "@account.id" + example: "@usr.id" + type: string + x-enum-varnames: + - USER_ID + - ACCOUNT_ID + ProductAnalyticsRetentionFilters: + description: Filters narrowing the events considered by a retention query. + properties: + audience_filters: + $ref: "#/components/schemas/ProductAnalyticsAudienceFilters" + string_filter: + description: Free-text search query applied to the events. + type: string + type: object + ProductAnalyticsRetentionFixedTimeInterval: + description: A retention interval of fixed length, such as "7 days". + properties: + type: + $ref: "#/components/schemas/ProductAnalyticsRetentionFixedTimeIntervalType" + unit: + $ref: "#/components/schemas/ProductAnalyticsRetentionFixedTimeIntervalUnit" + value: + description: Length of the interval, expressed in `unit`. + example: 7 + exclusiveMinimum: true + format: double + minimum: 0 + type: number + required: + - type + - value + - unit + type: object + ProductAnalyticsRetentionFixedTimeIntervalType: + description: The discriminator identifying a fixed-length retention interval. + enum: + - fixed + example: fixed + type: string + x-enum-varnames: + - FIXED + ProductAnalyticsRetentionFixedTimeIntervalUnit: + description: Time unit for a fixed-length retention interval. + enum: + - day + - week + - month + example: day + type: string + x-enum-varnames: + - DAY + - WEEK + - MONTH + ProductAnalyticsRetentionGridCohort: + description: One row of the retention grid, holding the results for a single cohort. + properties: + cells: + description: The cells of the row, one per return period. + items: + $ref: "#/components/schemas/ProductAnalyticsRetentionGridCohortCell" + type: array + cohort_end_time: + description: End of the cohort window, in epoch milliseconds. + format: int64 + type: integer + cohort_index: + description: Zero-based index of the cohort in the grid. + format: int64 + type: integer + cohort_size: + description: Number of entities in the cohort. + format: int64 + type: integer + cohort_start_time: + description: Start of the cohort window, in epoch milliseconds. + format: int64 + type: integer + group_tags: + description: The group-by facet values that identify this row. + items: + description: A tag value for a group-by facet. + type: string + type: array + name: + description: Label identifying the cohort, such as the week it started. + type: string + type: + $ref: "#/components/schemas/ProductAnalyticsRetentionGridCohortType" + unit: + description: Unit definitions for the cell values. + items: + $ref: "#/components/schemas/ProductAnalyticsUnit" + type: array + type: object + ProductAnalyticsRetentionGridCohortCell: + description: |- + One cell of the retention grid, holding the result for a single cohort over a single return period. + Aggregated rows omit the time and count fields. + properties: + cell_count: + description: Number of entities that returned during the period. + format: int64 + type: integer + cell_rate: + description: Fraction of the cohort that returned, between `0` and `1`. + format: double + type: number + cell_relative_value_change: + description: Change in the metric relative to the cohort baseline. + format: double + nullable: true + type: number + cell_value: + description: Value of the computed metric, when a metric other than the retention rate is requested. + format: double + nullable: true + type: number + is_partial_data: + description: Whether the return period is still open, so the numbers are not yet final. + type: boolean + return_period_end_time: + description: End of the return period, in epoch milliseconds. + format: int64 + type: integer + return_period_index: + description: Zero-based index of the return period this cell belongs to. + format: int64 + type: integer + return_period_start_time: + description: Start of the return period, in epoch milliseconds. + format: int64 + type: integer + type: + $ref: "#/components/schemas/ProductAnalyticsRetentionGridCohortType" + type: object + ProductAnalyticsRetentionGridCohortType: + description: |- + Whether the row holds one cohort's own numbers, or the weighted roll-up across every cohort. + enum: + - raw + - aggregated + example: raw + type: string + x-enum-varnames: + - RAW + - AGGREGATED + ProductAnalyticsRetentionGridQuery: + description: Query definition for a retention grid or retention metadata request. + properties: + computation_scope: + $ref: "#/components/schemas/ProductAnalyticsRetentionScope" + compute: + $ref: "#/components/schemas/ProductAnalyticsRetentionCompute" + group_by: + description: Splits the results by the values of one or more facets. + items: + $ref: "#/components/schemas/ProductAnalyticsRetentionGroupBy" + type: array + search: + $ref: "#/components/schemas/ProductAnalyticsRetentionSearch" + required: + - search + - compute + type: object + ProductAnalyticsRetentionGridRequest: + description: Request body for a retention grid query. + properties: + data: + $ref: "#/components/schemas/ProductAnalyticsRetentionGridRequestData" + required: + - data + type: object + ProductAnalyticsRetentionGridRequestAttributes: + description: Attributes of a retention grid request. + properties: + exclude_anonymous_traffic: + default: false + description: Whether to exclude sessions that are not tied to an identified user. + type: boolean + from: + description: Start of the query window, in epoch milliseconds. + example: 1756425600000 + format: int64 + type: integer + query: + $ref: "#/components/schemas/ProductAnalyticsRetentionGridQuery" + to: + description: End of the query window, in epoch milliseconds. + example: 1756857600000 + format: int64 + type: integer + required: + - from + - to + - query + type: object + ProductAnalyticsRetentionGridRequestData: + description: |- + The single JSON:API resource carrying a retention grid query. Its attributes hold the time + window to query and the cohort and return criteria that define the grid. + properties: + attributes: + $ref: "#/components/schemas/ProductAnalyticsRetentionGridRequestAttributes" + type: + $ref: "#/components/schemas/ProductAnalyticsRetentionGridRequestType" + required: + - type + - attributes + type: object + ProductAnalyticsRetentionGridRequestType: + description: The resource type identifier for a retention grid request. + enum: + - retention_grid_request + example: retention_grid_request + type: string + x-enum-varnames: + - RETENTION_GRID_REQUEST + ProductAnalyticsRetentionGridResponse: + description: Response for a retention grid query. + properties: + data: + $ref: "#/components/schemas/ProductAnalyticsRetentionGridResponseData" + required: + - data + type: object + ProductAnalyticsRetentionGridResponseAttributes: + description: Attributes of a retention grid response, containing the cohort rows and the period columns. + properties: + cohorts: + description: The cohorts forming the rows of the grid. + items: + $ref: "#/components/schemas/ProductAnalyticsRetentionGridCohort" + type: array + retention_entity: + description: The entity whose retention was measured. + type: string + retention_periods: + description: The return periods forming the columns of the grid. + items: + $ref: "#/components/schemas/ProductAnalyticsRetentionPeriod" + type: array + unit: + description: Unit definitions for the grid values. + items: + $ref: "#/components/schemas/ProductAnalyticsUnit" + type: array + type: object + ProductAnalyticsRetentionGridResponseData: + description: |- + The single JSON:API resource holding a computed retention grid. Its attributes contain the + return periods forming the columns and the cohorts forming the rows. + properties: + attributes: + $ref: "#/components/schemas/ProductAnalyticsRetentionGridResponseAttributes" + id: + description: Unique identifier for this response data object. + example: 00000000-0000-0000-0000-000000000000 + type: string + type: + $ref: "#/components/schemas/ProductAnalyticsRetentionGridResponseType" + required: + - id + - type + - attributes + type: object + ProductAnalyticsRetentionGridResponseType: + description: The resource type identifier for a retention grid response. + enum: + - retention_grid_response + example: retention_grid_response + type: string + x-enum-varnames: + - RETENTION_GRID_RESPONSE + ProductAnalyticsRetentionGroupBy: + description: Splits retention results by the values of a facet. + properties: + facet: + description: The attribute path to group by. + example: "@geo.country" + type: string + limit: + description: Maximum number of groups to return. Omit it to let the service choose. + example: 10 + format: int64 + minimum: 1 + type: integer + should_exclude_missing: + default: false + description: Whether to drop entities that have no value for the facet. + type: boolean + sort: + $ref: "#/components/schemas/ProductAnalyticsGroupBySort" + source: + description: Audience source backing the group-by, when grouping by an audience rather than a facet. + type: string + target: + $ref: "#/components/schemas/ProductAnalyticsRetentionGroupByTarget" + required: + - target + - facet + type: object + ProductAnalyticsRetentionGroupByTarget: + description: Which axis of the retention grid a group-by applies to. + enum: + - cohort + - return_period + example: cohort + type: string + x-enum-varnames: + - COHORT + - RETURN_PERIOD + ProductAnalyticsRetentionIndexTarget: + description: Selects a cohort or return period by its zero-based position in the grid. + properties: + type: + $ref: "#/components/schemas/ProductAnalyticsRetentionIndexTargetType" + value: + description: Zero-based index of the targeted cohort or return period. + example: 0 + format: int64 + minimum: 0 + type: integer + required: + - type + - value + type: object + ProductAnalyticsRetentionIndexTargetType: + description: The discriminator identifying a target selected by index. + enum: + - index + example: index + type: string + x-enum-varnames: + - INDEX + ProductAnalyticsRetentionListColumn: + description: A column to include in each returned entity row. + properties: + field: + $ref: "#/components/schemas/ProductAnalyticsRetentionListColumnField" + type: object + ProductAnalyticsRetentionListColumnField: + description: The attribute selected for a column. + properties: + path: + description: Attribute path of the column. + example: "@usr.email" + type: string + type: object + ProductAnalyticsRetentionListQuery: + description: Query definition for a retention list request. + properties: + columns: + description: The attribute columns to include in each returned row. + items: + $ref: "#/components/schemas/ProductAnalyticsRetentionListColumn" + type: array + computation_scope: + $ref: "#/components/schemas/ProductAnalyticsRetentionCellScope" + limit: + description: Maximum number of rows to return. Use `0` for no limit. + example: 100 + format: int64 + minimum: 0 + type: integer + search: + $ref: "#/components/schemas/ProductAnalyticsRetentionSearch" + required: + - search + - computation_scope + type: object + ProductAnalyticsRetentionListRecord: + additionalProperties: {} + description: A single entity row, keyed by the requested column paths. + type: object + ProductAnalyticsRetentionListRequest: + description: Request body listing the individual entities behind one cell of the retention grid. + properties: + data: + $ref: "#/components/schemas/ProductAnalyticsRetentionListRequestData" + required: + - data + type: object + ProductAnalyticsRetentionListRequestAttributes: + description: Attributes of a retention list request. + properties: + from: + description: Start of the query window, in epoch milliseconds. + example: 1756425600000 + format: int64 + type: integer + query: + $ref: "#/components/schemas/ProductAnalyticsRetentionListQuery" + to: + description: End of the query window, in epoch milliseconds. + example: 1756857600000 + format: int64 + type: integer + required: + - from + - to + - query + type: object + ProductAnalyticsRetentionListRequestData: + description: |- + The single JSON:API resource carrying a retention list query. Its attributes hold the time + window, the cell to list, and the columns to return for each entity. + properties: + attributes: + $ref: "#/components/schemas/ProductAnalyticsRetentionListRequestAttributes" + type: + $ref: "#/components/schemas/ProductAnalyticsRetentionListRequestType" + required: + - type + - attributes + type: object + ProductAnalyticsRetentionListRequestType: + description: The resource type identifier for a retention list request. + enum: + - retention_list_request + example: retention_list_request + type: string + x-enum-varnames: + - RETENTION_LIST_REQUEST + ProductAnalyticsRetentionListResponse: + description: Response for a retention list query. + properties: + data: + $ref: "#/components/schemas/ProductAnalyticsRetentionListResponseData" + required: + - data + type: object + ProductAnalyticsRetentionListResponseAttributes: + description: Attributes of a retention list response, containing the matching entity rows. + properties: + records: + description: The matching entity rows. + items: + $ref: "#/components/schemas/ProductAnalyticsRetentionListRecord" + type: array + retention_entity: + description: The entity whose retention was measured. + type: string + type: object + ProductAnalyticsRetentionListResponseData: + description: |- + The single JSON:API resource holding the entities behind one retention cell. Its attributes + contain the entity whose retention was measured and one row per matching entity. + properties: + attributes: + $ref: "#/components/schemas/ProductAnalyticsRetentionListResponseAttributes" + id: + description: Unique identifier for this response data object. + example: 00000000-0000-0000-0000-000000000000 + type: string + type: + $ref: "#/components/schemas/ProductAnalyticsRetentionListResponseType" + required: + - id + - type + - attributes + type: object + ProductAnalyticsRetentionListResponseType: + description: The resource type identifier for a retention list response. + enum: + - retention_list_response + example: retention_list_response + type: string + x-enum-varnames: + - RETENTION_LIST_RESPONSE + ProductAnalyticsRetentionPeriod: + description: A return period definition, such as "1 week". + properties: + unit: + description: Time unit of the period, such as `day`, `week`, `month`, or `year`. + example: week + type: string + value: + description: Length of the period, expressed in `unit`. + example: 1 + format: int64 + type: integer + type: object + ProductAnalyticsRetentionReturnCondition: + description: |- + When an entity counts as having returned. Use `conversion_on` to count only entities that + returned during the period itself, or `conversion_on_or_after` to also count later returns. + enum: + - conversion_on + - conversion_on_or_after + example: conversion_on_or_after + type: string + x-enum-varnames: + - CONVERSION_ON + - CONVERSION_ON_OR_AFTER + ProductAnalyticsRetentionReturnCriteria: + description: Defines the event that counts as a return, and the window in which it must occur. + properties: + base_query: + $ref: "#/components/schemas/ProductAnalyticsBaseQuery" + time_interval: + $ref: "#/components/schemas/ProductAnalyticsRetentionTimeInterval" + required: + - base_query + type: object + ProductAnalyticsRetentionReturnPeriodScope: + description: Narrows a retention query to a single return-period column. + properties: + target: + $ref: "#/components/schemas/ProductAnalyticsRetentionIndexTarget" + type: + $ref: "#/components/schemas/ProductAnalyticsRetentionReturnPeriodScopeType" + required: + - type + - target + type: object + ProductAnalyticsRetentionReturnPeriodScopeType: + description: The discriminator identifying a scope narrowed to one return period. + enum: + - return_period + example: return_period + type: string + x-enum-varnames: + - RETURN_PERIOD + ProductAnalyticsRetentionScope: + description: |- + Restricts a retention query to part of the grid, so that results can be examined in detail. + Omit it to compute the whole grid. + oneOf: + - $ref: "#/components/schemas/ProductAnalyticsRetentionCohortScope" + - $ref: "#/components/schemas/ProductAnalyticsRetentionReturnPeriodScope" + - $ref: "#/components/schemas/ProductAnalyticsRetentionCellScope" + ProductAnalyticsRetentionSearch: + description: Defines the cohort and return criteria that make up a retention query. + properties: + cohort_criteria: + $ref: "#/components/schemas/ProductAnalyticsRetentionCohortCriteria" + filters: + $ref: "#/components/schemas/ProductAnalyticsRetentionFilters" + retention_entity: + $ref: "#/components/schemas/ProductAnalyticsRetentionEntity" + return_condition: + $ref: "#/components/schemas/ProductAnalyticsRetentionReturnCondition" + return_criteria: + $ref: "#/components/schemas/ProductAnalyticsRetentionReturnCriteria" + required: + - cohort_criteria + - retention_entity + - return_condition + type: object + ProductAnalyticsRetentionTimeInterval: + description: |- + A retention interval, either aligned to calendar boundaries or of a fixed length. + Cohort criteria use calendar intervals; return criteria use fixed intervals. + oneOf: + - $ref: "#/components/schemas/ProductAnalyticsRetentionCalendarTimeInterval" + - $ref: "#/components/schemas/ProductAnalyticsRetentionFixedTimeInterval" + ProductAnalyticsSankeyAggregatedNode: + description: One of the nodes rolled up into an aggregated node, retained so the roll-up can be broken down. + properties: + id: + description: Unique identifier for the node. + type: string + incoming_value: + description: Number of sessions entering the node. + format: int64 + type: integer + name: + description: The facet value the node represents. + type: string + outgoing_value: + description: Number of sessions leaving the node. + format: int64 + type: integer + type: + $ref: "#/components/schemas/ProductAnalyticsSankeyAggregatedNodeType" + value: + description: Number of sessions passing through the node. + format: int64 + type: integer + type: object + ProductAnalyticsSankeyAggregatedNodeType: + description: The resource type identifier for a node rolled up into an aggregated node. + enum: + - aggregated + type: string + x-enum-varnames: + - AGGREGATED + ProductAnalyticsSankeyDefinition: + description: The shape of the Sankey diagram, expressed as the facets to flow between and how many steps to show. + properties: + entries_per_step: + description: |- + Maximum number of nodes to keep in each column. Remaining values are rolled up into an + aggregated node. Omit it, or send `0`, to use the default of `5`. + example: 10 + format: int64 + maximum: 10 + minimum: 0 + type: integer + number_of_steps: + description: |- + Number of intermediate columns between the source and the target. + Omit it, or send `0`, to use the default of `5`. + example: 3 + format: int64 + maximum: 10 + minimum: 0 + type: integer + source: + description: Facet forming the first column of the diagram. + example: "@view.name" + type: string + target: + description: Facet forming the last column of the diagram. + example: "@view.name" + type: string + required: + - source + - target + type: object + ProductAnalyticsSankeyLink: + description: A link of the Sankey diagram, representing the sessions flowing between two nodes. + properties: + column: + description: Zero-based index of the column the link starts from. + format: int64 + type: integer + id: + description: Unique identifier for the link. + type: string + source: + description: Identifier of the node the link starts at. + type: string + target: + description: Identifier of the node the link ends at. + type: string + value: + description: Number of sessions flowing along the link. + format: int64 + type: integer + type: object + ProductAnalyticsSankeyNode: + description: A node of the Sankey diagram, representing one facet value in one column. + properties: + aggregated_nodes: + description: The nodes rolled up into this one, when the node is an aggregate. + items: + $ref: "#/components/schemas/ProductAnalyticsSankeyAggregatedNode" + type: array + column: + description: Zero-based index of the column the node sits in. + format: int64 + type: integer + dropoff_value: + description: Number of sessions that ended at the node. + format: int64 + type: integer + id: + description: Unique identifier for the node. + type: string + incoming_value: + description: Number of sessions entering the node. + format: int64 + type: integer + name: + description: The facet value the node represents. + type: string + outgoing_value: + description: Number of sessions leaving the node. + format: int64 + type: integer + type: + $ref: "#/components/schemas/ProductAnalyticsSankeyNodeType" + value: + description: Number of sessions passing through the node. + format: int64 + type: integer + type: object + ProductAnalyticsSankeyNodeType: + description: |- + The kind of node. `regular` is a single facet value, `other` rolls up the values that did not + fit within `entries_per_step`, and `dropoff` collects the sessions that ended at this column. + enum: + - regular + - other + - dropoff + type: string + x-enum-varnames: + - REGULAR + - OTHER + - DROPOFF + ProductAnalyticsSankeyRequest: + description: Request body for a Sankey diagram query. + properties: + data: + $ref: "#/components/schemas/ProductAnalyticsSankeyRequestData" + required: + - data + type: object + ProductAnalyticsSankeyRequestAttributes: + description: Attributes of a Sankey request. + properties: + definition: + $ref: "#/components/schemas/ProductAnalyticsSankeyDefinition" + search: + $ref: "#/components/schemas/ProductAnalyticsSankeySearch" + time: + $ref: "#/components/schemas/ProductAnalyticsSankeyTime" + required: + - time + - search + - definition + type: object + ProductAnalyticsSankeyRequestData: + description: |- + The single JSON:API resource carrying a Sankey query. Its attributes hold the time window to + query, the search that selects the sessions, and the definition of the diagram to build. + properties: + attributes: + $ref: "#/components/schemas/ProductAnalyticsSankeyRequestAttributes" + type: + $ref: "#/components/schemas/ProductAnalyticsSankeyRequestType" + required: + - type + - attributes + type: object + ProductAnalyticsSankeyRequestType: + description: The resource type identifier for a Sankey request. + enum: + - sankey_request + example: sankey_request + type: string + x-enum-varnames: + - SANKEY_REQUEST + ProductAnalyticsSankeyResponse: + description: Response for a Sankey diagram query. + properties: + data: + $ref: "#/components/schemas/ProductAnalyticsSankeyResponseData" + required: + - data + type: object + ProductAnalyticsSankeyResponseAttributes: + description: Attributes of a Sankey response, containing the nodes and the links between them. + properties: + links: + description: The links of the diagram, one per pair of connected nodes. + items: + $ref: "#/components/schemas/ProductAnalyticsSankeyLink" + type: array + nodes: + description: The nodes of the diagram, one per facet value and column. + items: + $ref: "#/components/schemas/ProductAnalyticsSankeyNode" + type: array + type: object + ProductAnalyticsSankeyResponseData: + description: |- + The single JSON:API resource holding a computed Sankey diagram. Its attributes contain the + nodes of every column and the links that carry sessions between them. + properties: + attributes: + $ref: "#/components/schemas/ProductAnalyticsSankeyResponseAttributes" + id: + description: Unique identifier for this response data object. + example: 00000000-0000-0000-0000-000000000000 + type: string + type: + $ref: "#/components/schemas/ProductAnalyticsSankeyResponseType" + required: + - id + - type + - attributes + type: object + ProductAnalyticsSankeyResponseType: + description: The resource type identifier for a Sankey response. + enum: + - sankey_response + example: sankey_response + type: string + x-enum-varnames: + - SANKEY_RESPONSE + ProductAnalyticsSankeySearch: + description: Selects the sessions a Sankey diagram is built from. + properties: + audience_filters: + $ref: "#/components/schemas/ProductAnalyticsAudienceFilters" + join_keys: + $ref: "#/components/schemas/ProductAnalyticsJoinKeys" + query: + description: Datadog search query restricting the events considered. + example: "@type:view" + type: string + type: object + ProductAnalyticsSankeyTime: + description: The time window a Sankey query covers. + properties: + from: + description: Start of the query window, in epoch milliseconds. + example: 1756425600000 + format: int64 + type: integer + to: + description: End of the query window, in epoch milliseconds. + example: 1756857600000 + format: int64 + type: integer + required: + - from + - to + type: object + 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: + description: A single cell value within the column (string for group-by columns, number for metric columns). + type: array + type: object + ProductAnalyticsScalarColumnMeta: + description: Metadata associated with a scalar response column, including optional unit information. + properties: + unit: + description: Unit definitions for the column values, if applicable. + 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: + description: Attributes of a scalar analytics response, containing the result columns. + properties: + columns: + description: The list of result columns, each containing values and metadata. + items: + $ref: "#/components/schemas/ProductAnalyticsScalarColumn" + type: array + type: object + ProductAnalyticsScalarResponseData: + description: Data object for a scalar response. + properties: + attributes: + $ref: "#/components/schemas/ProductAnalyticsScalarResponseAttributes" + id: + description: Unique identifier for this response data object. + type: string + type: + $ref: "#/components/schemas/ProductAnalyticsScalarResponseType" + type: object + ProductAnalyticsScalarResponseType: + description: The resource type identifier for a scalar analytics response. + enum: + - scalar_response + type: string + x-enum-varnames: + - SCALAR_RESPONSE + ProductAnalyticsSerie: + description: A series in a timeseries response. + properties: + group_tags: + description: The group-by tag values that identify this series. + items: + description: A tag value for a group-by facet. + type: string + type: array + query_index: + description: The index of the query that produced this series. + format: int64 + type: integer + unit: + description: Unit definitions for the series values. + items: + $ref: "#/components/schemas/ProductAnalyticsUnit" + type: array + type: object + ProductAnalyticsServerSideEventError: + description: Error details. + properties: + detail: + description: Error message. example: "Malformed payload" type: string status: @@ -83293,7 +85451,9 @@ components: $ref: "#/components/schemas/ProductAnalyticsResponseMeta" type: object ProductAnalyticsTimeseriesResponseAttributes: - description: Attributes of a timeseries analytics response, containing series data, timestamps, and interval definitions. + description: |- + Attributes of a timeseries analytics response, containing series data, timestamps, and + interval definitions. properties: intervals: description: Interval definitions describing the time buckets used in the response. @@ -178604,6 +180764,68 @@ paths: tags: - Rum Audience Management x-unstable: "**Note**: This endpoint may be subject to changes." + /api/v2/product-analytics/analytics/list: + post: + description: |- + List the individual event records matching an analytics query. + Use `columns` to choose the attributes returned on each row, `sort` to order the rows, + and `limit` to cap how many are returned. + operationId: QueryProductAnalyticsList + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + from: 1771232048460 + query: + columns: + - "@view.name" + limit: 100 + query: + data_source: product_analytics + search: + query: "@type:view" + to: 1771836848262 + type: formula_analytics_extended_list_request + schema: + $ref: "#/components/schemas/ProductAnalyticsAnalyticsListRequest" + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + records: [] + total_count: 0 + id: abc-123 + type: list_response + schema: + $ref: "#/components/schemas/ProductAnalyticsAnalyticsListResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: List analytics events + tags: + - Product Analytics + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - rum_apps_read + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/product-analytics/analytics/scalar: post: description: |- @@ -178718,6 +180940,667 @@ paths: operator: OR permissions: - rum_apps_read + /api/v2/product-analytics/journey/funnel: + post: + description: |- + Compute a funnel over an ordered sequence of Product Analytics events. + Returns the per-step conversion counts, conversion rates, and elapsed times, + optionally segmented by group-by facets. + operationId: QueryProductAnalyticsJourneyFunnel + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + from: 1756425600000 + query: + compute: + aggregation: count + search: + expression: A -> B + node_objects: + A: + data_source: product_analytics + search: + query: "@type:view @view.name:Login" + B: + data_source: product_analytics + search: + query: "@type:action @action.target.name:Submit" + to: 1756857600000 + type: journey_request + schema: + $ref: "#/components/schemas/ProductAnalyticsJourneyFunnelRequest" + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + end_to_end_conversion_rate: 0.42 + end_to_end_elapsed_time: + avg: 9400 + max: 86400 + min: 1200 + funnel_steps: + - elapsed_time_to_next_step: + avg: 5100 + max: 42000 + min: 900 + groups: [] + label: A + unit: millisecond + value: 1200 + initial_count: 1200 + id: 00000000-0000-0000-0000-000000000000 + type: funnel_response + schema: + $ref: "#/components/schemas/ProductAnalyticsJourneyFunnelResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Compute journey funnel analysis + tags: + - Product Analytics + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - rum_apps_read + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/product-analytics/journey/list: + post: + description: |- + Return the individual sessions that reached, or dropped off at, a given step of the journey. + Each row contains the identity join key, the event timestamp, and the columns requested + in `entity_columns`. + operationId: QueryProductAnalyticsJourneyList + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + from: 1756425600000 + query: + entity_columns: + - "@usr.name" + limit: 50 + search: + expression: A -> B + node_objects: + A: + data_source: product_analytics + search: + query: "@type:view @view.name:Login" + B: + data_source: product_analytics + search: + query: "@type:action @action.target.name:Submit" + to: 1756857600000 + type: journey_list_request + schema: + $ref: "#/components/schemas/ProductAnalyticsJourneyListRequest" + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + entity: session + records: + - "@session.id": 00000000-0000-0000-0000-000000000001 + "@usr.name": Jane Doe + timestamp: 1756425600000 + total_count: 231 + id: 00000000-0000-0000-0000-000000000000 + type: journey_list_response + schema: + $ref: "#/components/schemas/ProductAnalyticsJourneyListResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: List journey entities + tags: + - Product Analytics + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - rum_apps_read + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/product-analytics/journey/scalar: + post: + description: |- + Compute scalar results for a journey query, such as the conversion count, + the conversion rate, or the time to convert, optionally segmented by group-by facets. + operationId: QueryProductAnalyticsJourneyScalar + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + from: 1756425600000 + query: + compute: + aggregation: count + metric: __dd.conversion_rate + search: + expression: A -> B + node_objects: + A: + data_source: product_analytics + search: + query: "@type:view @view.name:Login" + B: + data_source: product_analytics + search: + query: "@type:action @action.target.name:Submit" + to: 1756857600000 + type: formula_journey_request + schema: + $ref: "#/components/schemas/ProductAnalyticsJourneyScalarRequest" + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + columns: [] + id: 00000000-0000-0000-0000-000000000000 + type: journey_scalar_response + schema: + $ref: "#/components/schemas/ProductAnalyticsJourneyScalarResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Compute journey scalar analytics + tags: + - Product Analytics + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - rum_apps_read + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/product-analytics/journey/timeseries: + post: + description: |- + Compute timeseries results for a journey query. + Returns one series per group-by combination, bucketed by the requested interval. + operationId: QueryProductAnalyticsJourneyTimeseries + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + from: 1756425600000 + interval: 3600000 + query: + compute: + aggregation: count + search: + expression: A -> B + node_objects: + A: + data_source: product_analytics + search: + query: "@type:view @view.name:Login" + B: + data_source: product_analytics + search: + query: "@type:action @action.target.name:Submit" + to: 1756857600000 + type: formula_journey_request + schema: + $ref: "#/components/schemas/ProductAnalyticsFormulaJourneyRequest" + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + series: [] + times: [] + id: 00000000-0000-0000-0000-000000000000 + type: journey_timeseries_response + schema: + $ref: "#/components/schemas/ProductAnalyticsJourneyTimeseriesResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Compute journey timeseries analytics + tags: + - Product Analytics + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - rum_apps_read + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/product-analytics/retention/grid: + post: + description: |- + Compute a retention grid, showing how much of each cohort came back over each subsequent period. + Rows are cohorts, columns are return periods, and each cell holds the count and rate of entities that returned. + operationId: QueryProductAnalyticsRetentionGrid + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + from: 1756425600000 + query: + compute: + aggregation: count + metric: "__dd.retention_rate" + search: + cohort_criteria: + base_query: + data_source: product_analytics + search: + query: "@type:view @view.name:Signup" + time_interval: + type: calendar + value: + alignment: monday + quantity: 1 + timezone: UTC + type: week + retention_entity: "@usr.id" + return_condition: conversion_on_or_after + return_criteria: + base_query: + data_source: product_analytics + search: + query: "@type:view" + to: 1756857600000 + type: retention_grid_request + schema: + $ref: "#/components/schemas/ProductAnalyticsRetentionGridRequest" + description: The retention grid query. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + cohorts: [] + retention_entity: "@usr.id" + retention_periods: [] + id: 00000000-0000-0000-0000-000000000000 + type: retention_grid_response + schema: + $ref: "#/components/schemas/ProductAnalyticsRetentionGridResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Compute a retention grid + tags: + - Product Analytics + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - rum_apps_read + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/product-analytics/retention/list: + post: + description: |- + List the individual users or accounts counted in one cell of the retention grid. + Set `computation_scope` to the cohort and return period you want to examine. + operationId: QueryProductAnalyticsRetentionList + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + from: 1756425600000 + query: + columns: + - field: + path: "@usr.email" + computation_scope: + cohort_target: + type: index + value: 0 + return_period_target: + type: index + value: 1 + type: cell + limit: 100 + search: + cohort_criteria: + base_query: + data_source: product_analytics + search: + query: "@type:view @view.name:Signup" + time_interval: + type: calendar + value: + quantity: 1 + type: week + retention_entity: "@usr.id" + return_condition: conversion_on_or_after + to: 1756857600000 + type: retention_list_request + schema: + $ref: "#/components/schemas/ProductAnalyticsRetentionListRequest" + description: The retention list query. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + records: [] + retention_entity: "@usr.id" + id: 00000000-0000-0000-0000-000000000000 + type: retention_list_response + schema: + $ref: "#/components/schemas/ProductAnalyticsRetentionListResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: List the entities behind a retention cell + tags: + - Product Analytics + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - rum_apps_read + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/product-analytics/retention/scalar: + post: + description: Compute retention as a single value per group, suitable for a query value or top list widget. + operationId: QueryProductAnalyticsRetentionScalar + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + from: 1756425600000 + query: + compute: + aggregation: count + metric: "__dd.retention_rate" + search: + cohort_criteria: + base_query: + data_source: product_analytics + search: + query: "@type:view @view.name:Signup" + time_interval: + type: calendar + value: + alignment: monday + quantity: 1 + timezone: UTC + type: week + retention_entity: "@usr.id" + return_condition: conversion_on_or_after + return_criteria: + base_query: + data_source: product_analytics + search: + query: "@type:view" + to: 1756857600000 + type: formula_retention_request + schema: + $ref: "#/components/schemas/ProductAnalyticsFormulaRetentionRequest" + description: The retention scalar query. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + columns: [] + type: scalar_response + schema: + $ref: "#/components/schemas/ProductAnalyticsScalarResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Compute retention scalar values + tags: + - Product Analytics + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - rum_apps_read + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/product-analytics/retention/timeseries: + post: + description: |- + Compute retention as a series of values over time, using the same query definition as the + retention grid. + operationId: QueryProductAnalyticsRetentionTimeseries + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + from: 1756425600000 + query: + compute: + aggregation: count + metric: "__dd.retention_rate" + search: + cohort_criteria: + base_query: + data_source: product_analytics + search: + query: "@type:view @view.name:Signup" + time_interval: + type: calendar + value: + alignment: monday + quantity: 1 + timezone: UTC + type: week + retention_entity: "@usr.id" + return_condition: conversion_on_or_after + return_criteria: + base_query: + data_source: product_analytics + search: + query: "@type:view" + to: 1756857600000 + type: formula_retention_request + schema: + $ref: "#/components/schemas/ProductAnalyticsFormulaRetentionRequest" + description: The retention timeseries query. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + series: [] + times: [] + type: timeseries_response + schema: + $ref: "#/components/schemas/ProductAnalyticsTimeseriesResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Compute retention timeseries + tags: + - Product Analytics + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - rum_apps_read + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/product-analytics/sankey: + post: + description: |- + Compute a Sankey diagram of how sessions flow between the values of two facets, + showing where users continue and where they drop off at each step. + operationId: QueryProductAnalyticsSankey + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + definition: + entries_per_step: 10 + number_of_steps: 3 + source: "@view.name" + target: "@view.name" + search: + query: "@type:view" + time: + from: 1756425600000 + to: 1756857600000 + type: sankey_request + schema: + $ref: "#/components/schemas/ProductAnalyticsSankeyRequest" + description: The Sankey diagram query. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + links: [] + nodes: [] + id: 00000000-0000-0000-0000-000000000000 + type: sankey_response + schema: + $ref: "#/components/schemas/ProductAnalyticsSankeyResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Compute a Sankey diagram + tags: + - Product Analytics + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - rum_apps_read + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/product-analytics/users/event_filtered_query: post: description: Query users filtered by both user properties and event platform data diff --git a/examples/v2/product-analytics/QueryProductAnalyticsJourneyFunnel.java b/examples/v2/product-analytics/QueryProductAnalyticsJourneyFunnel.java new file mode 100644 index 00000000000..84e6c9f841d --- /dev/null +++ b/examples/v2/product-analytics/QueryProductAnalyticsJourneyFunnel.java @@ -0,0 +1,158 @@ +// Compute journey funnel analysis 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.ProductAnalyticsBaseQuery; +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.ProductAnalyticsGraphQueryGroupBy; +import com.datadog.api.client.v2.model.ProductAnalyticsGraphQueryGroupBySource; +import com.datadog.api.client.v2.model.ProductAnalyticsGroupBySort; +import com.datadog.api.client.v2.model.ProductAnalyticsJoinKeys; +import com.datadog.api.client.v2.model.ProductAnalyticsJourneyAudienceAccountQuery; +import com.datadog.api.client.v2.model.ProductAnalyticsJourneyAudienceFilters; +import com.datadog.api.client.v2.model.ProductAnalyticsJourneyAudienceSegmentQuery; +import com.datadog.api.client.v2.model.ProductAnalyticsJourneyAudienceUserQuery; +import com.datadog.api.client.v2.model.ProductAnalyticsJourneyFunnelCompute; +import com.datadog.api.client.v2.model.ProductAnalyticsJourneyFunnelQuery; +import com.datadog.api.client.v2.model.ProductAnalyticsJourneyFunnelRequest; +import com.datadog.api.client.v2.model.ProductAnalyticsJourneyFunnelRequestAttributes; +import com.datadog.api.client.v2.model.ProductAnalyticsJourneyFunnelRequestData; +import com.datadog.api.client.v2.model.ProductAnalyticsJourneyFunnelResponse; +import com.datadog.api.client.v2.model.ProductAnalyticsJourneyNodeTarget; +import com.datadog.api.client.v2.model.ProductAnalyticsJourneyNodeTargetType; +import com.datadog.api.client.v2.model.ProductAnalyticsJourneyRequestType; +import com.datadog.api.client.v2.model.ProductAnalyticsJourneySearch; +import com.datadog.api.client.v2.model.ProductAnalyticsJourneySearchFilters; +import com.datadog.api.client.v2.model.ProductAnalyticsJourneySearchGraphFilter; +import com.datadog.api.client.v2.model.ProductAnalyticsJourneySearchGraphFilterName; +import com.datadog.api.client.v2.model.ProductAnalyticsJourneySearchGraphFilterOperator; +import com.datadog.api.client.v2.model.ProductAnalyticsJourneyTarget; +import com.datadog.api.client.v2.model.QuerySortOrder; +import java.util.Collections; +import java.util.Map; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.queryProductAnalyticsJourneyFunnel", true); + ProductAnalyticsApi apiInstance = new ProductAnalyticsApi(defaultClient); + + ProductAnalyticsJourneyFunnelRequest body = + new ProductAnalyticsJourneyFunnelRequest() + .data( + new ProductAnalyticsJourneyFunnelRequestData() + .attributes( + new ProductAnalyticsJourneyFunnelRequestAttributes() + .excludeAnonymousTraffic(false) + .from(1756425600000L) + .query( + new ProductAnalyticsJourneyFunnelQuery() + .compute(new ProductAnalyticsJourneyFunnelCompute()) + .groupBy( + Collections.singletonList( + new ProductAnalyticsGraphQueryGroupBy() + .facet("@geo.country") + .shouldExcludeMissing(false) + .sort( + new ProductAnalyticsGroupBySort() + .aggregation("count") + .order(QuerySortOrder.DESC)) + .source( + ProductAnalyticsGraphQueryGroupBySource.USERS) + .target( + new ProductAnalyticsJourneyTarget( + new ProductAnalyticsJourneyNodeTarget() + .type( + ProductAnalyticsJourneyNodeTargetType + .NODE) + .value("A"))))) + .search( + new ProductAnalyticsJourneySearch() + .expression("A -> B") + .filters( + new ProductAnalyticsJourneySearchFilters() + .audienceFilters( + new ProductAnalyticsJourneyAudienceFilters() + .accounts( + Collections.singletonList( + new ProductAnalyticsJourneyAudienceAccountQuery() + .name( + "enterprise_accounts"))) + .formula( + "power_users AND NOT trial_segment") + .segments( + Collections.singletonList( + new ProductAnalyticsJourneyAudienceSegmentQuery() + .name("trial_segment") + .segmentId( + "00000000-0000-0000-0000-000000000000"))) + .users( + Collections.singletonList( + new ProductAnalyticsJourneyAudienceUserQuery() + .name("power_users")))) + .graphFilters( + Collections.singletonList( + new ProductAnalyticsJourneySearchGraphFilter() + .name( + ProductAnalyticsJourneySearchGraphFilterName + .TIME_TO_CONVERT) + .operator( + ProductAnalyticsJourneySearchGraphFilterOperator + .LESS_THAN_OR_EQUAL) + .target( + new ProductAnalyticsJourneyTarget( + new ProductAnalyticsJourneyNodeTarget() + .type( + ProductAnalyticsJourneyNodeTargetType + .NODE) + .value("A"))) + .value(60000L)))) + .joinKeys( + new ProductAnalyticsJoinKeys() + .primary("@session.id")) + .nodeObjects( + Map.ofEntries( + Map.entry( + "A", + new ProductAnalyticsBaseQuery( + new ProductAnalyticsEventQuery() + .dataSource( + ProductAnalyticsEventQueryDataSource + .PRODUCT_ANALYTICS) + .search( + new ProductAnalyticsEventSearch() + .query( + "@type:view" + + " @view.name:Login")))), + Map.entry( + "B", + new ProductAnalyticsBaseQuery( + new ProductAnalyticsEventQuery() + .dataSource( + ProductAnalyticsEventQueryDataSource + .PRODUCT_ANALYTICS) + .search( + new ProductAnalyticsEventSearch() + .query( + "@type:action" + + " @action.target.name:Submit")))))))) + .to(1756857600000L)) + .type(ProductAnalyticsJourneyRequestType.JOURNEY_REQUEST)); + + try { + ProductAnalyticsJourneyFunnelResponse result = + apiInstance.queryProductAnalyticsJourneyFunnel(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling ProductAnalyticsApi#queryProductAnalyticsJourneyFunnel"); + 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/QueryProductAnalyticsJourneyList.java b/examples/v2/product-analytics/QueryProductAnalyticsJourneyList.java new file mode 100644 index 00000000000..25d8b522d76 --- /dev/null +++ b/examples/v2/product-analytics/QueryProductAnalyticsJourneyList.java @@ -0,0 +1,175 @@ +// List journey entities 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.ProductAnalyticsBaseQuery; +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.ProductAnalyticsGraphQueryGroupBy; +import com.datadog.api.client.v2.model.ProductAnalyticsGraphQueryGroupBySource; +import com.datadog.api.client.v2.model.ProductAnalyticsGroupBySort; +import com.datadog.api.client.v2.model.ProductAnalyticsJoinKeys; +import com.datadog.api.client.v2.model.ProductAnalyticsJourneyAudienceAccountQuery; +import com.datadog.api.client.v2.model.ProductAnalyticsJourneyAudienceFilters; +import com.datadog.api.client.v2.model.ProductAnalyticsJourneyAudienceSegmentQuery; +import com.datadog.api.client.v2.model.ProductAnalyticsJourneyAudienceUserQuery; +import com.datadog.api.client.v2.model.ProductAnalyticsJourneyComputedColumn; +import com.datadog.api.client.v2.model.ProductAnalyticsJourneyComputedColumnName; +import com.datadog.api.client.v2.model.ProductAnalyticsJourneyConversionType; +import com.datadog.api.client.v2.model.ProductAnalyticsJourneyListQuery; +import com.datadog.api.client.v2.model.ProductAnalyticsJourneyListRequest; +import com.datadog.api.client.v2.model.ProductAnalyticsJourneyListRequestAttributes; +import com.datadog.api.client.v2.model.ProductAnalyticsJourneyListRequestData; +import com.datadog.api.client.v2.model.ProductAnalyticsJourneyListRequestType; +import com.datadog.api.client.v2.model.ProductAnalyticsJourneyListResponse; +import com.datadog.api.client.v2.model.ProductAnalyticsJourneyListSort; +import com.datadog.api.client.v2.model.ProductAnalyticsJourneyNodeTarget; +import com.datadog.api.client.v2.model.ProductAnalyticsJourneyNodeTargetType; +import com.datadog.api.client.v2.model.ProductAnalyticsJourneySearch; +import com.datadog.api.client.v2.model.ProductAnalyticsJourneySearchFilters; +import com.datadog.api.client.v2.model.ProductAnalyticsJourneySearchGraphFilter; +import com.datadog.api.client.v2.model.ProductAnalyticsJourneySearchGraphFilterName; +import com.datadog.api.client.v2.model.ProductAnalyticsJourneySearchGraphFilterOperator; +import com.datadog.api.client.v2.model.ProductAnalyticsJourneyTarget; +import com.datadog.api.client.v2.model.QuerySortOrder; +import java.util.Collections; +import java.util.Map; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.queryProductAnalyticsJourneyList", true); + ProductAnalyticsApi apiInstance = new ProductAnalyticsApi(defaultClient); + + ProductAnalyticsJourneyListRequest body = + new ProductAnalyticsJourneyListRequest() + .data( + new ProductAnalyticsJourneyListRequestData() + .attributes( + new ProductAnalyticsJourneyListRequestAttributes() + .from(1756425600000L) + .query( + new ProductAnalyticsJourneyListQuery() + .computedColumns( + Collections.singletonList( + new ProductAnalyticsJourneyComputedColumn() + .name( + ProductAnalyticsJourneyComputedColumnName + .FIRST_CONVERSION_TIMESTAMPS))) + .conversionType( + ProductAnalyticsJourneyConversionType.CONVERSION) + .groupBy( + Collections.singletonList( + new ProductAnalyticsGraphQueryGroupBy() + .facet("@geo.country") + .shouldExcludeMissing(false) + .sort( + new ProductAnalyticsGroupBySort() + .aggregation("count") + .order(QuerySortOrder.DESC)) + .source( + ProductAnalyticsGraphQueryGroupBySource.USERS) + .target( + new ProductAnalyticsJourneyTarget( + new ProductAnalyticsJourneyNodeTarget() + .type( + ProductAnalyticsJourneyNodeTargetType + .NODE) + .value("A"))))) + .search( + new ProductAnalyticsJourneySearch() + .expression("A -> B") + .filters( + new ProductAnalyticsJourneySearchFilters() + .audienceFilters( + new ProductAnalyticsJourneyAudienceFilters() + .accounts( + Collections.singletonList( + new ProductAnalyticsJourneyAudienceAccountQuery() + .name( + "enterprise_accounts"))) + .formula( + "power_users AND NOT trial_segment") + .segments( + Collections.singletonList( + new ProductAnalyticsJourneyAudienceSegmentQuery() + .name("trial_segment") + .segmentId( + "00000000-0000-0000-0000-000000000000"))) + .users( + Collections.singletonList( + new ProductAnalyticsJourneyAudienceUserQuery() + .name("power_users")))) + .graphFilters( + Collections.singletonList( + new ProductAnalyticsJourneySearchGraphFilter() + .name( + ProductAnalyticsJourneySearchGraphFilterName + .TIME_TO_CONVERT) + .operator( + ProductAnalyticsJourneySearchGraphFilterOperator + .LESS_THAN_OR_EQUAL) + .target( + new ProductAnalyticsJourneyTarget( + new ProductAnalyticsJourneyNodeTarget() + .type( + ProductAnalyticsJourneyNodeTargetType + .NODE) + .value("A"))) + .value(60000L)))) + .joinKeys( + new ProductAnalyticsJoinKeys() + .primary("@session.id")) + .nodeObjects( + Map.ofEntries( + Map.entry( + "A", + new ProductAnalyticsBaseQuery( + new ProductAnalyticsEventQuery() + .dataSource( + ProductAnalyticsEventQueryDataSource + .PRODUCT_ANALYTICS) + .search( + new ProductAnalyticsEventSearch() + .query( + "@type:view" + + " @view.name:Login")))), + Map.entry( + "B", + new ProductAnalyticsBaseQuery( + new ProductAnalyticsEventQuery() + .dataSource( + ProductAnalyticsEventQueryDataSource + .PRODUCT_ANALYTICS) + .search( + new ProductAnalyticsEventSearch() + .query( + "@type:action" + + " @action.target.name:Submit"))))))) + .sort( + new ProductAnalyticsJourneyListSort() + .order(QuerySortOrder.DESC)) + .target( + new ProductAnalyticsJourneyTarget( + new ProductAnalyticsJourneyNodeTarget() + .type(ProductAnalyticsJourneyNodeTargetType.NODE) + .value("A")))) + .to(1756857600000L)) + .type(ProductAnalyticsJourneyListRequestType.JOURNEY_LIST_REQUEST)); + + try { + ProductAnalyticsJourneyListResponse result = + apiInstance.queryProductAnalyticsJourneyList(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling ProductAnalyticsApi#queryProductAnalyticsJourneyList"); + 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/QueryProductAnalyticsJourneyScalar.java b/examples/v2/product-analytics/QueryProductAnalyticsJourneyScalar.java new file mode 100644 index 00000000000..7fa827755a6 --- /dev/null +++ b/examples/v2/product-analytics/QueryProductAnalyticsJourneyScalar.java @@ -0,0 +1,166 @@ +// Compute journey 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.ProductAnalyticsBaseQuery; +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.ProductAnalyticsFormulaJourneyRequestType; +import com.datadog.api.client.v2.model.ProductAnalyticsGraphQueryGroupBy; +import com.datadog.api.client.v2.model.ProductAnalyticsGraphQueryGroupBySource; +import com.datadog.api.client.v2.model.ProductAnalyticsGroupBySort; +import com.datadog.api.client.v2.model.ProductAnalyticsJoinKeys; +import com.datadog.api.client.v2.model.ProductAnalyticsJourneyAudienceAccountQuery; +import com.datadog.api.client.v2.model.ProductAnalyticsJourneyAudienceFilters; +import com.datadog.api.client.v2.model.ProductAnalyticsJourneyAudienceSegmentQuery; +import com.datadog.api.client.v2.model.ProductAnalyticsJourneyAudienceUserQuery; +import com.datadog.api.client.v2.model.ProductAnalyticsJourneyNodeTarget; +import com.datadog.api.client.v2.model.ProductAnalyticsJourneyNodeTargetType; +import com.datadog.api.client.v2.model.ProductAnalyticsJourneyScalarCompute; +import com.datadog.api.client.v2.model.ProductAnalyticsJourneyScalarQuery; +import com.datadog.api.client.v2.model.ProductAnalyticsJourneyScalarRequest; +import com.datadog.api.client.v2.model.ProductAnalyticsJourneyScalarRequestAttributes; +import com.datadog.api.client.v2.model.ProductAnalyticsJourneyScalarRequestData; +import com.datadog.api.client.v2.model.ProductAnalyticsJourneyScalarResponse; +import com.datadog.api.client.v2.model.ProductAnalyticsJourneySearch; +import com.datadog.api.client.v2.model.ProductAnalyticsJourneySearchFilters; +import com.datadog.api.client.v2.model.ProductAnalyticsJourneySearchGraphFilter; +import com.datadog.api.client.v2.model.ProductAnalyticsJourneySearchGraphFilterName; +import com.datadog.api.client.v2.model.ProductAnalyticsJourneySearchGraphFilterOperator; +import com.datadog.api.client.v2.model.ProductAnalyticsJourneyTarget; +import com.datadog.api.client.v2.model.QuerySortOrder; +import java.util.Collections; +import java.util.Map; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.queryProductAnalyticsJourneyScalar", true); + ProductAnalyticsApi apiInstance = new ProductAnalyticsApi(defaultClient); + + ProductAnalyticsJourneyScalarRequest body = + new ProductAnalyticsJourneyScalarRequest() + .data( + new ProductAnalyticsJourneyScalarRequestData() + .attributes( + new ProductAnalyticsJourneyScalarRequestAttributes() + .from(1756425600000L) + .query( + new ProductAnalyticsJourneyScalarQuery() + .compute( + new ProductAnalyticsJourneyScalarCompute() + .aggregation("count") + .target( + new ProductAnalyticsJourneyTarget( + new ProductAnalyticsJourneyNodeTarget() + .type( + ProductAnalyticsJourneyNodeTargetType + .NODE) + .value("A")))) + .groupBy( + Collections.singletonList( + new ProductAnalyticsGraphQueryGroupBy() + .facet("@geo.country") + .shouldExcludeMissing(false) + .sort( + new ProductAnalyticsGroupBySort() + .aggregation("count") + .order(QuerySortOrder.DESC)) + .source( + ProductAnalyticsGraphQueryGroupBySource.USERS) + .target( + new ProductAnalyticsJourneyTarget( + new ProductAnalyticsJourneyNodeTarget() + .type( + ProductAnalyticsJourneyNodeTargetType + .NODE) + .value("A"))))) + .search( + new ProductAnalyticsJourneySearch() + .expression("A -> B") + .filters( + new ProductAnalyticsJourneySearchFilters() + .audienceFilters( + new ProductAnalyticsJourneyAudienceFilters() + .accounts( + Collections.singletonList( + new ProductAnalyticsJourneyAudienceAccountQuery() + .name( + "enterprise_accounts"))) + .formula( + "power_users AND NOT trial_segment") + .segments( + Collections.singletonList( + new ProductAnalyticsJourneyAudienceSegmentQuery() + .name("trial_segment") + .segmentId( + "00000000-0000-0000-0000-000000000000"))) + .users( + Collections.singletonList( + new ProductAnalyticsJourneyAudienceUserQuery() + .name("power_users")))) + .graphFilters( + Collections.singletonList( + new ProductAnalyticsJourneySearchGraphFilter() + .name( + ProductAnalyticsJourneySearchGraphFilterName + .TIME_TO_CONVERT) + .operator( + ProductAnalyticsJourneySearchGraphFilterOperator + .LESS_THAN_OR_EQUAL) + .target( + new ProductAnalyticsJourneyTarget( + new ProductAnalyticsJourneyNodeTarget() + .type( + ProductAnalyticsJourneyNodeTargetType + .NODE) + .value("A"))) + .value(60000L)))) + .joinKeys( + new ProductAnalyticsJoinKeys() + .primary("@session.id")) + .nodeObjects( + Map.ofEntries( + Map.entry( + "A", + new ProductAnalyticsBaseQuery( + new ProductAnalyticsEventQuery() + .dataSource( + ProductAnalyticsEventQueryDataSource + .PRODUCT_ANALYTICS) + .search( + new ProductAnalyticsEventSearch() + .query( + "@type:view" + + " @view.name:Login")))), + Map.entry( + "B", + new ProductAnalyticsBaseQuery( + new ProductAnalyticsEventQuery() + .dataSource( + ProductAnalyticsEventQueryDataSource + .PRODUCT_ANALYTICS) + .search( + new ProductAnalyticsEventSearch() + .query( + "@type:action" + + " @action.target.name:Submit")))))))) + .to(1756857600000L)) + .type(ProductAnalyticsFormulaJourneyRequestType.FORMULA_JOURNEY_REQUEST)); + + try { + ProductAnalyticsJourneyScalarResponse result = + apiInstance.queryProductAnalyticsJourneyScalar(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling ProductAnalyticsApi#queryProductAnalyticsJourneyScalar"); + 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/QueryProductAnalyticsJourneyTimeseries.java b/examples/v2/product-analytics/QueryProductAnalyticsJourneyTimeseries.java new file mode 100644 index 00000000000..82dce4d768a --- /dev/null +++ b/examples/v2/product-analytics/QueryProductAnalyticsJourneyTimeseries.java @@ -0,0 +1,166 @@ +// Compute journey 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.ProductAnalyticsBaseQuery; +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.ProductAnalyticsFormulaJourneyQuery; +import com.datadog.api.client.v2.model.ProductAnalyticsFormulaJourneyRequest; +import com.datadog.api.client.v2.model.ProductAnalyticsFormulaJourneyRequestAttributes; +import com.datadog.api.client.v2.model.ProductAnalyticsFormulaJourneyRequestData; +import com.datadog.api.client.v2.model.ProductAnalyticsFormulaJourneyRequestType; +import com.datadog.api.client.v2.model.ProductAnalyticsGraphQueryCompute; +import com.datadog.api.client.v2.model.ProductAnalyticsGraphQueryGroupBy; +import com.datadog.api.client.v2.model.ProductAnalyticsGraphQueryGroupBySource; +import com.datadog.api.client.v2.model.ProductAnalyticsGroupBySort; +import com.datadog.api.client.v2.model.ProductAnalyticsJoinKeys; +import com.datadog.api.client.v2.model.ProductAnalyticsJourneyAudienceAccountQuery; +import com.datadog.api.client.v2.model.ProductAnalyticsJourneyAudienceFilters; +import com.datadog.api.client.v2.model.ProductAnalyticsJourneyAudienceSegmentQuery; +import com.datadog.api.client.v2.model.ProductAnalyticsJourneyAudienceUserQuery; +import com.datadog.api.client.v2.model.ProductAnalyticsJourneyNodeTarget; +import com.datadog.api.client.v2.model.ProductAnalyticsJourneyNodeTargetType; +import com.datadog.api.client.v2.model.ProductAnalyticsJourneySearch; +import com.datadog.api.client.v2.model.ProductAnalyticsJourneySearchFilters; +import com.datadog.api.client.v2.model.ProductAnalyticsJourneySearchGraphFilter; +import com.datadog.api.client.v2.model.ProductAnalyticsJourneySearchGraphFilterName; +import com.datadog.api.client.v2.model.ProductAnalyticsJourneySearchGraphFilterOperator; +import com.datadog.api.client.v2.model.ProductAnalyticsJourneyTarget; +import com.datadog.api.client.v2.model.ProductAnalyticsJourneyTimeseriesResponse; +import com.datadog.api.client.v2.model.QuerySortOrder; +import java.util.Collections; +import java.util.Map; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.queryProductAnalyticsJourneyTimeseries", true); + ProductAnalyticsApi apiInstance = new ProductAnalyticsApi(defaultClient); + + ProductAnalyticsFormulaJourneyRequest body = + new ProductAnalyticsFormulaJourneyRequest() + .data( + new ProductAnalyticsFormulaJourneyRequestData() + .attributes( + new ProductAnalyticsFormulaJourneyRequestAttributes() + .from(1756425600000L) + .query( + new ProductAnalyticsFormulaJourneyQuery() + .compute( + new ProductAnalyticsGraphQueryCompute() + .aggregation("count") + .target( + new ProductAnalyticsJourneyTarget( + new ProductAnalyticsJourneyNodeTarget() + .type( + ProductAnalyticsJourneyNodeTargetType + .NODE) + .value("A")))) + .groupBy( + Collections.singletonList( + new ProductAnalyticsGraphQueryGroupBy() + .facet("@geo.country") + .shouldExcludeMissing(false) + .sort( + new ProductAnalyticsGroupBySort() + .aggregation("count") + .order(QuerySortOrder.DESC)) + .source( + ProductAnalyticsGraphQueryGroupBySource.USERS) + .target( + new ProductAnalyticsJourneyTarget( + new ProductAnalyticsJourneyNodeTarget() + .type( + ProductAnalyticsJourneyNodeTargetType + .NODE) + .value("A"))))) + .search( + new ProductAnalyticsJourneySearch() + .expression("A -> B") + .filters( + new ProductAnalyticsJourneySearchFilters() + .audienceFilters( + new ProductAnalyticsJourneyAudienceFilters() + .accounts( + Collections.singletonList( + new ProductAnalyticsJourneyAudienceAccountQuery() + .name( + "enterprise_accounts"))) + .formula( + "power_users AND NOT trial_segment") + .segments( + Collections.singletonList( + new ProductAnalyticsJourneyAudienceSegmentQuery() + .name("trial_segment") + .segmentId( + "00000000-0000-0000-0000-000000000000"))) + .users( + Collections.singletonList( + new ProductAnalyticsJourneyAudienceUserQuery() + .name("power_users")))) + .graphFilters( + Collections.singletonList( + new ProductAnalyticsJourneySearchGraphFilter() + .name( + ProductAnalyticsJourneySearchGraphFilterName + .TIME_TO_CONVERT) + .operator( + ProductAnalyticsJourneySearchGraphFilterOperator + .LESS_THAN_OR_EQUAL) + .target( + new ProductAnalyticsJourneyTarget( + new ProductAnalyticsJourneyNodeTarget() + .type( + ProductAnalyticsJourneyNodeTargetType + .NODE) + .value("A"))) + .value(60000L)))) + .joinKeys( + new ProductAnalyticsJoinKeys() + .primary("@session.id")) + .nodeObjects( + Map.ofEntries( + Map.entry( + "A", + new ProductAnalyticsBaseQuery( + new ProductAnalyticsEventQuery() + .dataSource( + ProductAnalyticsEventQueryDataSource + .PRODUCT_ANALYTICS) + .search( + new ProductAnalyticsEventSearch() + .query( + "@type:view" + + " @view.name:Login")))), + Map.entry( + "B", + new ProductAnalyticsBaseQuery( + new ProductAnalyticsEventQuery() + .dataSource( + ProductAnalyticsEventQueryDataSource + .PRODUCT_ANALYTICS) + .search( + new ProductAnalyticsEventSearch() + .query( + "@type:action" + + " @action.target.name:Submit")))))))) + .to(1756857600000L)) + .type(ProductAnalyticsFormulaJourneyRequestType.FORMULA_JOURNEY_REQUEST)); + + try { + ProductAnalyticsJourneyTimeseriesResponse result = + apiInstance.queryProductAnalyticsJourneyTimeseries(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling ProductAnalyticsApi#queryProductAnalyticsJourneyTimeseries"); + 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/QueryProductAnalyticsList.java b/examples/v2/product-analytics/QueryProductAnalyticsList.java new file mode 100644 index 00000000000..50f73b57493 --- /dev/null +++ b/examples/v2/product-analytics/QueryProductAnalyticsList.java @@ -0,0 +1,60 @@ +// List analytics events 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.ProductAnalyticsAnalyticsListQuery; +import com.datadog.api.client.v2.model.ProductAnalyticsAnalyticsListRequest; +import com.datadog.api.client.v2.model.ProductAnalyticsAnalyticsListRequestAttributes; +import com.datadog.api.client.v2.model.ProductAnalyticsAnalyticsListRequestData; +import com.datadog.api.client.v2.model.ProductAnalyticsAnalyticsListRequestType; +import com.datadog.api.client.v2.model.ProductAnalyticsAnalyticsListResponse; +import com.datadog.api.client.v2.model.ProductAnalyticsBaseQuery; +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 java.util.Collections; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.queryProductAnalyticsList", true); + ProductAnalyticsApi apiInstance = new ProductAnalyticsApi(defaultClient); + + ProductAnalyticsAnalyticsListRequest body = + new ProductAnalyticsAnalyticsListRequest() + .data( + new ProductAnalyticsAnalyticsListRequestData() + .attributes( + new ProductAnalyticsAnalyticsListRequestAttributes() + .from(1771232048460L) + .query( + new ProductAnalyticsAnalyticsListQuery() + .columns(Collections.singletonList("@view.name")) + .limit(100L) + .query( + new ProductAnalyticsBaseQuery( + new ProductAnalyticsEventQuery() + .dataSource( + ProductAnalyticsEventQueryDataSource + .PRODUCT_ANALYTICS) + .search( + new ProductAnalyticsEventSearch() + .query("@type:view"))))) + .to(1771836848262L)) + .type( + ProductAnalyticsAnalyticsListRequestType + .FORMULA_ANALYTICS_EXTENDED_LIST_REQUEST)); + + try { + ProductAnalyticsAnalyticsListResponse result = apiInstance.queryProductAnalyticsList(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ProductAnalyticsApi#queryProductAnalyticsList"); + 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/QueryProductAnalyticsRetentionGrid.java b/examples/v2/product-analytics/QueryProductAnalyticsRetentionGrid.java new file mode 100644 index 00000000000..e2ff8bc5abc --- /dev/null +++ b/examples/v2/product-analytics/QueryProductAnalyticsRetentionGrid.java @@ -0,0 +1,187 @@ +// Compute a retention grid 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.ProductAnalyticsAudienceAccountSubquery; +import com.datadog.api.client.v2.model.ProductAnalyticsAudienceFilters; +import com.datadog.api.client.v2.model.ProductAnalyticsAudienceSegmentSubquery; +import com.datadog.api.client.v2.model.ProductAnalyticsAudienceUserSubquery; +import com.datadog.api.client.v2.model.ProductAnalyticsBaseQuery; +import com.datadog.api.client.v2.model.ProductAnalyticsCalendarInterval; +import com.datadog.api.client.v2.model.ProductAnalyticsCalendarIntervalType; +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.ProductAnalyticsGroupBySort; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionCalendarTimeInterval; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionCalendarTimeIntervalType; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionCohortCriteria; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionCohortScope; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionCohortScopeType; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionCohortTarget; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionCompute; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionComputeMetric; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionEntity; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionFilters; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionGridQuery; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionGridRequest; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionGridRequestAttributes; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionGridRequestData; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionGridRequestType; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionGridResponse; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionGroupBy; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionGroupByTarget; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionIndexTarget; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionIndexTargetType; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionReturnCondition; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionReturnCriteria; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionScope; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionSearch; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionTimeInterval; +import com.datadog.api.client.v2.model.QuerySortOrder; +import java.util.Collections; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.queryProductAnalyticsRetentionGrid", true); + ProductAnalyticsApi apiInstance = new ProductAnalyticsApi(defaultClient); + + ProductAnalyticsRetentionGridRequest body = + new ProductAnalyticsRetentionGridRequest() + .data( + new ProductAnalyticsRetentionGridRequestData() + .attributes( + new ProductAnalyticsRetentionGridRequestAttributes() + .excludeAnonymousTraffic(false) + .from(1756425600000L) + .query( + new ProductAnalyticsRetentionGridQuery() + .computationScope( + new ProductAnalyticsRetentionScope( + new ProductAnalyticsRetentionCohortScope() + .target( + new ProductAnalyticsRetentionCohortTarget( + new ProductAnalyticsRetentionIndexTarget() + .type( + ProductAnalyticsRetentionIndexTargetType + .INDEX) + .value(0L))) + .type( + ProductAnalyticsRetentionCohortScopeType + .COHORT))) + .compute( + new ProductAnalyticsRetentionCompute() + .aggregation("count") + .metric( + ProductAnalyticsRetentionComputeMetric + .RETENTION_RATE)) + .groupBy( + Collections.singletonList( + new ProductAnalyticsRetentionGroupBy() + .facet("@geo.country") + .limit(10L) + .shouldExcludeMissing(false) + .sort( + new ProductAnalyticsGroupBySort() + .aggregation("count") + .order(QuerySortOrder.DESC)) + .target( + ProductAnalyticsRetentionGroupByTarget.COHORT))) + .search( + new ProductAnalyticsRetentionSearch() + .cohortCriteria( + new ProductAnalyticsRetentionCohortCriteria() + .baseQuery( + new ProductAnalyticsBaseQuery( + new ProductAnalyticsEventQuery() + .dataSource( + ProductAnalyticsEventQueryDataSource + .PRODUCT_ANALYTICS) + .search( + new ProductAnalyticsEventSearch() + .query("@type:view")))) + .timeInterval( + new ProductAnalyticsRetentionTimeInterval( + new ProductAnalyticsRetentionCalendarTimeInterval() + .type( + ProductAnalyticsRetentionCalendarTimeIntervalType + .CALENDAR) + .value( + new ProductAnalyticsCalendarInterval() + .alignment("monday") + .quantity(1L) + .timezone("UTC") + .type( + ProductAnalyticsCalendarIntervalType + .WEEK))))) + .filters( + new ProductAnalyticsRetentionFilters() + .audienceFilters( + new ProductAnalyticsAudienceFilters() + .accounts( + Collections.singletonList( + new ProductAnalyticsAudienceAccountSubquery() + .name(""))) + .formula("u") + .segments( + Collections.singletonList( + new ProductAnalyticsAudienceSegmentSubquery() + .name("") + .segmentId( + UUID.fromString( + "00000000-0000-0000-0000-000000000000")))) + .users( + Collections.singletonList( + new ProductAnalyticsAudienceUserSubquery() + .name("u") + .query("*"))))) + .retentionEntity( + ProductAnalyticsRetentionEntity.USER_ID) + .returnCondition( + ProductAnalyticsRetentionReturnCondition + .CONVERSION_ON_OR_AFTER) + .returnCriteria( + new ProductAnalyticsRetentionReturnCriteria() + .baseQuery( + new ProductAnalyticsBaseQuery( + new ProductAnalyticsEventQuery() + .dataSource( + ProductAnalyticsEventQueryDataSource + .PRODUCT_ANALYTICS) + .search( + new ProductAnalyticsEventSearch() + .query("@type:view")))) + .timeInterval( + new ProductAnalyticsRetentionTimeInterval( + new ProductAnalyticsRetentionCalendarTimeInterval() + .type( + ProductAnalyticsRetentionCalendarTimeIntervalType + .CALENDAR) + .value( + new ProductAnalyticsCalendarInterval() + .alignment("monday") + .quantity(1L) + .timezone("UTC") + .type( + ProductAnalyticsCalendarIntervalType + .WEEK))))))) + .to(1756857600000L)) + .type(ProductAnalyticsRetentionGridRequestType.RETENTION_GRID_REQUEST)); + + try { + ProductAnalyticsRetentionGridResponse result = + apiInstance.queryProductAnalyticsRetentionGrid(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling ProductAnalyticsApi#queryProductAnalyticsRetentionGrid"); + 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/QueryProductAnalyticsRetentionList.java b/examples/v2/product-analytics/QueryProductAnalyticsRetentionList.java new file mode 100644 index 00000000000..1f56f10f6b5 --- /dev/null +++ b/examples/v2/product-analytics/QueryProductAnalyticsRetentionList.java @@ -0,0 +1,173 @@ +// List the entities behind a retention cell 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.ProductAnalyticsAudienceAccountSubquery; +import com.datadog.api.client.v2.model.ProductAnalyticsAudienceFilters; +import com.datadog.api.client.v2.model.ProductAnalyticsAudienceSegmentSubquery; +import com.datadog.api.client.v2.model.ProductAnalyticsAudienceUserSubquery; +import com.datadog.api.client.v2.model.ProductAnalyticsBaseQuery; +import com.datadog.api.client.v2.model.ProductAnalyticsCalendarInterval; +import com.datadog.api.client.v2.model.ProductAnalyticsCalendarIntervalType; +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.ProductAnalyticsRetentionCalendarTimeInterval; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionCalendarTimeIntervalType; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionCellScope; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionCellScopeType; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionCohortCriteria; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionCohortTarget; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionEntity; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionFilters; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionIndexTarget; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionIndexTargetType; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionListColumn; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionListColumnField; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionListQuery; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionListRequest; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionListRequestAttributes; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionListRequestData; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionListRequestType; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionListResponse; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionReturnCondition; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionReturnCriteria; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionSearch; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionTimeInterval; +import java.util.Collections; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.queryProductAnalyticsRetentionList", true); + ProductAnalyticsApi apiInstance = new ProductAnalyticsApi(defaultClient); + + ProductAnalyticsRetentionListRequest body = + new ProductAnalyticsRetentionListRequest() + .data( + new ProductAnalyticsRetentionListRequestData() + .attributes( + new ProductAnalyticsRetentionListRequestAttributes() + .from(1756425600000L) + .query( + new ProductAnalyticsRetentionListQuery() + .columns( + Collections.singletonList( + new ProductAnalyticsRetentionListColumn() + .field( + new ProductAnalyticsRetentionListColumnField() + .path("@usr.email")))) + .computationScope( + new ProductAnalyticsRetentionCellScope() + .cohortTarget( + new ProductAnalyticsRetentionCohortTarget( + new ProductAnalyticsRetentionIndexTarget() + .type( + ProductAnalyticsRetentionIndexTargetType + .INDEX) + .value(0L))) + .returnPeriodTarget( + new ProductAnalyticsRetentionIndexTarget() + .type( + ProductAnalyticsRetentionIndexTargetType + .INDEX) + .value(0L)) + .type(ProductAnalyticsRetentionCellScopeType.CELL)) + .limit(100L) + .search( + new ProductAnalyticsRetentionSearch() + .cohortCriteria( + new ProductAnalyticsRetentionCohortCriteria() + .baseQuery( + new ProductAnalyticsBaseQuery( + new ProductAnalyticsEventQuery() + .dataSource( + ProductAnalyticsEventQueryDataSource + .PRODUCT_ANALYTICS) + .search( + new ProductAnalyticsEventSearch() + .query("@type:view")))) + .timeInterval( + new ProductAnalyticsRetentionTimeInterval( + new ProductAnalyticsRetentionCalendarTimeInterval() + .type( + ProductAnalyticsRetentionCalendarTimeIntervalType + .CALENDAR) + .value( + new ProductAnalyticsCalendarInterval() + .alignment("monday") + .quantity(1L) + .timezone("UTC") + .type( + ProductAnalyticsCalendarIntervalType + .WEEK))))) + .filters( + new ProductAnalyticsRetentionFilters() + .audienceFilters( + new ProductAnalyticsAudienceFilters() + .accounts( + Collections.singletonList( + new ProductAnalyticsAudienceAccountSubquery() + .name(""))) + .formula("u") + .segments( + Collections.singletonList( + new ProductAnalyticsAudienceSegmentSubquery() + .name("") + .segmentId( + UUID.fromString( + "00000000-0000-0000-0000-000000000000")))) + .users( + Collections.singletonList( + new ProductAnalyticsAudienceUserSubquery() + .name("u") + .query("*"))))) + .retentionEntity( + ProductAnalyticsRetentionEntity.USER_ID) + .returnCondition( + ProductAnalyticsRetentionReturnCondition + .CONVERSION_ON_OR_AFTER) + .returnCriteria( + new ProductAnalyticsRetentionReturnCriteria() + .baseQuery( + new ProductAnalyticsBaseQuery( + new ProductAnalyticsEventQuery() + .dataSource( + ProductAnalyticsEventQueryDataSource + .PRODUCT_ANALYTICS) + .search( + new ProductAnalyticsEventSearch() + .query("@type:view")))) + .timeInterval( + new ProductAnalyticsRetentionTimeInterval( + new ProductAnalyticsRetentionCalendarTimeInterval() + .type( + ProductAnalyticsRetentionCalendarTimeIntervalType + .CALENDAR) + .value( + new ProductAnalyticsCalendarInterval() + .alignment("monday") + .quantity(1L) + .timezone("UTC") + .type( + ProductAnalyticsCalendarIntervalType + .WEEK))))))) + .to(1756857600000L)) + .type(ProductAnalyticsRetentionListRequestType.RETENTION_LIST_REQUEST)); + + try { + ProductAnalyticsRetentionListResponse result = + apiInstance.queryProductAnalyticsRetentionList(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling ProductAnalyticsApi#queryProductAnalyticsRetentionList"); + 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/QueryProductAnalyticsRetentionScalar.java b/examples/v2/product-analytics/QueryProductAnalyticsRetentionScalar.java new file mode 100644 index 00000000000..2c63b62d2ea --- /dev/null +++ b/examples/v2/product-analytics/QueryProductAnalyticsRetentionScalar.java @@ -0,0 +1,187 @@ +// Compute retention scalar values 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.ProductAnalyticsAudienceAccountSubquery; +import com.datadog.api.client.v2.model.ProductAnalyticsAudienceFilters; +import com.datadog.api.client.v2.model.ProductAnalyticsAudienceSegmentSubquery; +import com.datadog.api.client.v2.model.ProductAnalyticsAudienceUserSubquery; +import com.datadog.api.client.v2.model.ProductAnalyticsBaseQuery; +import com.datadog.api.client.v2.model.ProductAnalyticsCalendarInterval; +import com.datadog.api.client.v2.model.ProductAnalyticsCalendarIntervalType; +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.ProductAnalyticsFormulaRetentionQuery; +import com.datadog.api.client.v2.model.ProductAnalyticsFormulaRetentionRequest; +import com.datadog.api.client.v2.model.ProductAnalyticsFormulaRetentionRequestAttributes; +import com.datadog.api.client.v2.model.ProductAnalyticsFormulaRetentionRequestData; +import com.datadog.api.client.v2.model.ProductAnalyticsFormulaRetentionRequestType; +import com.datadog.api.client.v2.model.ProductAnalyticsGroupBySort; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionCalendarTimeInterval; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionCalendarTimeIntervalType; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionCohortCriteria; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionCohortScope; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionCohortScopeType; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionCohortTarget; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionCompute; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionComputeMetric; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionEntity; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionFilters; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionGroupBy; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionGroupByTarget; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionIndexTarget; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionIndexTargetType; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionReturnCondition; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionReturnCriteria; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionScope; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionSearch; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionTimeInterval; +import com.datadog.api.client.v2.model.ProductAnalyticsScalarResponse; +import com.datadog.api.client.v2.model.QuerySortOrder; +import java.util.Collections; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.queryProductAnalyticsRetentionScalar", true); + ProductAnalyticsApi apiInstance = new ProductAnalyticsApi(defaultClient); + + ProductAnalyticsFormulaRetentionRequest body = + new ProductAnalyticsFormulaRetentionRequest() + .data( + new ProductAnalyticsFormulaRetentionRequestData() + .attributes( + new ProductAnalyticsFormulaRetentionRequestAttributes() + .excludeAnonymousTraffic(false) + .from(1756425600000L) + .query( + new ProductAnalyticsFormulaRetentionQuery() + .computationScope( + new ProductAnalyticsRetentionScope( + new ProductAnalyticsRetentionCohortScope() + .target( + new ProductAnalyticsRetentionCohortTarget( + new ProductAnalyticsRetentionIndexTarget() + .type( + ProductAnalyticsRetentionIndexTargetType + .INDEX) + .value(0L))) + .type( + ProductAnalyticsRetentionCohortScopeType + .COHORT))) + .compute( + new ProductAnalyticsRetentionCompute() + .aggregation("count") + .metric( + ProductAnalyticsRetentionComputeMetric + .RETENTION_RATE)) + .groupBy( + Collections.singletonList( + new ProductAnalyticsRetentionGroupBy() + .facet("@geo.country") + .limit(10L) + .shouldExcludeMissing(false) + .sort( + new ProductAnalyticsGroupBySort() + .aggregation("count") + .order(QuerySortOrder.DESC)) + .target( + ProductAnalyticsRetentionGroupByTarget.COHORT))) + .search( + new ProductAnalyticsRetentionSearch() + .cohortCriteria( + new ProductAnalyticsRetentionCohortCriteria() + .baseQuery( + new ProductAnalyticsBaseQuery( + new ProductAnalyticsEventQuery() + .dataSource( + ProductAnalyticsEventQueryDataSource + .PRODUCT_ANALYTICS) + .search( + new ProductAnalyticsEventSearch() + .query("@type:view")))) + .timeInterval( + new ProductAnalyticsRetentionTimeInterval( + new ProductAnalyticsRetentionCalendarTimeInterval() + .type( + ProductAnalyticsRetentionCalendarTimeIntervalType + .CALENDAR) + .value( + new ProductAnalyticsCalendarInterval() + .alignment("monday") + .quantity(1L) + .timezone("UTC") + .type( + ProductAnalyticsCalendarIntervalType + .WEEK))))) + .filters( + new ProductAnalyticsRetentionFilters() + .audienceFilters( + new ProductAnalyticsAudienceFilters() + .accounts( + Collections.singletonList( + new ProductAnalyticsAudienceAccountSubquery() + .name(""))) + .formula("u") + .segments( + Collections.singletonList( + new ProductAnalyticsAudienceSegmentSubquery() + .name("") + .segmentId( + UUID.fromString( + "00000000-0000-0000-0000-000000000000")))) + .users( + Collections.singletonList( + new ProductAnalyticsAudienceUserSubquery() + .name("u") + .query("*"))))) + .retentionEntity( + ProductAnalyticsRetentionEntity.USER_ID) + .returnCondition( + ProductAnalyticsRetentionReturnCondition + .CONVERSION_ON_OR_AFTER) + .returnCriteria( + new ProductAnalyticsRetentionReturnCriteria() + .baseQuery( + new ProductAnalyticsBaseQuery( + new ProductAnalyticsEventQuery() + .dataSource( + ProductAnalyticsEventQueryDataSource + .PRODUCT_ANALYTICS) + .search( + new ProductAnalyticsEventSearch() + .query("@type:view")))) + .timeInterval( + new ProductAnalyticsRetentionTimeInterval( + new ProductAnalyticsRetentionCalendarTimeInterval() + .type( + ProductAnalyticsRetentionCalendarTimeIntervalType + .CALENDAR) + .value( + new ProductAnalyticsCalendarInterval() + .alignment("monday") + .quantity(1L) + .timezone("UTC") + .type( + ProductAnalyticsCalendarIntervalType + .WEEK))))))) + .to(1756857600000L)) + .type(ProductAnalyticsFormulaRetentionRequestType.FORMULA_RETENTION_REQUEST)); + + try { + ProductAnalyticsScalarResponse result = + apiInstance.queryProductAnalyticsRetentionScalar(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling ProductAnalyticsApi#queryProductAnalyticsRetentionScalar"); + 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/QueryProductAnalyticsRetentionTimeseries.java b/examples/v2/product-analytics/QueryProductAnalyticsRetentionTimeseries.java new file mode 100644 index 00000000000..e69e32722d9 --- /dev/null +++ b/examples/v2/product-analytics/QueryProductAnalyticsRetentionTimeseries.java @@ -0,0 +1,187 @@ +// Compute retention timeseries 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.ProductAnalyticsAudienceAccountSubquery; +import com.datadog.api.client.v2.model.ProductAnalyticsAudienceFilters; +import com.datadog.api.client.v2.model.ProductAnalyticsAudienceSegmentSubquery; +import com.datadog.api.client.v2.model.ProductAnalyticsAudienceUserSubquery; +import com.datadog.api.client.v2.model.ProductAnalyticsBaseQuery; +import com.datadog.api.client.v2.model.ProductAnalyticsCalendarInterval; +import com.datadog.api.client.v2.model.ProductAnalyticsCalendarIntervalType; +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.ProductAnalyticsFormulaRetentionQuery; +import com.datadog.api.client.v2.model.ProductAnalyticsFormulaRetentionRequest; +import com.datadog.api.client.v2.model.ProductAnalyticsFormulaRetentionRequestAttributes; +import com.datadog.api.client.v2.model.ProductAnalyticsFormulaRetentionRequestData; +import com.datadog.api.client.v2.model.ProductAnalyticsFormulaRetentionRequestType; +import com.datadog.api.client.v2.model.ProductAnalyticsGroupBySort; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionCalendarTimeInterval; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionCalendarTimeIntervalType; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionCohortCriteria; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionCohortScope; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionCohortScopeType; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionCohortTarget; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionCompute; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionComputeMetric; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionEntity; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionFilters; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionGroupBy; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionGroupByTarget; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionIndexTarget; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionIndexTargetType; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionReturnCondition; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionReturnCriteria; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionScope; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionSearch; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionTimeInterval; +import com.datadog.api.client.v2.model.ProductAnalyticsTimeseriesResponse; +import com.datadog.api.client.v2.model.QuerySortOrder; +import java.util.Collections; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.queryProductAnalyticsRetentionTimeseries", true); + ProductAnalyticsApi apiInstance = new ProductAnalyticsApi(defaultClient); + + ProductAnalyticsFormulaRetentionRequest body = + new ProductAnalyticsFormulaRetentionRequest() + .data( + new ProductAnalyticsFormulaRetentionRequestData() + .attributes( + new ProductAnalyticsFormulaRetentionRequestAttributes() + .excludeAnonymousTraffic(false) + .from(1756425600000L) + .query( + new ProductAnalyticsFormulaRetentionQuery() + .computationScope( + new ProductAnalyticsRetentionScope( + new ProductAnalyticsRetentionCohortScope() + .target( + new ProductAnalyticsRetentionCohortTarget( + new ProductAnalyticsRetentionIndexTarget() + .type( + ProductAnalyticsRetentionIndexTargetType + .INDEX) + .value(0L))) + .type( + ProductAnalyticsRetentionCohortScopeType + .COHORT))) + .compute( + new ProductAnalyticsRetentionCompute() + .aggregation("count") + .metric( + ProductAnalyticsRetentionComputeMetric + .RETENTION_RATE)) + .groupBy( + Collections.singletonList( + new ProductAnalyticsRetentionGroupBy() + .facet("@geo.country") + .limit(10L) + .shouldExcludeMissing(false) + .sort( + new ProductAnalyticsGroupBySort() + .aggregation("count") + .order(QuerySortOrder.DESC)) + .target( + ProductAnalyticsRetentionGroupByTarget.COHORT))) + .search( + new ProductAnalyticsRetentionSearch() + .cohortCriteria( + new ProductAnalyticsRetentionCohortCriteria() + .baseQuery( + new ProductAnalyticsBaseQuery( + new ProductAnalyticsEventQuery() + .dataSource( + ProductAnalyticsEventQueryDataSource + .PRODUCT_ANALYTICS) + .search( + new ProductAnalyticsEventSearch() + .query("@type:view")))) + .timeInterval( + new ProductAnalyticsRetentionTimeInterval( + new ProductAnalyticsRetentionCalendarTimeInterval() + .type( + ProductAnalyticsRetentionCalendarTimeIntervalType + .CALENDAR) + .value( + new ProductAnalyticsCalendarInterval() + .alignment("monday") + .quantity(1L) + .timezone("UTC") + .type( + ProductAnalyticsCalendarIntervalType + .WEEK))))) + .filters( + new ProductAnalyticsRetentionFilters() + .audienceFilters( + new ProductAnalyticsAudienceFilters() + .accounts( + Collections.singletonList( + new ProductAnalyticsAudienceAccountSubquery() + .name(""))) + .formula("u") + .segments( + Collections.singletonList( + new ProductAnalyticsAudienceSegmentSubquery() + .name("") + .segmentId( + UUID.fromString( + "00000000-0000-0000-0000-000000000000")))) + .users( + Collections.singletonList( + new ProductAnalyticsAudienceUserSubquery() + .name("u") + .query("*"))))) + .retentionEntity( + ProductAnalyticsRetentionEntity.USER_ID) + .returnCondition( + ProductAnalyticsRetentionReturnCondition + .CONVERSION_ON_OR_AFTER) + .returnCriteria( + new ProductAnalyticsRetentionReturnCriteria() + .baseQuery( + new ProductAnalyticsBaseQuery( + new ProductAnalyticsEventQuery() + .dataSource( + ProductAnalyticsEventQueryDataSource + .PRODUCT_ANALYTICS) + .search( + new ProductAnalyticsEventSearch() + .query("@type:view")))) + .timeInterval( + new ProductAnalyticsRetentionTimeInterval( + new ProductAnalyticsRetentionCalendarTimeInterval() + .type( + ProductAnalyticsRetentionCalendarTimeIntervalType + .CALENDAR) + .value( + new ProductAnalyticsCalendarInterval() + .alignment("monday") + .quantity(1L) + .timezone("UTC") + .type( + ProductAnalyticsCalendarIntervalType + .WEEK))))))) + .to(1756857600000L)) + .type(ProductAnalyticsFormulaRetentionRequestType.FORMULA_RETENTION_REQUEST)); + + try { + ProductAnalyticsTimeseriesResponse result = + apiInstance.queryProductAnalyticsRetentionTimeseries(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling ProductAnalyticsApi#queryProductAnalyticsRetentionTimeseries"); + 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/QueryProductAnalyticsSankey.java b/examples/v2/product-analytics/QueryProductAnalyticsSankey.java new file mode 100644 index 00000000000..e08a5784859 --- /dev/null +++ b/examples/v2/product-analytics/QueryProductAnalyticsSankey.java @@ -0,0 +1,80 @@ +// Compute a Sankey diagram 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.ProductAnalyticsAudienceAccountSubquery; +import com.datadog.api.client.v2.model.ProductAnalyticsAudienceFilters; +import com.datadog.api.client.v2.model.ProductAnalyticsAudienceSegmentSubquery; +import com.datadog.api.client.v2.model.ProductAnalyticsAudienceUserSubquery; +import com.datadog.api.client.v2.model.ProductAnalyticsJoinKeys; +import com.datadog.api.client.v2.model.ProductAnalyticsSankeyDefinition; +import com.datadog.api.client.v2.model.ProductAnalyticsSankeyRequest; +import com.datadog.api.client.v2.model.ProductAnalyticsSankeyRequestAttributes; +import com.datadog.api.client.v2.model.ProductAnalyticsSankeyRequestData; +import com.datadog.api.client.v2.model.ProductAnalyticsSankeyRequestType; +import com.datadog.api.client.v2.model.ProductAnalyticsSankeyResponse; +import com.datadog.api.client.v2.model.ProductAnalyticsSankeySearch; +import com.datadog.api.client.v2.model.ProductAnalyticsSankeyTime; +import java.util.Collections; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.queryProductAnalyticsSankey", true); + ProductAnalyticsApi apiInstance = new ProductAnalyticsApi(defaultClient); + + ProductAnalyticsSankeyRequest body = + new ProductAnalyticsSankeyRequest() + .data( + new ProductAnalyticsSankeyRequestData() + .attributes( + new ProductAnalyticsSankeyRequestAttributes() + .definition( + new ProductAnalyticsSankeyDefinition() + .entriesPerStep(10L) + .numberOfSteps(3L) + .source("@view.name") + .target("@view.name")) + .search( + new ProductAnalyticsSankeySearch() + .audienceFilters( + new ProductAnalyticsAudienceFilters() + .accounts( + Collections.singletonList( + new ProductAnalyticsAudienceAccountSubquery() + .name(""))) + .formula("u") + .segments( + Collections.singletonList( + new ProductAnalyticsAudienceSegmentSubquery() + .name("") + .segmentId( + UUID.fromString( + "00000000-0000-0000-0000-000000000000")))) + .users( + Collections.singletonList( + new ProductAnalyticsAudienceUserSubquery() + .name("u") + .query("*")))) + .joinKeys(new ProductAnalyticsJoinKeys().primary("@session.id")) + .query("@type:view")) + .time( + new ProductAnalyticsSankeyTime() + .from(1756425600000L) + .to(1756857600000L))) + .type(ProductAnalyticsSankeyRequestType.SANKEY_REQUEST)); + + try { + ProductAnalyticsSankeyResponse result = apiInstance.queryProductAnalyticsSankey(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ProductAnalyticsApi#queryProductAnalyticsSankey"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/datadog/api/client/ApiClient.java b/src/main/java/com/datadog/api/client/ApiClient.java index 8b5e75a262b..d228169286c 100644 --- a/src/main/java/com/datadog/api/client/ApiClient.java +++ b/src/main/java/com/datadog/api/client/ApiClient.java @@ -1306,6 +1306,16 @@ public class ApiClient { put("v2.updateOrgGroupPolicy", false); put("v2.updateOrgGroupPolicyOverride", false); put("v2.listRoleTemplates", false); + put("v2.queryProductAnalyticsJourneyFunnel", false); + put("v2.queryProductAnalyticsJourneyList", false); + put("v2.queryProductAnalyticsJourneyScalar", false); + put("v2.queryProductAnalyticsJourneyTimeseries", false); + put("v2.queryProductAnalyticsList", false); + put("v2.queryProductAnalyticsRetentionGrid", false); + put("v2.queryProductAnalyticsRetentionList", false); + put("v2.queryProductAnalyticsRetentionScalar", false); + put("v2.queryProductAnalyticsRetentionTimeseries", false); + put("v2.queryProductAnalyticsSankey", false); put("v2.createConnection", false); put("v2.deleteConnection", false); put("v2.getAccountFacetInfo", false); 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 d0c712b8895..0066257d8e4 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,24 @@ 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.ProductAnalyticsAnalyticsListRequest; +import com.datadog.api.client.v2.model.ProductAnalyticsAnalyticsListResponse; import com.datadog.api.client.v2.model.ProductAnalyticsAnalyticsRequest; +import com.datadog.api.client.v2.model.ProductAnalyticsFormulaJourneyRequest; +import com.datadog.api.client.v2.model.ProductAnalyticsFormulaRetentionRequest; +import com.datadog.api.client.v2.model.ProductAnalyticsJourneyFunnelRequest; +import com.datadog.api.client.v2.model.ProductAnalyticsJourneyFunnelResponse; +import com.datadog.api.client.v2.model.ProductAnalyticsJourneyListRequest; +import com.datadog.api.client.v2.model.ProductAnalyticsJourneyListResponse; +import com.datadog.api.client.v2.model.ProductAnalyticsJourneyScalarRequest; +import com.datadog.api.client.v2.model.ProductAnalyticsJourneyScalarResponse; +import com.datadog.api.client.v2.model.ProductAnalyticsJourneyTimeseriesResponse; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionGridRequest; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionGridResponse; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionListRequest; +import com.datadog.api.client.v2.model.ProductAnalyticsRetentionListResponse; +import com.datadog.api.client.v2.model.ProductAnalyticsSankeyRequest; +import com.datadog.api.client.v2.model.ProductAnalyticsSankeyResponse; import com.datadog.api.client.v2.model.ProductAnalyticsScalarResponse; import com.datadog.api.client.v2.model.ProductAnalyticsServerSideEventItem; import com.datadog.api.client.v2.model.ProductAnalyticsTimeseriesResponse; @@ -46,6 +63,1592 @@ public void setApiClient(ApiClient apiClient) { this.apiClient = apiClient; } + /** + * Compute journey funnel analysis. + * + *

See {@link #queryProductAnalyticsJourneyFunnelWithHttpInfo}. + * + * @param body (required) + * @return ProductAnalyticsJourneyFunnelResponse + * @throws ApiException if fails to make API call + */ + public ProductAnalyticsJourneyFunnelResponse queryProductAnalyticsJourneyFunnel( + ProductAnalyticsJourneyFunnelRequest body) throws ApiException { + return queryProductAnalyticsJourneyFunnelWithHttpInfo(body).getData(); + } + + /** + * Compute journey funnel analysis. + * + *

See {@link #queryProductAnalyticsJourneyFunnelWithHttpInfoAsync}. + * + * @param body (required) + * @return CompletableFuture<ProductAnalyticsJourneyFunnelResponse> + */ + public CompletableFuture + queryProductAnalyticsJourneyFunnelAsync(ProductAnalyticsJourneyFunnelRequest body) { + return queryProductAnalyticsJourneyFunnelWithHttpInfoAsync(body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Compute a funnel over an ordered sequence of Product Analytics events. Returns the per-step + * conversion counts, conversion rates, and elapsed times, optionally segmented by group-by + * facets. + * + * @param body (required) + * @return ApiResponse<ProductAnalyticsJourneyFunnelResponse> + * @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 + queryProductAnalyticsJourneyFunnelWithHttpInfo(ProductAnalyticsJourneyFunnelRequest body) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "queryProductAnalyticsJourneyFunnel"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, + "Missing the required parameter 'body' when calling queryProductAnalyticsJourneyFunnel"); + } + // create path and map variables + String localVarPath = "/api/v2/product-analytics/journey/funnel"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.ProductAnalyticsApi.queryProductAnalyticsJourneyFunnel", + 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 journey funnel analysis. + * + *

See {@link #queryProductAnalyticsJourneyFunnelWithHttpInfo}. + * + * @param body (required) + * @return CompletableFuture<ApiResponse<ProductAnalyticsJourneyFunnelResponse>> + */ + public CompletableFuture> + queryProductAnalyticsJourneyFunnelWithHttpInfoAsync( + ProductAnalyticsJourneyFunnelRequest body) { + // Check if unstable operation is enabled + String operationId = "queryProductAnalyticsJourneyFunnel"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = 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" + + " queryProductAnalyticsJourneyFunnel")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/product-analytics/journey/funnel"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.ProductAnalyticsApi.queryProductAnalyticsJourneyFunnel", + 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() {}); + } + + /** + * List journey entities. + * + *

See {@link #queryProductAnalyticsJourneyListWithHttpInfo}. + * + * @param body (required) + * @return ProductAnalyticsJourneyListResponse + * @throws ApiException if fails to make API call + */ + public ProductAnalyticsJourneyListResponse queryProductAnalyticsJourneyList( + ProductAnalyticsJourneyListRequest body) throws ApiException { + return queryProductAnalyticsJourneyListWithHttpInfo(body).getData(); + } + + /** + * List journey entities. + * + *

See {@link #queryProductAnalyticsJourneyListWithHttpInfoAsync}. + * + * @param body (required) + * @return CompletableFuture<ProductAnalyticsJourneyListResponse> + */ + public CompletableFuture + queryProductAnalyticsJourneyListAsync(ProductAnalyticsJourneyListRequest body) { + return queryProductAnalyticsJourneyListWithHttpInfoAsync(body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Return the individual sessions that reached, or dropped off at, a given step of the journey. + * Each row contains the identity join key, the event timestamp, and the columns requested in + * entity_columns. + * + * @param body (required) + * @return ApiResponse<ProductAnalyticsJourneyListResponse> + * @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 + queryProductAnalyticsJourneyListWithHttpInfo(ProductAnalyticsJourneyListRequest body) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "queryProductAnalyticsJourneyList"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, + "Missing the required parameter 'body' when calling queryProductAnalyticsJourneyList"); + } + // create path and map variables + String localVarPath = "/api/v2/product-analytics/journey/list"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.ProductAnalyticsApi.queryProductAnalyticsJourneyList", + 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() {}); + } + + /** + * List journey entities. + * + *

See {@link #queryProductAnalyticsJourneyListWithHttpInfo}. + * + * @param body (required) + * @return CompletableFuture<ApiResponse<ProductAnalyticsJourneyListResponse>> + */ + public CompletableFuture> + queryProductAnalyticsJourneyListWithHttpInfoAsync(ProductAnalyticsJourneyListRequest body) { + // Check if unstable operation is enabled + String operationId = "queryProductAnalyticsJourneyList"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = 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" + + " queryProductAnalyticsJourneyList")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/product-analytics/journey/list"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.ProductAnalyticsApi.queryProductAnalyticsJourneyList", + 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 journey scalar analytics. + * + *

See {@link #queryProductAnalyticsJourneyScalarWithHttpInfo}. + * + * @param body (required) + * @return ProductAnalyticsJourneyScalarResponse + * @throws ApiException if fails to make API call + */ + public ProductAnalyticsJourneyScalarResponse queryProductAnalyticsJourneyScalar( + ProductAnalyticsJourneyScalarRequest body) throws ApiException { + return queryProductAnalyticsJourneyScalarWithHttpInfo(body).getData(); + } + + /** + * Compute journey scalar analytics. + * + *

See {@link #queryProductAnalyticsJourneyScalarWithHttpInfoAsync}. + * + * @param body (required) + * @return CompletableFuture<ProductAnalyticsJourneyScalarResponse> + */ + public CompletableFuture + queryProductAnalyticsJourneyScalarAsync(ProductAnalyticsJourneyScalarRequest body) { + return queryProductAnalyticsJourneyScalarWithHttpInfoAsync(body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Compute scalar results for a journey query, such as the conversion count, the conversion rate, + * or the time to convert, optionally segmented by group-by facets. + * + * @param body (required) + * @return ApiResponse<ProductAnalyticsJourneyScalarResponse> + * @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 + queryProductAnalyticsJourneyScalarWithHttpInfo(ProductAnalyticsJourneyScalarRequest body) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "queryProductAnalyticsJourneyScalar"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, + "Missing the required parameter 'body' when calling queryProductAnalyticsJourneyScalar"); + } + // create path and map variables + String localVarPath = "/api/v2/product-analytics/journey/scalar"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.ProductAnalyticsApi.queryProductAnalyticsJourneyScalar", + 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 journey scalar analytics. + * + *

See {@link #queryProductAnalyticsJourneyScalarWithHttpInfo}. + * + * @param body (required) + * @return CompletableFuture<ApiResponse<ProductAnalyticsJourneyScalarResponse>> + */ + public CompletableFuture> + queryProductAnalyticsJourneyScalarWithHttpInfoAsync( + ProductAnalyticsJourneyScalarRequest body) { + // Check if unstable operation is enabled + String operationId = "queryProductAnalyticsJourneyScalar"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = 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" + + " queryProductAnalyticsJourneyScalar")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/product-analytics/journey/scalar"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.ProductAnalyticsApi.queryProductAnalyticsJourneyScalar", + 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 journey timeseries analytics. + * + *

See {@link #queryProductAnalyticsJourneyTimeseriesWithHttpInfo}. + * + * @param body (required) + * @return ProductAnalyticsJourneyTimeseriesResponse + * @throws ApiException if fails to make API call + */ + public ProductAnalyticsJourneyTimeseriesResponse queryProductAnalyticsJourneyTimeseries( + ProductAnalyticsFormulaJourneyRequest body) throws ApiException { + return queryProductAnalyticsJourneyTimeseriesWithHttpInfo(body).getData(); + } + + /** + * Compute journey timeseries analytics. + * + *

See {@link #queryProductAnalyticsJourneyTimeseriesWithHttpInfoAsync}. + * + * @param body (required) + * @return CompletableFuture<ProductAnalyticsJourneyTimeseriesResponse> + */ + public CompletableFuture + queryProductAnalyticsJourneyTimeseriesAsync(ProductAnalyticsFormulaJourneyRequest body) { + return queryProductAnalyticsJourneyTimeseriesWithHttpInfoAsync(body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Compute timeseries results for a journey query. Returns one series per group-by combination, + * bucketed by the requested interval. + * + * @param body (required) + * @return ApiResponse<ProductAnalyticsJourneyTimeseriesResponse> + * @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 + queryProductAnalyticsJourneyTimeseriesWithHttpInfo(ProductAnalyticsFormulaJourneyRequest body) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "queryProductAnalyticsJourneyTimeseries"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, + "Missing the required parameter 'body' when calling" + + " queryProductAnalyticsJourneyTimeseries"); + } + // create path and map variables + String localVarPath = "/api/v2/product-analytics/journey/timeseries"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.ProductAnalyticsApi.queryProductAnalyticsJourneyTimeseries", + 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 journey timeseries analytics. + * + *

See {@link #queryProductAnalyticsJourneyTimeseriesWithHttpInfo}. + * + * @param body (required) + * @return CompletableFuture<ApiResponse<ProductAnalyticsJourneyTimeseriesResponse>> + */ + public CompletableFuture> + queryProductAnalyticsJourneyTimeseriesWithHttpInfoAsync( + ProductAnalyticsFormulaJourneyRequest body) { + // Check if unstable operation is enabled + String operationId = "queryProductAnalyticsJourneyTimeseries"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = 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" + + " queryProductAnalyticsJourneyTimeseries")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/product-analytics/journey/timeseries"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.ProductAnalyticsApi.queryProductAnalyticsJourneyTimeseries", + 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() {}); + } + + /** + * List analytics events. + * + *

See {@link #queryProductAnalyticsListWithHttpInfo}. + * + * @param body (required) + * @return ProductAnalyticsAnalyticsListResponse + * @throws ApiException if fails to make API call + */ + public ProductAnalyticsAnalyticsListResponse queryProductAnalyticsList( + ProductAnalyticsAnalyticsListRequest body) throws ApiException { + return queryProductAnalyticsListWithHttpInfo(body).getData(); + } + + /** + * List analytics events. + * + *

See {@link #queryProductAnalyticsListWithHttpInfoAsync}. + * + * @param body (required) + * @return CompletableFuture<ProductAnalyticsAnalyticsListResponse> + */ + public CompletableFuture queryProductAnalyticsListAsync( + ProductAnalyticsAnalyticsListRequest body) { + return queryProductAnalyticsListWithHttpInfoAsync(body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * List the individual event records matching an analytics query. Use columns to + * choose the attributes returned on each row, sort to order the rows, and + * limit to cap how many are returned. + * + * @param body (required) + * @return ApiResponse<ProductAnalyticsAnalyticsListResponse> + * @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 queryProductAnalyticsListWithHttpInfo( + ProductAnalyticsAnalyticsListRequest body) throws ApiException { + // Check if unstable operation is enabled + String operationId = "queryProductAnalyticsList"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling queryProductAnalyticsList"); + } + // create path and map variables + String localVarPath = "/api/v2/product-analytics/analytics/list"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.ProductAnalyticsApi.queryProductAnalyticsList", + 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() {}); + } + + /** + * List analytics events. + * + *

See {@link #queryProductAnalyticsListWithHttpInfo}. + * + * @param body (required) + * @return CompletableFuture<ApiResponse<ProductAnalyticsAnalyticsListResponse>> + */ + public CompletableFuture> + queryProductAnalyticsListWithHttpInfoAsync(ProductAnalyticsAnalyticsListRequest body) { + // Check if unstable operation is enabled + String operationId = "queryProductAnalyticsList"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = 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 queryProductAnalyticsList")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/product-analytics/analytics/list"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.ProductAnalyticsApi.queryProductAnalyticsList", + 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 a retention grid. + * + *

See {@link #queryProductAnalyticsRetentionGridWithHttpInfo}. + * + * @param body The retention grid query. (required) + * @return ProductAnalyticsRetentionGridResponse + * @throws ApiException if fails to make API call + */ + public ProductAnalyticsRetentionGridResponse queryProductAnalyticsRetentionGrid( + ProductAnalyticsRetentionGridRequest body) throws ApiException { + return queryProductAnalyticsRetentionGridWithHttpInfo(body).getData(); + } + + /** + * Compute a retention grid. + * + *

See {@link #queryProductAnalyticsRetentionGridWithHttpInfoAsync}. + * + * @param body The retention grid query. (required) + * @return CompletableFuture<ProductAnalyticsRetentionGridResponse> + */ + public CompletableFuture + queryProductAnalyticsRetentionGridAsync(ProductAnalyticsRetentionGridRequest body) { + return queryProductAnalyticsRetentionGridWithHttpInfoAsync(body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Compute a retention grid, showing how much of each cohort came back over each subsequent + * period. Rows are cohorts, columns are return periods, and each cell holds the count and rate of + * entities that returned. + * + * @param body The retention grid query. (required) + * @return ApiResponse<ProductAnalyticsRetentionGridResponse> + * @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 + queryProductAnalyticsRetentionGridWithHttpInfo(ProductAnalyticsRetentionGridRequest body) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "queryProductAnalyticsRetentionGrid"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, + "Missing the required parameter 'body' when calling queryProductAnalyticsRetentionGrid"); + } + // create path and map variables + String localVarPath = "/api/v2/product-analytics/retention/grid"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.ProductAnalyticsApi.queryProductAnalyticsRetentionGrid", + 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 a retention grid. + * + *

See {@link #queryProductAnalyticsRetentionGridWithHttpInfo}. + * + * @param body The retention grid query. (required) + * @return CompletableFuture<ApiResponse<ProductAnalyticsRetentionGridResponse>> + */ + public CompletableFuture> + queryProductAnalyticsRetentionGridWithHttpInfoAsync( + ProductAnalyticsRetentionGridRequest body) { + // Check if unstable operation is enabled + String operationId = "queryProductAnalyticsRetentionGrid"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = 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" + + " queryProductAnalyticsRetentionGrid")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/product-analytics/retention/grid"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.ProductAnalyticsApi.queryProductAnalyticsRetentionGrid", + 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() {}); + } + + /** + * List the entities behind a retention cell. + * + *

See {@link #queryProductAnalyticsRetentionListWithHttpInfo}. + * + * @param body The retention list query. (required) + * @return ProductAnalyticsRetentionListResponse + * @throws ApiException if fails to make API call + */ + public ProductAnalyticsRetentionListResponse queryProductAnalyticsRetentionList( + ProductAnalyticsRetentionListRequest body) throws ApiException { + return queryProductAnalyticsRetentionListWithHttpInfo(body).getData(); + } + + /** + * List the entities behind a retention cell. + * + *

See {@link #queryProductAnalyticsRetentionListWithHttpInfoAsync}. + * + * @param body The retention list query. (required) + * @return CompletableFuture<ProductAnalyticsRetentionListResponse> + */ + public CompletableFuture + queryProductAnalyticsRetentionListAsync(ProductAnalyticsRetentionListRequest body) { + return queryProductAnalyticsRetentionListWithHttpInfoAsync(body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * List the individual users or accounts counted in one cell of the retention grid. Set + * computation_scope to the cohort and return period you want to examine. + * + * @param body The retention list query. (required) + * @return ApiResponse<ProductAnalyticsRetentionListResponse> + * @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 + queryProductAnalyticsRetentionListWithHttpInfo(ProductAnalyticsRetentionListRequest body) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "queryProductAnalyticsRetentionList"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, + "Missing the required parameter 'body' when calling queryProductAnalyticsRetentionList"); + } + // create path and map variables + String localVarPath = "/api/v2/product-analytics/retention/list"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.ProductAnalyticsApi.queryProductAnalyticsRetentionList", + 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() {}); + } + + /** + * List the entities behind a retention cell. + * + *

See {@link #queryProductAnalyticsRetentionListWithHttpInfo}. + * + * @param body The retention list query. (required) + * @return CompletableFuture<ApiResponse<ProductAnalyticsRetentionListResponse>> + */ + public CompletableFuture> + queryProductAnalyticsRetentionListWithHttpInfoAsync( + ProductAnalyticsRetentionListRequest body) { + // Check if unstable operation is enabled + String operationId = "queryProductAnalyticsRetentionList"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = 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" + + " queryProductAnalyticsRetentionList")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/product-analytics/retention/list"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.ProductAnalyticsApi.queryProductAnalyticsRetentionList", + 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 retention scalar values. + * + *

See {@link #queryProductAnalyticsRetentionScalarWithHttpInfo}. + * + * @param body The retention scalar query. (required) + * @return ProductAnalyticsScalarResponse + * @throws ApiException if fails to make API call + */ + public ProductAnalyticsScalarResponse queryProductAnalyticsRetentionScalar( + ProductAnalyticsFormulaRetentionRequest body) throws ApiException { + return queryProductAnalyticsRetentionScalarWithHttpInfo(body).getData(); + } + + /** + * Compute retention scalar values. + * + *

See {@link #queryProductAnalyticsRetentionScalarWithHttpInfoAsync}. + * + * @param body The retention scalar query. (required) + * @return CompletableFuture<ProductAnalyticsScalarResponse> + */ + public CompletableFuture + queryProductAnalyticsRetentionScalarAsync(ProductAnalyticsFormulaRetentionRequest body) { + return queryProductAnalyticsRetentionScalarWithHttpInfoAsync(body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Compute retention as a single value per group, suitable for a query value or top list widget. + * + * @param body The retention scalar query. (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 + queryProductAnalyticsRetentionScalarWithHttpInfo(ProductAnalyticsFormulaRetentionRequest body) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "queryProductAnalyticsRetentionScalar"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, + "Missing the required parameter 'body' when calling" + + " queryProductAnalyticsRetentionScalar"); + } + // create path and map variables + String localVarPath = "/api/v2/product-analytics/retention/scalar"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.ProductAnalyticsApi.queryProductAnalyticsRetentionScalar", + 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 retention scalar values. + * + *

See {@link #queryProductAnalyticsRetentionScalarWithHttpInfo}. + * + * @param body The retention scalar query. (required) + * @return CompletableFuture<ApiResponse<ProductAnalyticsScalarResponse>> + */ + public CompletableFuture> + queryProductAnalyticsRetentionScalarWithHttpInfoAsync( + ProductAnalyticsFormulaRetentionRequest body) { + // Check if unstable operation is enabled + String operationId = "queryProductAnalyticsRetentionScalar"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = 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" + + " queryProductAnalyticsRetentionScalar")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/product-analytics/retention/scalar"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.ProductAnalyticsApi.queryProductAnalyticsRetentionScalar", + 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 retention timeseries. + * + *

See {@link #queryProductAnalyticsRetentionTimeseriesWithHttpInfo}. + * + * @param body The retention timeseries query. (required) + * @return ProductAnalyticsTimeseriesResponse + * @throws ApiException if fails to make API call + */ + public ProductAnalyticsTimeseriesResponse queryProductAnalyticsRetentionTimeseries( + ProductAnalyticsFormulaRetentionRequest body) throws ApiException { + return queryProductAnalyticsRetentionTimeseriesWithHttpInfo(body).getData(); + } + + /** + * Compute retention timeseries. + * + *

See {@link #queryProductAnalyticsRetentionTimeseriesWithHttpInfoAsync}. + * + * @param body The retention timeseries query. (required) + * @return CompletableFuture<ProductAnalyticsTimeseriesResponse> + */ + public CompletableFuture + queryProductAnalyticsRetentionTimeseriesAsync(ProductAnalyticsFormulaRetentionRequest body) { + return queryProductAnalyticsRetentionTimeseriesWithHttpInfoAsync(body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Compute retention as a series of values over time, using the same query definition as the + * retention grid. + * + * @param body The retention timeseries query. (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 + queryProductAnalyticsRetentionTimeseriesWithHttpInfo( + ProductAnalyticsFormulaRetentionRequest body) throws ApiException { + // Check if unstable operation is enabled + String operationId = "queryProductAnalyticsRetentionTimeseries"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, + "Missing the required parameter 'body' when calling" + + " queryProductAnalyticsRetentionTimeseries"); + } + // create path and map variables + String localVarPath = "/api/v2/product-analytics/retention/timeseries"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.ProductAnalyticsApi.queryProductAnalyticsRetentionTimeseries", + 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 retention timeseries. + * + *

See {@link #queryProductAnalyticsRetentionTimeseriesWithHttpInfo}. + * + * @param body The retention timeseries query. (required) + * @return CompletableFuture<ApiResponse<ProductAnalyticsTimeseriesResponse>> + */ + public CompletableFuture> + queryProductAnalyticsRetentionTimeseriesWithHttpInfoAsync( + ProductAnalyticsFormulaRetentionRequest body) { + // Check if unstable operation is enabled + String operationId = "queryProductAnalyticsRetentionTimeseries"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = 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" + + " queryProductAnalyticsRetentionTimeseries")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/product-analytics/retention/timeseries"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.ProductAnalyticsApi.queryProductAnalyticsRetentionTimeseries", + 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 a Sankey diagram. + * + *

See {@link #queryProductAnalyticsSankeyWithHttpInfo}. + * + * @param body The Sankey diagram query. (required) + * @return ProductAnalyticsSankeyResponse + * @throws ApiException if fails to make API call + */ + public ProductAnalyticsSankeyResponse queryProductAnalyticsSankey( + ProductAnalyticsSankeyRequest body) throws ApiException { + return queryProductAnalyticsSankeyWithHttpInfo(body).getData(); + } + + /** + * Compute a Sankey diagram. + * + *

See {@link #queryProductAnalyticsSankeyWithHttpInfoAsync}. + * + * @param body The Sankey diagram query. (required) + * @return CompletableFuture<ProductAnalyticsSankeyResponse> + */ + public CompletableFuture queryProductAnalyticsSankeyAsync( + ProductAnalyticsSankeyRequest body) { + return queryProductAnalyticsSankeyWithHttpInfoAsync(body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Compute a Sankey diagram of how sessions flow between the values of two facets, showing where + * users continue and where they drop off at each step. + * + * @param body The Sankey diagram query. (required) + * @return ApiResponse<ProductAnalyticsSankeyResponse> + * @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 queryProductAnalyticsSankeyWithHttpInfo( + ProductAnalyticsSankeyRequest body) throws ApiException { + // Check if unstable operation is enabled + String operationId = "queryProductAnalyticsSankey"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling queryProductAnalyticsSankey"); + } + // create path and map variables + String localVarPath = "/api/v2/product-analytics/sankey"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.ProductAnalyticsApi.queryProductAnalyticsSankey", + 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 a Sankey diagram. + * + *

See {@link #queryProductAnalyticsSankeyWithHttpInfo}. + * + * @param body The Sankey diagram query. (required) + * @return CompletableFuture<ApiResponse<ProductAnalyticsSankeyResponse>> + */ + public CompletableFuture> + queryProductAnalyticsSankeyWithHttpInfoAsync(ProductAnalyticsSankeyRequest body) { + // Check if unstable operation is enabled + String operationId = "queryProductAnalyticsSankey"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = 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 queryProductAnalyticsSankey")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/product-analytics/sankey"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.ProductAnalyticsApi.queryProductAnalyticsSankey", + 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 scalar analytics. * diff --git a/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsAnalyticsListQuery.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsAnalyticsListQuery.java new file mode 100644 index 00000000000..8bee5924e2c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsAnalyticsListQuery.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 list query definition. It selects the events to return with query, + * then chooses the columns on each event row, the sort applied to those rows, and a row limit. + * Unlike the scalar and timeseries queries, a list query returns raw event rows rather than + * aggregates, so it takes no compute or group-by rule. + */ +@JsonPropertyOrder({ + ProductAnalyticsAnalyticsListQuery.JSON_PROPERTY_AUDIENCE_FILTERS, + ProductAnalyticsAnalyticsListQuery.JSON_PROPERTY_COLUMNS, + ProductAnalyticsAnalyticsListQuery.JSON_PROPERTY_LIMIT, + ProductAnalyticsAnalyticsListQuery.JSON_PROPERTY_QUERY, + ProductAnalyticsAnalyticsListQuery.JSON_PROPERTY_SORT +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsAnalyticsListQuery { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_AUDIENCE_FILTERS = "audience_filters"; + private ProductAnalyticsAudienceFilters audienceFilters; + + public static final String JSON_PROPERTY_COLUMNS = "columns"; + private List columns = null; + + public static final String JSON_PROPERTY_LIMIT = "limit"; + private Long limit; + + public static final String JSON_PROPERTY_QUERY = "query"; + private ProductAnalyticsBaseQuery query; + + public static final String JSON_PROPERTY_SORT = "sort"; + private ProductAnalyticsAnalyticsListSort sort; + + public ProductAnalyticsAnalyticsListQuery() {} + + @JsonCreator + public ProductAnalyticsAnalyticsListQuery( + @JsonProperty(required = true, value = JSON_PROPERTY_QUERY) ProductAnalyticsBaseQuery query) { + this.query = query; + this.unparsed |= query.unparsed; + } + + public ProductAnalyticsAnalyticsListQuery 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; + if (audienceFilters != null) { + this.unparsed |= audienceFilters.unparsed; + } + } + + public ProductAnalyticsAnalyticsListQuery columns(List columns) { + this.columns = columns; + return this; + } + + public ProductAnalyticsAnalyticsListQuery addColumnsItem(String columnsItem) { + if (this.columns == null) { + this.columns = new ArrayList<>(); + } + this.columns.add(columnsItem); + return this; + } + + /** + * Attribute columns to include in each event row. + * + * @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; + } + + public ProductAnalyticsAnalyticsListQuery limit(Long limit) { + this.limit = limit; + return this; + } + + /** + * Maximum number of event rows to return. minimum: 1 maximum: 1000 + * + * @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 ProductAnalyticsAnalyticsListQuery 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; + if (query != null) { + this.unparsed |= query.unparsed; + } + } + + public ProductAnalyticsAnalyticsListQuery sort(ProductAnalyticsAnalyticsListSort sort) { + this.sort = sort; + this.unparsed |= sort.unparsed; + return this; + } + + /** + * The sort applied to the returned event rows. + * + * @return sort + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SORT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ProductAnalyticsAnalyticsListSort getSort() { + return sort; + } + + public void setSort(ProductAnalyticsAnalyticsListSort sort) { + this.sort = sort; + if (sort != null) { + this.unparsed |= sort.unparsed; + } + } + + /** + * 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 ProductAnalyticsAnalyticsListQuery + */ + @JsonAnySetter + public ProductAnalyticsAnalyticsListQuery 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 ProductAnalyticsAnalyticsListQuery object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsAnalyticsListQuery productAnalyticsAnalyticsListQuery = + (ProductAnalyticsAnalyticsListQuery) o; + return Objects.equals(this.audienceFilters, productAnalyticsAnalyticsListQuery.audienceFilters) + && Objects.equals(this.columns, productAnalyticsAnalyticsListQuery.columns) + && Objects.equals(this.limit, productAnalyticsAnalyticsListQuery.limit) + && Objects.equals(this.query, productAnalyticsAnalyticsListQuery.query) + && Objects.equals(this.sort, productAnalyticsAnalyticsListQuery.sort) + && Objects.equals( + this.additionalProperties, productAnalyticsAnalyticsListQuery.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(audienceFilters, columns, limit, query, sort, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsAnalyticsListQuery {\n"); + sb.append(" audienceFilters: ").append(toIndentedString(audienceFilters)).append("\n"); + sb.append(" columns: ").append(toIndentedString(columns)).append("\n"); + sb.append(" limit: ").append(toIndentedString(limit)).append("\n"); + sb.append(" query: ").append(toIndentedString(query)).append("\n"); + sb.append(" sort: ").append(toIndentedString(sort)).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/ProductAnalyticsAnalyticsListRequest.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsAnalyticsListRequest.java new file mode 100644 index 00000000000..7aed173e52b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsAnalyticsListRequest.java @@ -0,0 +1,151 @@ +/* + * 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 listing the individual event records matching an analytics query. */ +@JsonPropertyOrder({ProductAnalyticsAnalyticsListRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsAnalyticsListRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private ProductAnalyticsAnalyticsListRequestData data; + + public ProductAnalyticsAnalyticsListRequest() {} + + @JsonCreator + public ProductAnalyticsAnalyticsListRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + ProductAnalyticsAnalyticsListRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public ProductAnalyticsAnalyticsListRequest data(ProductAnalyticsAnalyticsListRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data object for an analytics list request. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsAnalyticsListRequestData getData() { + return data; + } + + public void setData(ProductAnalyticsAnalyticsListRequestData data) { + this.data = data; + if (data != null) { + this.unparsed |= data.unparsed; + } + } + + /** + * 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 ProductAnalyticsAnalyticsListRequest + */ + @JsonAnySetter + public ProductAnalyticsAnalyticsListRequest 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 ProductAnalyticsAnalyticsListRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsAnalyticsListRequest productAnalyticsAnalyticsListRequest = + (ProductAnalyticsAnalyticsListRequest) o; + return Objects.equals(this.data, productAnalyticsAnalyticsListRequest.data) + && Objects.equals( + this.additionalProperties, productAnalyticsAnalyticsListRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsAnalyticsListRequest {\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/ProductAnalyticsAnalyticsListRequestAttributes.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsAnalyticsListRequestAttributes.java new file mode 100644 index 00000000000..bcc4f883abb --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsAnalyticsListRequestAttributes.java @@ -0,0 +1,215 @@ +/* + * 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 list request. */ +@JsonPropertyOrder({ + ProductAnalyticsAnalyticsListRequestAttributes.JSON_PROPERTY_FROM, + ProductAnalyticsAnalyticsListRequestAttributes.JSON_PROPERTY_QUERY, + ProductAnalyticsAnalyticsListRequestAttributes.JSON_PROPERTY_TO +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsAnalyticsListRequestAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_FROM = "from"; + private Long from; + + public static final String JSON_PROPERTY_QUERY = "query"; + private ProductAnalyticsAnalyticsListQuery query; + + public static final String JSON_PROPERTY_TO = "to"; + private Long to; + + public ProductAnalyticsAnalyticsListRequestAttributes() {} + + @JsonCreator + public ProductAnalyticsAnalyticsListRequestAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_FROM) Long from, + @JsonProperty(required = true, value = JSON_PROPERTY_QUERY) + ProductAnalyticsAnalyticsListQuery query, + @JsonProperty(required = true, value = JSON_PROPERTY_TO) Long to) { + this.from = from; + this.query = query; + this.unparsed |= query.unparsed; + this.to = to; + } + + public ProductAnalyticsAnalyticsListRequestAttributes 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 ProductAnalyticsAnalyticsListRequestAttributes query( + ProductAnalyticsAnalyticsListQuery query) { + this.query = query; + this.unparsed |= query.unparsed; + return this; + } + + /** + * The analytics list query definition. It selects the events to return with query, + * then chooses the columns on each event row, the sort applied to those rows, and a row limit. + * Unlike the scalar and timeseries queries, a list query returns raw event rows rather than + * aggregates, so it takes no compute or group-by rule. + * + * @return query + */ + @JsonProperty(JSON_PROPERTY_QUERY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsAnalyticsListQuery getQuery() { + return query; + } + + public void setQuery(ProductAnalyticsAnalyticsListQuery query) { + this.query = query; + if (query != null) { + this.unparsed |= query.unparsed; + } + } + + public ProductAnalyticsAnalyticsListRequestAttributes 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 ProductAnalyticsAnalyticsListRequestAttributes + */ + @JsonAnySetter + public ProductAnalyticsAnalyticsListRequestAttributes 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 ProductAnalyticsAnalyticsListRequestAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsAnalyticsListRequestAttributes productAnalyticsAnalyticsListRequestAttributes = + (ProductAnalyticsAnalyticsListRequestAttributes) o; + return Objects.equals(this.from, productAnalyticsAnalyticsListRequestAttributes.from) + && Objects.equals(this.query, productAnalyticsAnalyticsListRequestAttributes.query) + && Objects.equals(this.to, productAnalyticsAnalyticsListRequestAttributes.to) + && Objects.equals( + this.additionalProperties, + productAnalyticsAnalyticsListRequestAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(from, query, to, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsAnalyticsListRequestAttributes {\n"); + sb.append(" from: ").append(toIndentedString(from)).append("\n"); + sb.append(" query: ").append(toIndentedString(query)).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/ProductAnalyticsAnalyticsListRequestData.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsAnalyticsListRequestData.java new file mode 100644 index 00000000000..5029c759e20 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsAnalyticsListRequestData.java @@ -0,0 +1,190 @@ +/* + * 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 list request. */ +@JsonPropertyOrder({ + ProductAnalyticsAnalyticsListRequestData.JSON_PROPERTY_ATTRIBUTES, + ProductAnalyticsAnalyticsListRequestData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsAnalyticsListRequestData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private ProductAnalyticsAnalyticsListRequestAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ProductAnalyticsAnalyticsListRequestType type; + + public ProductAnalyticsAnalyticsListRequestData() {} + + @JsonCreator + public ProductAnalyticsAnalyticsListRequestData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + ProductAnalyticsAnalyticsListRequestAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + ProductAnalyticsAnalyticsListRequestType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public ProductAnalyticsAnalyticsListRequestData attributes( + ProductAnalyticsAnalyticsListRequestAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes for an analytics list request. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsAnalyticsListRequestAttributes getAttributes() { + return attributes; + } + + public void setAttributes(ProductAnalyticsAnalyticsListRequestAttributes attributes) { + this.attributes = attributes; + if (attributes != null) { + this.unparsed |= attributes.unparsed; + } + } + + public ProductAnalyticsAnalyticsListRequestData type( + ProductAnalyticsAnalyticsListRequestType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The resource type for analytics list requests. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsAnalyticsListRequestType getType() { + return type; + } + + public void setType(ProductAnalyticsAnalyticsListRequestType 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 ProductAnalyticsAnalyticsListRequestData + */ + @JsonAnySetter + public ProductAnalyticsAnalyticsListRequestData 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 ProductAnalyticsAnalyticsListRequestData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsAnalyticsListRequestData productAnalyticsAnalyticsListRequestData = + (ProductAnalyticsAnalyticsListRequestData) o; + return Objects.equals(this.attributes, productAnalyticsAnalyticsListRequestData.attributes) + && Objects.equals(this.type, productAnalyticsAnalyticsListRequestData.type) + && Objects.equals( + this.additionalProperties, + productAnalyticsAnalyticsListRequestData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsAnalyticsListRequestData {\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/ProductAnalyticsAnalyticsListRequestType.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsAnalyticsListRequestType.java new file mode 100644 index 00000000000..92a6a8c577f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsAnalyticsListRequestType.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; + +/** The resource type for analytics list requests. */ +@JsonSerialize( + using = + ProductAnalyticsAnalyticsListRequestType.ProductAnalyticsAnalyticsListRequestTypeSerializer + .class) +public class ProductAnalyticsAnalyticsListRequestType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("formula_analytics_extended_list_request")); + + public static final ProductAnalyticsAnalyticsListRequestType + FORMULA_ANALYTICS_EXTENDED_LIST_REQUEST = + new ProductAnalyticsAnalyticsListRequestType("formula_analytics_extended_list_request"); + + ProductAnalyticsAnalyticsListRequestType(String value) { + super(value, allowedValues); + } + + public static class ProductAnalyticsAnalyticsListRequestTypeSerializer + extends StdSerializer { + public ProductAnalyticsAnalyticsListRequestTypeSerializer( + Class t) { + super(t); + } + + public ProductAnalyticsAnalyticsListRequestTypeSerializer() { + this(null); + } + + @Override + public void serialize( + ProductAnalyticsAnalyticsListRequestType value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ProductAnalyticsAnalyticsListRequestType fromValue(String value) { + return new ProductAnalyticsAnalyticsListRequestType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsAnalyticsListResponse.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsAnalyticsListResponse.java new file mode 100644 index 00000000000..884e15feab1 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsAnalyticsListResponse.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; + +/** Response for an analytics list query, containing individual event records. */ +@JsonPropertyOrder({ + ProductAnalyticsAnalyticsListResponse.JSON_PROPERTY_DATA, + ProductAnalyticsAnalyticsListResponse.JSON_PROPERTY_META +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsAnalyticsListResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private ProductAnalyticsAnalyticsListResponseData data; + + public static final String JSON_PROPERTY_META = "meta"; + private ProductAnalyticsResponseMeta meta; + + public ProductAnalyticsAnalyticsListResponse() {} + + @JsonCreator + public ProductAnalyticsAnalyticsListResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + ProductAnalyticsAnalyticsListResponseData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public ProductAnalyticsAnalyticsListResponse data( + ProductAnalyticsAnalyticsListResponseData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data object for an analytics list response. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsAnalyticsListResponseData getData() { + return data; + } + + public void setData(ProductAnalyticsAnalyticsListResponseData data) { + this.data = data; + if (data != null) { + this.unparsed |= data.unparsed; + } + } + + public ProductAnalyticsAnalyticsListResponse 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; + if (meta != null) { + this.unparsed |= meta.unparsed; + } + } + + /** + * 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 ProductAnalyticsAnalyticsListResponse + */ + @JsonAnySetter + public ProductAnalyticsAnalyticsListResponse 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 ProductAnalyticsAnalyticsListResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsAnalyticsListResponse productAnalyticsAnalyticsListResponse = + (ProductAnalyticsAnalyticsListResponse) o; + return Objects.equals(this.data, productAnalyticsAnalyticsListResponse.data) + && Objects.equals(this.meta, productAnalyticsAnalyticsListResponse.meta) + && Objects.equals( + this.additionalProperties, productAnalyticsAnalyticsListResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, meta, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsAnalyticsListResponse {\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/ProductAnalyticsAnalyticsListResponseAttributes.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsAnalyticsListResponseAttributes.java new file mode 100644 index 00000000000..b457ff1ef4d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsAnalyticsListResponseAttributes.java @@ -0,0 +1,182 @@ +/* + * 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; + +/** Attributes of an analytics list response, containing the matching event rows. */ +@JsonPropertyOrder({ + ProductAnalyticsAnalyticsListResponseAttributes.JSON_PROPERTY_RECORDS, + ProductAnalyticsAnalyticsListResponseAttributes.JSON_PROPERTY_TOTAL_COUNT +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsAnalyticsListResponseAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_RECORDS = "records"; + private List> records = null; + + public static final String JSON_PROPERTY_TOTAL_COUNT = "total_count"; + private Long totalCount; + + public ProductAnalyticsAnalyticsListResponseAttributes records( + List> records) { + this.records = records; + return this; + } + + public ProductAnalyticsAnalyticsListResponseAttributes addRecordsItem( + Map recordsItem) { + if (this.records == null) { + this.records = new ArrayList<>(); + } + this.records.add(recordsItem); + return this; + } + + /** + * The event rows, each holding the values of the requested columns. + * + * @return records + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RECORDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List> getRecords() { + return records; + } + + public void setRecords(List> records) { + this.records = records; + } + + public ProductAnalyticsAnalyticsListResponseAttributes totalCount(Long totalCount) { + this.totalCount = totalCount; + return this; + } + + /** + * Total number of records matching the query, before the row limit is applied. + * + * @return totalCount + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TOTAL_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getTotalCount() { + return totalCount; + } + + public void setTotalCount(Long totalCount) { + this.totalCount = totalCount; + } + + /** + * 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 ProductAnalyticsAnalyticsListResponseAttributes + */ + @JsonAnySetter + public ProductAnalyticsAnalyticsListResponseAttributes 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 ProductAnalyticsAnalyticsListResponseAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsAnalyticsListResponseAttributes + productAnalyticsAnalyticsListResponseAttributes = + (ProductAnalyticsAnalyticsListResponseAttributes) o; + return Objects.equals(this.records, productAnalyticsAnalyticsListResponseAttributes.records) + && Objects.equals( + this.totalCount, productAnalyticsAnalyticsListResponseAttributes.totalCount) + && Objects.equals( + this.additionalProperties, + productAnalyticsAnalyticsListResponseAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(records, totalCount, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsAnalyticsListResponseAttributes {\n"); + sb.append(" records: ").append(toIndentedString(records)).append("\n"); + sb.append(" totalCount: ").append(toIndentedString(totalCount)).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/ProductAnalyticsAnalyticsListResponseData.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsAnalyticsListResponseData.java new file mode 100644 index 00000000000..005d2f0628f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsAnalyticsListResponseData.java @@ -0,0 +1,218 @@ +/* + * 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 list response. */ +@JsonPropertyOrder({ + ProductAnalyticsAnalyticsListResponseData.JSON_PROPERTY_ATTRIBUTES, + ProductAnalyticsAnalyticsListResponseData.JSON_PROPERTY_ID, + ProductAnalyticsAnalyticsListResponseData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsAnalyticsListResponseData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private ProductAnalyticsAnalyticsListResponseAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ProductAnalyticsAnalyticsListResponseType type; + + public ProductAnalyticsAnalyticsListResponseData() {} + + @JsonCreator + public ProductAnalyticsAnalyticsListResponseData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + ProductAnalyticsAnalyticsListResponseAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + ProductAnalyticsAnalyticsListResponseType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public ProductAnalyticsAnalyticsListResponseData attributes( + ProductAnalyticsAnalyticsListResponseAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of an analytics list response, containing the matching event rows. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsAnalyticsListResponseAttributes getAttributes() { + return attributes; + } + + public void setAttributes(ProductAnalyticsAnalyticsListResponseAttributes attributes) { + this.attributes = attributes; + if (attributes != null) { + this.unparsed |= attributes.unparsed; + } + } + + public ProductAnalyticsAnalyticsListResponseData id(String id) { + this.id = id; + return this; + } + + /** + * Unique identifier for this response data object. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public ProductAnalyticsAnalyticsListResponseData type( + ProductAnalyticsAnalyticsListResponseType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The resource type identifier for an analytics list response. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsAnalyticsListResponseType getType() { + return type; + } + + public void setType(ProductAnalyticsAnalyticsListResponseType 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 ProductAnalyticsAnalyticsListResponseData + */ + @JsonAnySetter + public ProductAnalyticsAnalyticsListResponseData 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 ProductAnalyticsAnalyticsListResponseData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsAnalyticsListResponseData productAnalyticsAnalyticsListResponseData = + (ProductAnalyticsAnalyticsListResponseData) o; + return Objects.equals(this.attributes, productAnalyticsAnalyticsListResponseData.attributes) + && Objects.equals(this.id, productAnalyticsAnalyticsListResponseData.id) + && Objects.equals(this.type, productAnalyticsAnalyticsListResponseData.type) + && Objects.equals( + this.additionalProperties, + productAnalyticsAnalyticsListResponseData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsAnalyticsListResponseData {\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/ProductAnalyticsAnalyticsListResponseType.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsAnalyticsListResponseType.java new file mode 100644 index 00000000000..e9bfea92dbc --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsAnalyticsListResponseType.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 resource type identifier for an analytics list response. */ +@JsonSerialize( + using = + ProductAnalyticsAnalyticsListResponseType + .ProductAnalyticsAnalyticsListResponseTypeSerializer.class) +public class ProductAnalyticsAnalyticsListResponseType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("list_response")); + + public static final ProductAnalyticsAnalyticsListResponseType LIST_RESPONSE = + new ProductAnalyticsAnalyticsListResponseType("list_response"); + + ProductAnalyticsAnalyticsListResponseType(String value) { + super(value, allowedValues); + } + + public static class ProductAnalyticsAnalyticsListResponseTypeSerializer + extends StdSerializer { + public ProductAnalyticsAnalyticsListResponseTypeSerializer( + Class t) { + super(t); + } + + public ProductAnalyticsAnalyticsListResponseTypeSerializer() { + this(null); + } + + @Override + public void serialize( + ProductAnalyticsAnalyticsListResponseType value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ProductAnalyticsAnalyticsListResponseType fromValue(String value) { + return new ProductAnalyticsAnalyticsListResponseType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsAnalyticsListSort.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsAnalyticsListSort.java new file mode 100644 index 00000000000..adc655d2b74 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsAnalyticsListSort.java @@ -0,0 +1,170 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The sort applied to the returned event rows. */ +@JsonPropertyOrder({ + ProductAnalyticsAnalyticsListSort.JSON_PROPERTY_FACET, + ProductAnalyticsAnalyticsListSort.JSON_PROPERTY_ORDER +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsAnalyticsListSort { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_FACET = "facet"; + private String facet; + + public static final String JSON_PROPERTY_ORDER = "order"; + private ProductAnalyticsAnalyticsListSortOrder order; + + public ProductAnalyticsAnalyticsListSort facet(String facet) { + this.facet = facet; + return this; + } + + /** + * Name of the facet to sort the rows by. + * + * @return facet + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FACET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFacet() { + return facet; + } + + public void setFacet(String facet) { + this.facet = facet; + } + + public ProductAnalyticsAnalyticsListSort order(ProductAnalyticsAnalyticsListSortOrder order) { + this.order = order; + this.unparsed |= !order.isValid(); + return this; + } + + /** + * The direction rows are sorted in. + * + * @return order + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ProductAnalyticsAnalyticsListSortOrder getOrder() { + return order; + } + + public void setOrder(ProductAnalyticsAnalyticsListSortOrder 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 ProductAnalyticsAnalyticsListSort + */ + @JsonAnySetter + public ProductAnalyticsAnalyticsListSort 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 ProductAnalyticsAnalyticsListSort object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsAnalyticsListSort productAnalyticsAnalyticsListSort = + (ProductAnalyticsAnalyticsListSort) o; + return Objects.equals(this.facet, productAnalyticsAnalyticsListSort.facet) + && Objects.equals(this.order, productAnalyticsAnalyticsListSort.order) + && Objects.equals( + this.additionalProperties, productAnalyticsAnalyticsListSort.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(facet, order, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsAnalyticsListSort {\n"); + sb.append(" facet: ").append(toIndentedString(facet)).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/ProductAnalyticsAnalyticsListSortOrder.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsAnalyticsListSortOrder.java new file mode 100644 index 00000000000..d74d5a80c21 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsAnalyticsListSortOrder.java @@ -0,0 +1,65 @@ +/* + * 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 direction rows are sorted in. */ +@JsonSerialize( + using = + ProductAnalyticsAnalyticsListSortOrder.ProductAnalyticsAnalyticsListSortOrderSerializer + .class) +public class ProductAnalyticsAnalyticsListSortOrder extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("asc", "desc")); + + public static final ProductAnalyticsAnalyticsListSortOrder ASC = + new ProductAnalyticsAnalyticsListSortOrder("asc"); + public static final ProductAnalyticsAnalyticsListSortOrder DESC = + new ProductAnalyticsAnalyticsListSortOrder("desc"); + + ProductAnalyticsAnalyticsListSortOrder(String value) { + super(value, allowedValues); + } + + public static class ProductAnalyticsAnalyticsListSortOrderSerializer + extends StdSerializer { + public ProductAnalyticsAnalyticsListSortOrderSerializer( + Class t) { + super(t); + } + + public ProductAnalyticsAnalyticsListSortOrderSerializer() { + this(null); + } + + @Override + public void serialize( + ProductAnalyticsAnalyticsListSortOrder value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ProductAnalyticsAnalyticsListSortOrder fromValue(String value) { + return new ProductAnalyticsAnalyticsListSortOrder(value); + } +} 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 index bd844cc6d18..44a6935ab3a 100644 --- a/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsAnalyticsQuery.java +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsAnalyticsQuery.java @@ -162,10 +162,12 @@ public ProductAnalyticsAnalyticsQuery addIndexesItem(String indexesItem) { } /** - * Restrict the query to specific indexes. Max 1 entry. + * Deprecated. Index selection is a rollout detail and will be removed. Do not set this field. * * @return indexes + * @deprecated */ + @Deprecated @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_INDEXES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -173,6 +175,7 @@ public List getIndexes() { return indexes; } + @Deprecated public void setIndexes(List indexes) { this.indexes = indexes; } 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 index 95ece690473..bc4841bde5a 100644 --- a/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsAnalyticsRequestAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsAnalyticsRequestAttributes.java @@ -134,7 +134,7 @@ public ProductAnalyticsAnalyticsRequestAttributes requestId(String requestId) { } /** - * Optional request ID for multi-step query continuation. + * Unique identifier of the query. * * @return requestId */ diff --git a/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsCalendarInterval.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsCalendarInterval.java new file mode 100644 index 00000000000..4ca4ba8755f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsCalendarInterval.java @@ -0,0 +1,236 @@ +/* + * 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 calendar-aligned bucket definition, such as "every 1 week starting on Monday". */ +@JsonPropertyOrder({ + ProductAnalyticsCalendarInterval.JSON_PROPERTY_ALIGNMENT, + ProductAnalyticsCalendarInterval.JSON_PROPERTY_QUANTITY, + ProductAnalyticsCalendarInterval.JSON_PROPERTY_TIMEZONE, + ProductAnalyticsCalendarInterval.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsCalendarInterval { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ALIGNMENT = "alignment"; + private String alignment; + + public static final String JSON_PROPERTY_QUANTITY = "quantity"; + private Long quantity; + + public static final String JSON_PROPERTY_TIMEZONE = "timezone"; + private String timezone; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ProductAnalyticsCalendarIntervalType type; + + public ProductAnalyticsCalendarInterval() {} + + @JsonCreator + public ProductAnalyticsCalendarInterval( + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + ProductAnalyticsCalendarIntervalType type) { + this.type = type; + this.unparsed |= !type.isValid(); + } + + public ProductAnalyticsCalendarInterval alignment(String alignment) { + this.alignment = alignment; + return this; + } + + /** + * Where each bucket starts within the calendar unit. Use an hour for day (for + * example 1am or 14), a day name for week (for example + * monday), or an ordinal for month (for example 1st). + * + * @return alignment + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ALIGNMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAlignment() { + return alignment; + } + + public void setAlignment(String alignment) { + this.alignment = alignment; + } + + public ProductAnalyticsCalendarInterval quantity(Long quantity) { + this.quantity = quantity; + return this; + } + + /** + * Number of calendar units per bucket. minimum: 1 + * + * @return quantity + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_QUANTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getQuantity() { + return quantity; + } + + public void setQuantity(Long quantity) { + this.quantity = quantity; + } + + public ProductAnalyticsCalendarInterval timezone(String timezone) { + this.timezone = timezone; + return this; + } + + /** + * Timezone used to align the buckets. + * + * @return timezone + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TIMEZONE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTimezone() { + return timezone; + } + + public void setTimezone(String timezone) { + this.timezone = timezone; + } + + public ProductAnalyticsCalendarInterval type(ProductAnalyticsCalendarIntervalType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Calendar unit used to bucket cohorts. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsCalendarIntervalType getType() { + return type; + } + + public void setType(ProductAnalyticsCalendarIntervalType 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 ProductAnalyticsCalendarInterval + */ + @JsonAnySetter + public ProductAnalyticsCalendarInterval 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 ProductAnalyticsCalendarInterval object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsCalendarInterval productAnalyticsCalendarInterval = + (ProductAnalyticsCalendarInterval) o; + return Objects.equals(this.alignment, productAnalyticsCalendarInterval.alignment) + && Objects.equals(this.quantity, productAnalyticsCalendarInterval.quantity) + && Objects.equals(this.timezone, productAnalyticsCalendarInterval.timezone) + && Objects.equals(this.type, productAnalyticsCalendarInterval.type) + && Objects.equals( + this.additionalProperties, productAnalyticsCalendarInterval.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(alignment, quantity, timezone, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsCalendarInterval {\n"); + sb.append(" alignment: ").append(toIndentedString(alignment)).append("\n"); + sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); + sb.append(" timezone: ").append(toIndentedString(timezone)).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/ProductAnalyticsCalendarIntervalType.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsCalendarIntervalType.java new file mode 100644 index 00000000000..7e6d9f3ffad --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsCalendarIntervalType.java @@ -0,0 +1,73 @@ +/* + * 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; + +/** Calendar unit used to bucket cohorts. */ +@JsonSerialize( + using = + ProductAnalyticsCalendarIntervalType.ProductAnalyticsCalendarIntervalTypeSerializer.class) +public class ProductAnalyticsCalendarIntervalType extends ModelEnum { + + private static final Set allowedValues = + new HashSet( + Arrays.asList("minute", "hour", "day", "week", "month", "quarter", "year")); + + public static final ProductAnalyticsCalendarIntervalType MINUTE = + new ProductAnalyticsCalendarIntervalType("minute"); + public static final ProductAnalyticsCalendarIntervalType HOUR = + new ProductAnalyticsCalendarIntervalType("hour"); + public static final ProductAnalyticsCalendarIntervalType DAY = + new ProductAnalyticsCalendarIntervalType("day"); + public static final ProductAnalyticsCalendarIntervalType WEEK = + new ProductAnalyticsCalendarIntervalType("week"); + public static final ProductAnalyticsCalendarIntervalType MONTH = + new ProductAnalyticsCalendarIntervalType("month"); + public static final ProductAnalyticsCalendarIntervalType QUARTER = + new ProductAnalyticsCalendarIntervalType("quarter"); + public static final ProductAnalyticsCalendarIntervalType YEAR = + new ProductAnalyticsCalendarIntervalType("year"); + + ProductAnalyticsCalendarIntervalType(String value) { + super(value, allowedValues); + } + + public static class ProductAnalyticsCalendarIntervalTypeSerializer + extends StdSerializer { + public ProductAnalyticsCalendarIntervalTypeSerializer( + Class t) { + super(t); + } + + public ProductAnalyticsCalendarIntervalTypeSerializer() { + this(null); + } + + @Override + public void serialize( + ProductAnalyticsCalendarIntervalType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ProductAnalyticsCalendarIntervalType fromValue(String value) { + return new ProductAnalyticsCalendarIntervalType(value); + } +} 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 index ed11f5c4999..08aecbae6dc 100644 --- a/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsCompute.java +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsCompute.java @@ -70,7 +70,8 @@ public ProductAnalyticsCompute interval(Long interval) { } /** - * Time bucket size in milliseconds. Required for timeseries queries. + * Time bucket size in milliseconds. Required for timeseries queries; ignored by the scalar + * endpoint, which returns a single value. * * @return interval */ diff --git a/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsElapsedTime.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsElapsedTime.java new file mode 100644 index 00000000000..b315cdde4f4 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsElapsedTime.java @@ -0,0 +1,202 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Elapsed time statistics (min/max/avg in milliseconds). */ +@JsonPropertyOrder({ + ProductAnalyticsElapsedTime.JSON_PROPERTY_AVG, + ProductAnalyticsElapsedTime.JSON_PROPERTY_MAX, + ProductAnalyticsElapsedTime.JSON_PROPERTY_MIN +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsElapsedTime { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_AVG = "avg"; + private Long avg; + + public static final String JSON_PROPERTY_MAX = "max"; + private Long max; + + public static final String JSON_PROPERTY_MIN = "min"; + private Long min; + + public ProductAnalyticsElapsedTime() {} + + @JsonCreator + public ProductAnalyticsElapsedTime( + @JsonProperty(required = true, value = JSON_PROPERTY_AVG) Long avg, + @JsonProperty(required = true, value = JSON_PROPERTY_MAX) Long max, + @JsonProperty(required = true, value = JSON_PROPERTY_MIN) Long min) { + this.avg = avg; + this.max = max; + this.min = min; + } + + public ProductAnalyticsElapsedTime avg(Long avg) { + this.avg = avg; + return this; + } + + /** + * Average elapsed time to reach the next step, in milliseconds. + * + * @return avg + */ + @JsonProperty(JSON_PROPERTY_AVG) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getAvg() { + return avg; + } + + public void setAvg(Long avg) { + this.avg = avg; + } + + public ProductAnalyticsElapsedTime max(Long max) { + this.max = max; + return this; + } + + /** + * Maximum elapsed time to reach the next step, in milliseconds. + * + * @return max + */ + @JsonProperty(JSON_PROPERTY_MAX) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getMax() { + return max; + } + + public void setMax(Long max) { + this.max = max; + } + + public ProductAnalyticsElapsedTime min(Long min) { + this.min = min; + return this; + } + + /** + * Minimum elapsed time to reach the next step, in milliseconds. + * + * @return min + */ + @JsonProperty(JSON_PROPERTY_MIN) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getMin() { + return min; + } + + public void setMin(Long min) { + this.min = min; + } + + /** + * 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 ProductAnalyticsElapsedTime + */ + @JsonAnySetter + public ProductAnalyticsElapsedTime 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 ProductAnalyticsElapsedTime object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsElapsedTime productAnalyticsElapsedTime = (ProductAnalyticsElapsedTime) o; + return Objects.equals(this.avg, productAnalyticsElapsedTime.avg) + && Objects.equals(this.max, productAnalyticsElapsedTime.max) + && Objects.equals(this.min, productAnalyticsElapsedTime.min) + && Objects.equals( + this.additionalProperties, productAnalyticsElapsedTime.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(avg, max, min, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsElapsedTime {\n"); + sb.append(" avg: ").append(toIndentedString(avg)).append("\n"); + sb.append(" max: ").append(toIndentedString(max)).append("\n"); + sb.append(" min: ").append(toIndentedString(min)).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/ProductAnalyticsFormulaJourneyQuery.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsFormulaJourneyQuery.java new file mode 100644 index 00000000000..3e7e72d6b3b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsFormulaJourneyQuery.java @@ -0,0 +1,264 @@ +/* + * 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; + +/** Query definition for a journey timeseries request. */ +@JsonPropertyOrder({ + ProductAnalyticsFormulaJourneyQuery.JSON_PROPERTY_COMPUTE, + ProductAnalyticsFormulaJourneyQuery.JSON_PROPERTY_GROUP_BY, + ProductAnalyticsFormulaJourneyQuery.JSON_PROPERTY_QUERY_ID, + ProductAnalyticsFormulaJourneyQuery.JSON_PROPERTY_SEARCH +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsFormulaJourneyQuery { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_COMPUTE = "compute"; + private ProductAnalyticsGraphQueryCompute compute; + + public static final String JSON_PROPERTY_GROUP_BY = "group_by"; + private List groupBy = null; + + public static final String JSON_PROPERTY_QUERY_ID = "query_id"; + private String queryId; + + public static final String JSON_PROPERTY_SEARCH = "search"; + private ProductAnalyticsJourneySearch search; + + public ProductAnalyticsFormulaJourneyQuery() {} + + @JsonCreator + public ProductAnalyticsFormulaJourneyQuery( + @JsonProperty(required = true, value = JSON_PROPERTY_COMPUTE) + ProductAnalyticsGraphQueryCompute compute, + @JsonProperty(required = true, value = JSON_PROPERTY_SEARCH) + ProductAnalyticsJourneySearch search) { + this.compute = compute; + this.unparsed |= compute.unparsed; + this.search = search; + this.unparsed |= search.unparsed; + } + + public ProductAnalyticsFormulaJourneyQuery compute(ProductAnalyticsGraphQueryCompute compute) { + this.compute = compute; + this.unparsed |= compute.unparsed; + return this; + } + + /** + * Defines the metric computed over the journey. + * + * @return compute + */ + @JsonProperty(JSON_PROPERTY_COMPUTE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsGraphQueryCompute getCompute() { + return compute; + } + + public void setCompute(ProductAnalyticsGraphQueryCompute compute) { + this.compute = compute; + if (compute != null) { + this.unparsed |= compute.unparsed; + } + } + + public ProductAnalyticsFormulaJourneyQuery groupBy( + List groupBy) { + this.groupBy = groupBy; + if (groupBy != null) { + for (ProductAnalyticsGraphQueryGroupBy item : groupBy) { + this.unparsed |= item.unparsed; + } + } + return this; + } + + public ProductAnalyticsFormulaJourneyQuery addGroupByItem( + ProductAnalyticsGraphQueryGroupBy groupByItem) { + if (this.groupBy == null) { + this.groupBy = new ArrayList<>(); + } + this.groupBy.add(groupByItem); + this.unparsed |= groupByItem.unparsed; + return this; + } + + /** + * Segments the results by the values of one or more facets. + * + * @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; + if (groupBy != null) { + for (ProductAnalyticsGraphQueryGroupBy item : groupBy) { + this.unparsed |= item.unparsed; + } + } + } + + public ProductAnalyticsFormulaJourneyQuery queryId(String queryId) { + this.queryId = queryId; + return this; + } + + /** + * Caller-defined identifier echoed back in the results. + * + * @return queryId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_QUERY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getQueryId() { + return queryId; + } + + public void setQueryId(String queryId) { + this.queryId = queryId; + } + + public ProductAnalyticsFormulaJourneyQuery search(ProductAnalyticsJourneySearch search) { + this.search = search; + this.unparsed |= search.unparsed; + return this; + } + + /** + * Defines the steps of the journey and the filters applied to it. + * + * @return search + */ + @JsonProperty(JSON_PROPERTY_SEARCH) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsJourneySearch getSearch() { + return search; + } + + public void setSearch(ProductAnalyticsJourneySearch search) { + this.search = search; + if (search != null) { + this.unparsed |= search.unparsed; + } + } + + /** + * 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 ProductAnalyticsFormulaJourneyQuery + */ + @JsonAnySetter + public ProductAnalyticsFormulaJourneyQuery 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 ProductAnalyticsFormulaJourneyQuery object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsFormulaJourneyQuery productAnalyticsFormulaJourneyQuery = + (ProductAnalyticsFormulaJourneyQuery) o; + return Objects.equals(this.compute, productAnalyticsFormulaJourneyQuery.compute) + && Objects.equals(this.groupBy, productAnalyticsFormulaJourneyQuery.groupBy) + && Objects.equals(this.queryId, productAnalyticsFormulaJourneyQuery.queryId) + && Objects.equals(this.search, productAnalyticsFormulaJourneyQuery.search) + && Objects.equals( + this.additionalProperties, productAnalyticsFormulaJourneyQuery.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(compute, groupBy, queryId, search, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsFormulaJourneyQuery {\n"); + sb.append(" compute: ").append(toIndentedString(compute)).append("\n"); + sb.append(" groupBy: ").append(toIndentedString(groupBy)).append("\n"); + sb.append(" queryId: ").append(toIndentedString(queryId)).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/ProductAnalyticsFormulaJourneyRequest.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsFormulaJourneyRequest.java new file mode 100644 index 00000000000..47812b1a98a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsFormulaJourneyRequest.java @@ -0,0 +1,153 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Request body for a journey timeseries query. */ +@JsonPropertyOrder({ProductAnalyticsFormulaJourneyRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsFormulaJourneyRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private ProductAnalyticsFormulaJourneyRequestData data; + + public ProductAnalyticsFormulaJourneyRequest() {} + + @JsonCreator + public ProductAnalyticsFormulaJourneyRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + ProductAnalyticsFormulaJourneyRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public ProductAnalyticsFormulaJourneyRequest data( + ProductAnalyticsFormulaJourneyRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * The single JSON:API resource carrying a journey timeseries query. Its attributes hold the time + * window, the bucket interval that splits it, and the journey metric to compute per bucket. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsFormulaJourneyRequestData getData() { + return data; + } + + public void setData(ProductAnalyticsFormulaJourneyRequestData data) { + this.data = data; + if (data != null) { + this.unparsed |= data.unparsed; + } + } + + /** + * 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 ProductAnalyticsFormulaJourneyRequest + */ + @JsonAnySetter + public ProductAnalyticsFormulaJourneyRequest 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 ProductAnalyticsFormulaJourneyRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsFormulaJourneyRequest productAnalyticsFormulaJourneyRequest = + (ProductAnalyticsFormulaJourneyRequest) o; + return Objects.equals(this.data, productAnalyticsFormulaJourneyRequest.data) + && Objects.equals( + this.additionalProperties, productAnalyticsFormulaJourneyRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsFormulaJourneyRequest {\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/ProductAnalyticsFormulaJourneyRequestAttributes.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsFormulaJourneyRequestAttributes.java new file mode 100644 index 00000000000..2bbe5dce700 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsFormulaJourneyRequestAttributes.java @@ -0,0 +1,240 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Attributes of a journey timeseries request. */ +@JsonPropertyOrder({ + ProductAnalyticsFormulaJourneyRequestAttributes.JSON_PROPERTY_FROM, + ProductAnalyticsFormulaJourneyRequestAttributes.JSON_PROPERTY_INTERVAL, + ProductAnalyticsFormulaJourneyRequestAttributes.JSON_PROPERTY_QUERY, + ProductAnalyticsFormulaJourneyRequestAttributes.JSON_PROPERTY_TO +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsFormulaJourneyRequestAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_FROM = "from"; + private Long from; + + public static final String JSON_PROPERTY_INTERVAL = "interval"; + private Long interval; + + public static final String JSON_PROPERTY_QUERY = "query"; + private ProductAnalyticsFormulaJourneyQuery query; + + public static final String JSON_PROPERTY_TO = "to"; + private Long to; + + public ProductAnalyticsFormulaJourneyRequestAttributes() {} + + @JsonCreator + public ProductAnalyticsFormulaJourneyRequestAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_FROM) Long from, + @JsonProperty(required = true, value = JSON_PROPERTY_QUERY) + ProductAnalyticsFormulaJourneyQuery query, + @JsonProperty(required = true, value = JSON_PROPERTY_TO) Long to) { + this.from = from; + this.query = query; + this.unparsed |= query.unparsed; + this.to = to; + } + + public ProductAnalyticsFormulaJourneyRequestAttributes from(Long from) { + this.from = from; + return this; + } + + /** + * Start of the query window, in epoch milliseconds. + * + * @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 ProductAnalyticsFormulaJourneyRequestAttributes interval(Long interval) { + this.interval = interval; + return this; + } + + /** + * Time bucket interval in milliseconds. + * + * @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 ProductAnalyticsFormulaJourneyRequestAttributes query( + ProductAnalyticsFormulaJourneyQuery query) { + this.query = query; + this.unparsed |= query.unparsed; + return this; + } + + /** + * Query definition for a journey timeseries request. + * + * @return query + */ + @JsonProperty(JSON_PROPERTY_QUERY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsFormulaJourneyQuery getQuery() { + return query; + } + + public void setQuery(ProductAnalyticsFormulaJourneyQuery query) { + this.query = query; + if (query != null) { + this.unparsed |= query.unparsed; + } + } + + public ProductAnalyticsFormulaJourneyRequestAttributes to(Long to) { + this.to = to; + return this; + } + + /** + * End of the query window, 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 ProductAnalyticsFormulaJourneyRequestAttributes + */ + @JsonAnySetter + public ProductAnalyticsFormulaJourneyRequestAttributes 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 ProductAnalyticsFormulaJourneyRequestAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsFormulaJourneyRequestAttributes + productAnalyticsFormulaJourneyRequestAttributes = + (ProductAnalyticsFormulaJourneyRequestAttributes) o; + return Objects.equals(this.from, productAnalyticsFormulaJourneyRequestAttributes.from) + && Objects.equals(this.interval, productAnalyticsFormulaJourneyRequestAttributes.interval) + && Objects.equals(this.query, productAnalyticsFormulaJourneyRequestAttributes.query) + && Objects.equals(this.to, productAnalyticsFormulaJourneyRequestAttributes.to) + && Objects.equals( + this.additionalProperties, + productAnalyticsFormulaJourneyRequestAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(from, interval, query, to, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsFormulaJourneyRequestAttributes {\n"); + sb.append(" from: ").append(toIndentedString(from)).append("\n"); + sb.append(" interval: ").append(toIndentedString(interval)).append("\n"); + sb.append(" query: ").append(toIndentedString(query)).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/ProductAnalyticsFormulaJourneyRequestData.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsFormulaJourneyRequestData.java new file mode 100644 index 00000000000..269c456af0a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsFormulaJourneyRequestData.java @@ -0,0 +1,193 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * The single JSON:API resource carrying a journey timeseries query. Its attributes hold the time + * window, the bucket interval that splits it, and the journey metric to compute per bucket. + */ +@JsonPropertyOrder({ + ProductAnalyticsFormulaJourneyRequestData.JSON_PROPERTY_ATTRIBUTES, + ProductAnalyticsFormulaJourneyRequestData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsFormulaJourneyRequestData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private ProductAnalyticsFormulaJourneyRequestAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ProductAnalyticsFormulaJourneyRequestType type; + + public ProductAnalyticsFormulaJourneyRequestData() {} + + @JsonCreator + public ProductAnalyticsFormulaJourneyRequestData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + ProductAnalyticsFormulaJourneyRequestAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + ProductAnalyticsFormulaJourneyRequestType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public ProductAnalyticsFormulaJourneyRequestData attributes( + ProductAnalyticsFormulaJourneyRequestAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of a journey timeseries request. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsFormulaJourneyRequestAttributes getAttributes() { + return attributes; + } + + public void setAttributes(ProductAnalyticsFormulaJourneyRequestAttributes attributes) { + this.attributes = attributes; + if (attributes != null) { + this.unparsed |= attributes.unparsed; + } + } + + public ProductAnalyticsFormulaJourneyRequestData type( + ProductAnalyticsFormulaJourneyRequestType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The resource type identifier for a journey timeseries or scalar request. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsFormulaJourneyRequestType getType() { + return type; + } + + public void setType(ProductAnalyticsFormulaJourneyRequestType 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 ProductAnalyticsFormulaJourneyRequestData + */ + @JsonAnySetter + public ProductAnalyticsFormulaJourneyRequestData 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 ProductAnalyticsFormulaJourneyRequestData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsFormulaJourneyRequestData productAnalyticsFormulaJourneyRequestData = + (ProductAnalyticsFormulaJourneyRequestData) o; + return Objects.equals(this.attributes, productAnalyticsFormulaJourneyRequestData.attributes) + && Objects.equals(this.type, productAnalyticsFormulaJourneyRequestData.type) + && Objects.equals( + this.additionalProperties, + productAnalyticsFormulaJourneyRequestData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsFormulaJourneyRequestData {\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/ProductAnalyticsFormulaJourneyRequestType.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsFormulaJourneyRequestType.java new file mode 100644 index 00000000000..70441188b74 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsFormulaJourneyRequestType.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 resource type identifier for a journey timeseries or scalar request. */ +@JsonSerialize( + using = + ProductAnalyticsFormulaJourneyRequestType + .ProductAnalyticsFormulaJourneyRequestTypeSerializer.class) +public class ProductAnalyticsFormulaJourneyRequestType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("formula_journey_request")); + + public static final ProductAnalyticsFormulaJourneyRequestType FORMULA_JOURNEY_REQUEST = + new ProductAnalyticsFormulaJourneyRequestType("formula_journey_request"); + + ProductAnalyticsFormulaJourneyRequestType(String value) { + super(value, allowedValues); + } + + public static class ProductAnalyticsFormulaJourneyRequestTypeSerializer + extends StdSerializer { + public ProductAnalyticsFormulaJourneyRequestTypeSerializer( + Class t) { + super(t); + } + + public ProductAnalyticsFormulaJourneyRequestTypeSerializer() { + this(null); + } + + @Override + public void serialize( + ProductAnalyticsFormulaJourneyRequestType value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ProductAnalyticsFormulaJourneyRequestType fromValue(String value) { + return new ProductAnalyticsFormulaJourneyRequestType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsFormulaRetentionQuery.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsFormulaRetentionQuery.java new file mode 100644 index 00000000000..5808dfd9093 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsFormulaRetentionQuery.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.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Query definition for a retention scalar or retention timeseries request. */ +@JsonPropertyOrder({ + ProductAnalyticsFormulaRetentionQuery.JSON_PROPERTY_COMPUTATION_SCOPE, + ProductAnalyticsFormulaRetentionQuery.JSON_PROPERTY_COMPUTE, + ProductAnalyticsFormulaRetentionQuery.JSON_PROPERTY_GROUP_BY, + ProductAnalyticsFormulaRetentionQuery.JSON_PROPERTY_SEARCH +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsFormulaRetentionQuery { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_COMPUTATION_SCOPE = "computation_scope"; + private ProductAnalyticsRetentionScope computationScope; + + public static final String JSON_PROPERTY_COMPUTE = "compute"; + private ProductAnalyticsRetentionCompute compute; + + public static final String JSON_PROPERTY_GROUP_BY = "group_by"; + private List groupBy = null; + + public static final String JSON_PROPERTY_SEARCH = "search"; + private ProductAnalyticsRetentionSearch search; + + public ProductAnalyticsFormulaRetentionQuery() {} + + @JsonCreator + public ProductAnalyticsFormulaRetentionQuery( + @JsonProperty(required = true, value = JSON_PROPERTY_COMPUTE) + ProductAnalyticsRetentionCompute compute, + @JsonProperty(required = true, value = JSON_PROPERTY_SEARCH) + ProductAnalyticsRetentionSearch search) { + this.compute = compute; + this.unparsed |= compute.unparsed; + this.search = search; + this.unparsed |= search.unparsed; + } + + public ProductAnalyticsFormulaRetentionQuery computationScope( + ProductAnalyticsRetentionScope computationScope) { + this.computationScope = computationScope; + this.unparsed |= computationScope.unparsed; + return this; + } + + /** + * Restricts a retention query to part of the grid, so that results can be examined in detail. + * Omit it to compute the whole grid. + * + * @return computationScope + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COMPUTATION_SCOPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ProductAnalyticsRetentionScope getComputationScope() { + return computationScope; + } + + public void setComputationScope(ProductAnalyticsRetentionScope computationScope) { + this.computationScope = computationScope; + if (computationScope != null) { + this.unparsed |= computationScope.unparsed; + } + } + + public ProductAnalyticsFormulaRetentionQuery compute(ProductAnalyticsRetentionCompute compute) { + this.compute = compute; + this.unparsed |= compute.unparsed; + return this; + } + + /** + * The metric and aggregation applied to a retention query. + * + * @return compute + */ + @JsonProperty(JSON_PROPERTY_COMPUTE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsRetentionCompute getCompute() { + return compute; + } + + public void setCompute(ProductAnalyticsRetentionCompute compute) { + this.compute = compute; + if (compute != null) { + this.unparsed |= compute.unparsed; + } + } + + public ProductAnalyticsFormulaRetentionQuery groupBy( + List groupBy) { + this.groupBy = groupBy; + if (groupBy != null) { + for (ProductAnalyticsRetentionGroupBy item : groupBy) { + this.unparsed |= item.unparsed; + } + } + return this; + } + + public ProductAnalyticsFormulaRetentionQuery addGroupByItem( + ProductAnalyticsRetentionGroupBy groupByItem) { + if (this.groupBy == null) { + this.groupBy = new ArrayList<>(); + } + this.groupBy.add(groupByItem); + this.unparsed |= groupByItem.unparsed; + return this; + } + + /** + * Splits the results by the values of one or more facets. + * + * @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; + if (groupBy != null) { + for (ProductAnalyticsRetentionGroupBy item : groupBy) { + this.unparsed |= item.unparsed; + } + } + } + + public ProductAnalyticsFormulaRetentionQuery search(ProductAnalyticsRetentionSearch search) { + this.search = search; + this.unparsed |= search.unparsed; + return this; + } + + /** + * Defines the cohort and return criteria that make up a retention query. + * + * @return search + */ + @JsonProperty(JSON_PROPERTY_SEARCH) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsRetentionSearch getSearch() { + return search; + } + + public void setSearch(ProductAnalyticsRetentionSearch search) { + this.search = search; + if (search != null) { + this.unparsed |= search.unparsed; + } + } + + /** + * 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 ProductAnalyticsFormulaRetentionQuery + */ + @JsonAnySetter + public ProductAnalyticsFormulaRetentionQuery 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 ProductAnalyticsFormulaRetentionQuery object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsFormulaRetentionQuery productAnalyticsFormulaRetentionQuery = + (ProductAnalyticsFormulaRetentionQuery) o; + return Objects.equals( + this.computationScope, productAnalyticsFormulaRetentionQuery.computationScope) + && Objects.equals(this.compute, productAnalyticsFormulaRetentionQuery.compute) + && Objects.equals(this.groupBy, productAnalyticsFormulaRetentionQuery.groupBy) + && Objects.equals(this.search, productAnalyticsFormulaRetentionQuery.search) + && Objects.equals( + this.additionalProperties, productAnalyticsFormulaRetentionQuery.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(computationScope, compute, groupBy, search, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsFormulaRetentionQuery {\n"); + sb.append(" computationScope: ").append(toIndentedString(computationScope)).append("\n"); + sb.append(" compute: ").append(toIndentedString(compute)).append("\n"); + sb.append(" groupBy: ").append(toIndentedString(groupBy)).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/ProductAnalyticsFormulaRetentionRequest.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsFormulaRetentionRequest.java new file mode 100644 index 00000000000..4c7db8d657b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsFormulaRetentionRequest.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.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Request body for a retention scalar or retention timeseries query. */ +@JsonPropertyOrder({ProductAnalyticsFormulaRetentionRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsFormulaRetentionRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private ProductAnalyticsFormulaRetentionRequestData data; + + public ProductAnalyticsFormulaRetentionRequest() {} + + @JsonCreator + public ProductAnalyticsFormulaRetentionRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + ProductAnalyticsFormulaRetentionRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public ProductAnalyticsFormulaRetentionRequest data( + ProductAnalyticsFormulaRetentionRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * The single JSON:API resource carrying a retention scalar or timeseries query. Its attributes + * hold the time window to query and the retention query definition to evaluate. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsFormulaRetentionRequestData getData() { + return data; + } + + public void setData(ProductAnalyticsFormulaRetentionRequestData data) { + this.data = data; + if (data != null) { + this.unparsed |= data.unparsed; + } + } + + /** + * 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 ProductAnalyticsFormulaRetentionRequest + */ + @JsonAnySetter + public ProductAnalyticsFormulaRetentionRequest 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 ProductAnalyticsFormulaRetentionRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsFormulaRetentionRequest productAnalyticsFormulaRetentionRequest = + (ProductAnalyticsFormulaRetentionRequest) o; + return Objects.equals(this.data, productAnalyticsFormulaRetentionRequest.data) + && Objects.equals( + this.additionalProperties, + productAnalyticsFormulaRetentionRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsFormulaRetentionRequest {\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/ProductAnalyticsFormulaRetentionRequestAttributes.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsFormulaRetentionRequestAttributes.java new file mode 100644 index 00000000000..51869681608 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsFormulaRetentionRequestAttributes.java @@ -0,0 +1,245 @@ +/* + * 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 of a retention scalar or retention timeseries request. */ +@JsonPropertyOrder({ + ProductAnalyticsFormulaRetentionRequestAttributes.JSON_PROPERTY_EXCLUDE_ANONYMOUS_TRAFFIC, + ProductAnalyticsFormulaRetentionRequestAttributes.JSON_PROPERTY_FROM, + ProductAnalyticsFormulaRetentionRequestAttributes.JSON_PROPERTY_QUERY, + ProductAnalyticsFormulaRetentionRequestAttributes.JSON_PROPERTY_TO +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsFormulaRetentionRequestAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_EXCLUDE_ANONYMOUS_TRAFFIC = "exclude_anonymous_traffic"; + private Boolean excludeAnonymousTraffic = false; + + public static final String JSON_PROPERTY_FROM = "from"; + private Long from; + + public static final String JSON_PROPERTY_QUERY = "query"; + private ProductAnalyticsFormulaRetentionQuery query; + + public static final String JSON_PROPERTY_TO = "to"; + private Long to; + + public ProductAnalyticsFormulaRetentionRequestAttributes() {} + + @JsonCreator + public ProductAnalyticsFormulaRetentionRequestAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_FROM) Long from, + @JsonProperty(required = true, value = JSON_PROPERTY_QUERY) + ProductAnalyticsFormulaRetentionQuery query, + @JsonProperty(required = true, value = JSON_PROPERTY_TO) Long to) { + this.from = from; + this.query = query; + this.unparsed |= query.unparsed; + this.to = to; + } + + public ProductAnalyticsFormulaRetentionRequestAttributes excludeAnonymousTraffic( + Boolean excludeAnonymousTraffic) { + this.excludeAnonymousTraffic = excludeAnonymousTraffic; + return this; + } + + /** + * Whether to exclude sessions that are not tied to an identified user. + * + * @return excludeAnonymousTraffic + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EXCLUDE_ANONYMOUS_TRAFFIC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getExcludeAnonymousTraffic() { + return excludeAnonymousTraffic; + } + + public void setExcludeAnonymousTraffic(Boolean excludeAnonymousTraffic) { + this.excludeAnonymousTraffic = excludeAnonymousTraffic; + } + + public ProductAnalyticsFormulaRetentionRequestAttributes from(Long from) { + this.from = from; + return this; + } + + /** + * Start of the query window, in epoch milliseconds. + * + * @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 ProductAnalyticsFormulaRetentionRequestAttributes query( + ProductAnalyticsFormulaRetentionQuery query) { + this.query = query; + this.unparsed |= query.unparsed; + return this; + } + + /** + * Query definition for a retention scalar or retention timeseries request. + * + * @return query + */ + @JsonProperty(JSON_PROPERTY_QUERY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsFormulaRetentionQuery getQuery() { + return query; + } + + public void setQuery(ProductAnalyticsFormulaRetentionQuery query) { + this.query = query; + if (query != null) { + this.unparsed |= query.unparsed; + } + } + + public ProductAnalyticsFormulaRetentionRequestAttributes to(Long to) { + this.to = to; + return this; + } + + /** + * End of the query window, 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 ProductAnalyticsFormulaRetentionRequestAttributes + */ + @JsonAnySetter + public ProductAnalyticsFormulaRetentionRequestAttributes 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 ProductAnalyticsFormulaRetentionRequestAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsFormulaRetentionRequestAttributes + productAnalyticsFormulaRetentionRequestAttributes = + (ProductAnalyticsFormulaRetentionRequestAttributes) o; + return Objects.equals( + this.excludeAnonymousTraffic, + productAnalyticsFormulaRetentionRequestAttributes.excludeAnonymousTraffic) + && Objects.equals(this.from, productAnalyticsFormulaRetentionRequestAttributes.from) + && Objects.equals(this.query, productAnalyticsFormulaRetentionRequestAttributes.query) + && Objects.equals(this.to, productAnalyticsFormulaRetentionRequestAttributes.to) + && Objects.equals( + this.additionalProperties, + productAnalyticsFormulaRetentionRequestAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(excludeAnonymousTraffic, from, query, to, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsFormulaRetentionRequestAttributes {\n"); + sb.append(" excludeAnonymousTraffic: ") + .append(toIndentedString(excludeAnonymousTraffic)) + .append("\n"); + sb.append(" from: ").append(toIndentedString(from)).append("\n"); + sb.append(" query: ").append(toIndentedString(query)).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/ProductAnalyticsFormulaRetentionRequestData.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsFormulaRetentionRequestData.java new file mode 100644 index 00000000000..827b877a3bf --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsFormulaRetentionRequestData.java @@ -0,0 +1,194 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * The single JSON:API resource carrying a retention scalar or timeseries query. Its attributes hold + * the time window to query and the retention query definition to evaluate. + */ +@JsonPropertyOrder({ + ProductAnalyticsFormulaRetentionRequestData.JSON_PROPERTY_ATTRIBUTES, + ProductAnalyticsFormulaRetentionRequestData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsFormulaRetentionRequestData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private ProductAnalyticsFormulaRetentionRequestAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ProductAnalyticsFormulaRetentionRequestType type; + + public ProductAnalyticsFormulaRetentionRequestData() {} + + @JsonCreator + public ProductAnalyticsFormulaRetentionRequestData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + ProductAnalyticsFormulaRetentionRequestAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + ProductAnalyticsFormulaRetentionRequestType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public ProductAnalyticsFormulaRetentionRequestData attributes( + ProductAnalyticsFormulaRetentionRequestAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of a retention scalar or retention timeseries request. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsFormulaRetentionRequestAttributes getAttributes() { + return attributes; + } + + public void setAttributes(ProductAnalyticsFormulaRetentionRequestAttributes attributes) { + this.attributes = attributes; + if (attributes != null) { + this.unparsed |= attributes.unparsed; + } + } + + public ProductAnalyticsFormulaRetentionRequestData type( + ProductAnalyticsFormulaRetentionRequestType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The resource type identifier for a retention scalar or retention timeseries request. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsFormulaRetentionRequestType getType() { + return type; + } + + public void setType(ProductAnalyticsFormulaRetentionRequestType 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 ProductAnalyticsFormulaRetentionRequestData + */ + @JsonAnySetter + public ProductAnalyticsFormulaRetentionRequestData 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 ProductAnalyticsFormulaRetentionRequestData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsFormulaRetentionRequestData productAnalyticsFormulaRetentionRequestData = + (ProductAnalyticsFormulaRetentionRequestData) o; + return Objects.equals(this.attributes, productAnalyticsFormulaRetentionRequestData.attributes) + && Objects.equals(this.type, productAnalyticsFormulaRetentionRequestData.type) + && Objects.equals( + this.additionalProperties, + productAnalyticsFormulaRetentionRequestData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsFormulaRetentionRequestData {\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/ProductAnalyticsFormulaRetentionRequestType.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsFormulaRetentionRequestType.java new file mode 100644 index 00000000000..65e4c4b8af0 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsFormulaRetentionRequestType.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 resource type identifier for a retention scalar or retention timeseries request. */ +@JsonSerialize( + using = + ProductAnalyticsFormulaRetentionRequestType + .ProductAnalyticsFormulaRetentionRequestTypeSerializer.class) +public class ProductAnalyticsFormulaRetentionRequestType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("formula_retention_request")); + + public static final ProductAnalyticsFormulaRetentionRequestType FORMULA_RETENTION_REQUEST = + new ProductAnalyticsFormulaRetentionRequestType("formula_retention_request"); + + ProductAnalyticsFormulaRetentionRequestType(String value) { + super(value, allowedValues); + } + + public static class ProductAnalyticsFormulaRetentionRequestTypeSerializer + extends StdSerializer { + public ProductAnalyticsFormulaRetentionRequestTypeSerializer( + Class t) { + super(t); + } + + public ProductAnalyticsFormulaRetentionRequestTypeSerializer() { + this(null); + } + + @Override + public void serialize( + ProductAnalyticsFormulaRetentionRequestType value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ProductAnalyticsFormulaRetentionRequestType fromValue(String value) { + return new ProductAnalyticsFormulaRetentionRequestType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsGraphQueryCompute.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsGraphQueryCompute.java new file mode 100644 index 00000000000..ce0b151cf3f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsGraphQueryCompute.java @@ -0,0 +1,238 @@ +/* + * 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; + +/** Defines the metric computed over the journey. */ +@JsonPropertyOrder({ + ProductAnalyticsGraphQueryCompute.JSON_PROPERTY_AGGREGATION, + ProductAnalyticsGraphQueryCompute.JSON_PROPERTY_INTERVAL, + ProductAnalyticsGraphQueryCompute.JSON_PROPERTY_METRIC, + ProductAnalyticsGraphQueryCompute.JSON_PROPERTY_TARGET +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsGraphQueryCompute { + @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 static final String JSON_PROPERTY_TARGET = "target"; + private ProductAnalyticsJourneyTarget target; + + public ProductAnalyticsGraphQueryCompute() {} + + @JsonCreator + public ProductAnalyticsGraphQueryCompute( + @JsonProperty(required = true, value = JSON_PROPERTY_AGGREGATION) String aggregation) { + this.aggregation = aggregation; + } + + public ProductAnalyticsGraphQueryCompute aggregation(String aggregation) { + this.aggregation = aggregation; + return this; + } + + /** + * Aggregation function: count, cardinality, avg, + * median, min, max, sum, or a percentile of the + * form pc<N> such as pc95. Defaults to cardinality. + * + * @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 ProductAnalyticsGraphQueryCompute interval(Long interval) { + this.interval = interval; + return this; + } + + /** + * Time bucket interval in milliseconds, used by 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 ProductAnalyticsGraphQueryCompute metric(String metric) { + this.metric = metric; + return this; + } + + /** + * Metric to aggregate on. Use a facet path such as @view.time_spent, or one of the + * journey metrics __dd.conversion, __dd.conversion_rate, + * __dd.time_to_convert, or __dd.dropoff_rate. Defaults to + * __dd.conversion. + * + * @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 ProductAnalyticsGraphQueryCompute target(ProductAnalyticsJourneyTarget target) { + this.target = target; + this.unparsed |= target.unparsed; + return this; + } + + /** + * A reference to a step, or a range of steps, in the journey. Use a node target to + * name a single step, or a path target to name the range between two steps. + * + * @return target + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TARGET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ProductAnalyticsJourneyTarget getTarget() { + return target; + } + + public void setTarget(ProductAnalyticsJourneyTarget target) { + this.target = target; + if (target != null) { + this.unparsed |= target.unparsed; + } + } + + /** + * 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 ProductAnalyticsGraphQueryCompute + */ + @JsonAnySetter + public ProductAnalyticsGraphQueryCompute 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 ProductAnalyticsGraphQueryCompute object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsGraphQueryCompute productAnalyticsGraphQueryCompute = + (ProductAnalyticsGraphQueryCompute) o; + return Objects.equals(this.aggregation, productAnalyticsGraphQueryCompute.aggregation) + && Objects.equals(this.interval, productAnalyticsGraphQueryCompute.interval) + && Objects.equals(this.metric, productAnalyticsGraphQueryCompute.metric) + && Objects.equals(this.target, productAnalyticsGraphQueryCompute.target) + && Objects.equals( + this.additionalProperties, productAnalyticsGraphQueryCompute.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(aggregation, interval, metric, target, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsGraphQueryCompute {\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(" target: ").append(toIndentedString(target)).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/ProductAnalyticsGraphQueryGroupBy.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsGraphQueryGroupBy.java new file mode 100644 index 00000000000..16c35c9c644 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsGraphQueryGroupBy.java @@ -0,0 +1,343 @@ +/* + * 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; + +/** Segments journey results by the values of a facet. */ +@JsonPropertyOrder({ + ProductAnalyticsGraphQueryGroupBy.JSON_PROPERTY_FACET, + ProductAnalyticsGraphQueryGroupBy.JSON_PROPERTY_LIMIT, + ProductAnalyticsGraphQueryGroupBy.JSON_PROPERTY_SHOULD_EXCLUDE_MISSING, + ProductAnalyticsGraphQueryGroupBy.JSON_PROPERTY_SORT, + ProductAnalyticsGraphQueryGroupBy.JSON_PROPERTY_SOURCE, + ProductAnalyticsGraphQueryGroupBy.JSON_PROPERTY_TARGET, + ProductAnalyticsGraphQueryGroupBy.JSON_PROPERTY_VALUE_FILTERS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsGraphQueryGroupBy { + @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 ProductAnalyticsGraphQueryGroupBySource source; + + public static final String JSON_PROPERTY_TARGET = "target"; + private ProductAnalyticsJourneyTarget target; + + public static final String JSON_PROPERTY_VALUE_FILTERS = "value_filters"; + private List valueFilters = null; + + public ProductAnalyticsGraphQueryGroupBy() {} + + @JsonCreator + public ProductAnalyticsGraphQueryGroupBy( + @JsonProperty(required = true, value = JSON_PROPERTY_FACET) String facet) { + this.facet = facet; + } + + public ProductAnalyticsGraphQueryGroupBy facet(String facet) { + this.facet = facet; + return this; + } + + /** + * Attribute path 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 ProductAnalyticsGraphQueryGroupBy limit(Long limit) { + this.limit = limit; + return this; + } + + /** + * Maximum number of groups to return. Omit it to let the service choose. minimum: 1 + * + * @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 ProductAnalyticsGraphQueryGroupBy shouldExcludeMissing(Boolean shouldExcludeMissing) { + this.shouldExcludeMissing = shouldExcludeMissing; + return this; + } + + /** + * Whether to exclude entities that have no value for this facet. + * + * @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 ProductAnalyticsGraphQueryGroupBy 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; + if (sort != null) { + this.unparsed |= sort.unparsed; + } + } + + public ProductAnalyticsGraphQueryGroupBy source(ProductAnalyticsGraphQueryGroupBySource source) { + this.source = source; + this.unparsed |= !source.isValid(); + return this; + } + + /** + * Audience dimension to group by, instead of an event facet. + * + * @return source + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SOURCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ProductAnalyticsGraphQueryGroupBySource getSource() { + return source; + } + + public void setSource(ProductAnalyticsGraphQueryGroupBySource source) { + if (!source.isValid()) { + this.unparsed = true; + } + this.source = source; + } + + public ProductAnalyticsGraphQueryGroupBy target(ProductAnalyticsJourneyTarget target) { + this.target = target; + this.unparsed |= target.unparsed; + return this; + } + + /** + * A reference to a step, or a range of steps, in the journey. Use a node target to + * name a single step, or a path target to name the range between two steps. + * + * @return target + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TARGET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ProductAnalyticsJourneyTarget getTarget() { + return target; + } + + public void setTarget(ProductAnalyticsJourneyTarget target) { + this.target = target; + if (target != null) { + this.unparsed |= target.unparsed; + } + } + + public ProductAnalyticsGraphQueryGroupBy valueFilters(List valueFilters) { + this.valueFilters = valueFilters; + return this; + } + + public ProductAnalyticsGraphQueryGroupBy addValueFiltersItem(String valueFiltersItem) { + if (this.valueFilters == null) { + this.valueFilters = new ArrayList<>(); + } + this.valueFilters.add(valueFiltersItem); + return this; + } + + /** + * Restricts the results to these facet values. + * + * @return valueFilters + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VALUE_FILTERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getValueFilters() { + return valueFilters; + } + + public void setValueFilters(List valueFilters) { + this.valueFilters = valueFilters; + } + + /** + * 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 ProductAnalyticsGraphQueryGroupBy + */ + @JsonAnySetter + public ProductAnalyticsGraphQueryGroupBy 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 ProductAnalyticsGraphQueryGroupBy object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsGraphQueryGroupBy productAnalyticsGraphQueryGroupBy = + (ProductAnalyticsGraphQueryGroupBy) o; + return Objects.equals(this.facet, productAnalyticsGraphQueryGroupBy.facet) + && Objects.equals(this.limit, productAnalyticsGraphQueryGroupBy.limit) + && Objects.equals( + this.shouldExcludeMissing, productAnalyticsGraphQueryGroupBy.shouldExcludeMissing) + && Objects.equals(this.sort, productAnalyticsGraphQueryGroupBy.sort) + && Objects.equals(this.source, productAnalyticsGraphQueryGroupBy.source) + && Objects.equals(this.target, productAnalyticsGraphQueryGroupBy.target) + && Objects.equals(this.valueFilters, productAnalyticsGraphQueryGroupBy.valueFilters) + && Objects.equals( + this.additionalProperties, productAnalyticsGraphQueryGroupBy.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + facet, + limit, + shouldExcludeMissing, + sort, + source, + target, + valueFilters, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsGraphQueryGroupBy {\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(" target: ").append(toIndentedString(target)).append("\n"); + sb.append(" valueFilters: ").append(toIndentedString(valueFilters)).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/ProductAnalyticsGraphQueryGroupBySource.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsGraphQueryGroupBySource.java new file mode 100644 index 00000000000..e584f57f8b4 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsGraphQueryGroupBySource.java @@ -0,0 +1,68 @@ +/* + * 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; + +/** Audience dimension to group by, instead of an event facet. */ +@JsonSerialize( + using = + ProductAnalyticsGraphQueryGroupBySource.ProductAnalyticsGraphQueryGroupBySourceSerializer + .class) +public class ProductAnalyticsGraphQueryGroupBySource extends ModelEnum { + + private static final Set allowedValues = + new HashSet( + Arrays.asList( + "product_analytics_audience_filters.users", + "product_analytics_audience_filters.accounts")); + + public static final ProductAnalyticsGraphQueryGroupBySource USERS = + new ProductAnalyticsGraphQueryGroupBySource("product_analytics_audience_filters.users"); + public static final ProductAnalyticsGraphQueryGroupBySource ACCOUNTS = + new ProductAnalyticsGraphQueryGroupBySource("product_analytics_audience_filters.accounts"); + + ProductAnalyticsGraphQueryGroupBySource(String value) { + super(value, allowedValues); + } + + public static class ProductAnalyticsGraphQueryGroupBySourceSerializer + extends StdSerializer { + public ProductAnalyticsGraphQueryGroupBySourceSerializer( + Class t) { + super(t); + } + + public ProductAnalyticsGraphQueryGroupBySourceSerializer() { + this(null); + } + + @Override + public void serialize( + ProductAnalyticsGraphQueryGroupBySource value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ProductAnalyticsGraphQueryGroupBySource fromValue(String value) { + return new ProductAnalyticsGraphQueryGroupBySource(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJoinKeys.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJoinKeys.java new file mode 100644 index 00000000000..bacb7a448cd --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJoinKeys.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.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; + +/** Identity join keys used to stitch events belonging to the same user or session. */ +@JsonPropertyOrder({ + ProductAnalyticsJoinKeys.JSON_PROPERTY_PRIMARY, + ProductAnalyticsJoinKeys.JSON_PROPERTY_SECONDARY +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsJoinKeys { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_PRIMARY = "primary"; + private String primary; + + public static final String JSON_PROPERTY_SECONDARY = "secondary"; + private List secondary = null; + + public ProductAnalyticsJoinKeys primary(String primary) { + this.primary = primary; + return this; + } + + /** + * Primary identity join key. Defaults to @session.id. + * + * @return primary + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PRIMARY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPrimary() { + return primary; + } + + public void setPrimary(String primary) { + this.primary = primary; + } + + public ProductAnalyticsJoinKeys secondary(List secondary) { + this.secondary = secondary; + return this; + } + + public ProductAnalyticsJoinKeys addSecondaryItem(String secondaryItem) { + if (this.secondary == null) { + this.secondary = new ArrayList<>(); + } + this.secondary.add(secondaryItem); + return this; + } + + /** + * Additional identity join keys. + * + * @return secondary + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SECONDARY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getSecondary() { + return secondary; + } + + public void setSecondary(List secondary) { + this.secondary = secondary; + } + + /** + * 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 ProductAnalyticsJoinKeys + */ + @JsonAnySetter + public ProductAnalyticsJoinKeys 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 ProductAnalyticsJoinKeys object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsJoinKeys productAnalyticsJoinKeys = (ProductAnalyticsJoinKeys) o; + return Objects.equals(this.primary, productAnalyticsJoinKeys.primary) + && Objects.equals(this.secondary, productAnalyticsJoinKeys.secondary) + && Objects.equals(this.additionalProperties, productAnalyticsJoinKeys.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(primary, secondary, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsJoinKeys {\n"); + sb.append(" primary: ").append(toIndentedString(primary)).append("\n"); + sb.append(" secondary: ").append(toIndentedString(secondary)).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/ProductAnalyticsJourneyAudienceAccountQuery.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyAudienceAccountQuery.java new file mode 100644 index 00000000000..0e9b54877c4 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyAudienceAccountQuery.java @@ -0,0 +1,176 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** A named sub-query selecting a set of accounts. */ +@JsonPropertyOrder({ + ProductAnalyticsJourneyAudienceAccountQuery.JSON_PROPERTY_NAME, + ProductAnalyticsJourneyAudienceAccountQuery.JSON_PROPERTY_QUERY +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsJourneyAudienceAccountQuery { + @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 ProductAnalyticsJourneyAudienceAccountQuery() {} + + @JsonCreator + public ProductAnalyticsJourneyAudienceAccountQuery( + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name) { + this.name = name; + } + + public ProductAnalyticsJourneyAudienceAccountQuery name(String name) { + this.name = name; + return this; + } + + /** + * Unique name for this sub-query, referenced from 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 ProductAnalyticsJourneyAudienceAccountQuery query(String query) { + this.query = query; + return this; + } + + /** + * Search query selecting the 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 ProductAnalyticsJourneyAudienceAccountQuery + */ + @JsonAnySetter + public ProductAnalyticsJourneyAudienceAccountQuery 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 ProductAnalyticsJourneyAudienceAccountQuery object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsJourneyAudienceAccountQuery productAnalyticsJourneyAudienceAccountQuery = + (ProductAnalyticsJourneyAudienceAccountQuery) o; + return Objects.equals(this.name, productAnalyticsJourneyAudienceAccountQuery.name) + && Objects.equals(this.query, productAnalyticsJourneyAudienceAccountQuery.query) + && Objects.equals( + this.additionalProperties, + productAnalyticsJourneyAudienceAccountQuery.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, query, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsJourneyAudienceAccountQuery {\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/ProductAnalyticsJourneyAudienceFilters.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyAudienceFilters.java new file mode 100644 index 00000000000..74a2b8e66c3 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyAudienceFilters.java @@ -0,0 +1,289 @@ +/* + * 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; + +/** + * Restricts the journey to an audience built from named sub-queries. Sub-query names must be unique + * across users, segments, and accounts. + */ +@JsonPropertyOrder({ + ProductAnalyticsJourneyAudienceFilters.JSON_PROPERTY_ACCOUNTS, + ProductAnalyticsJourneyAudienceFilters.JSON_PROPERTY_FORMULA, + ProductAnalyticsJourneyAudienceFilters.JSON_PROPERTY_SEGMENTS, + ProductAnalyticsJourneyAudienceFilters.JSON_PROPERTY_USERS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsJourneyAudienceFilters { + @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 ProductAnalyticsJourneyAudienceFilters accounts( + List accounts) { + this.accounts = accounts; + if (accounts != null) { + for (ProductAnalyticsJourneyAudienceAccountQuery item : accounts) { + this.unparsed |= item.unparsed; + } + } + return this; + } + + public ProductAnalyticsJourneyAudienceFilters addAccountsItem( + ProductAnalyticsJourneyAudienceAccountQuery accountsItem) { + if (this.accounts == null) { + this.accounts = new ArrayList<>(); + } + this.accounts.add(accountsItem); + this.unparsed |= accountsItem.unparsed; + return this; + } + + /** + * Named account sub-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; + if (accounts != null) { + for (ProductAnalyticsJourneyAudienceAccountQuery item : accounts) { + this.unparsed |= item.unparsed; + } + } + } + + public ProductAnalyticsJourneyAudienceFilters formula(String formula) { + this.formula = formula; + return this; + } + + /** + * Boolean expression combining the sub-query names with AND, OR, and + * NOT. When empty, all sub-queries are combined with AND. + * + * @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 ProductAnalyticsJourneyAudienceFilters segments( + List segments) { + this.segments = segments; + if (segments != null) { + for (ProductAnalyticsJourneyAudienceSegmentQuery item : segments) { + this.unparsed |= item.unparsed; + } + } + return this; + } + + public ProductAnalyticsJourneyAudienceFilters addSegmentsItem( + ProductAnalyticsJourneyAudienceSegmentQuery segmentsItem) { + if (this.segments == null) { + this.segments = new ArrayList<>(); + } + this.segments.add(segmentsItem); + this.unparsed |= segmentsItem.unparsed; + return this; + } + + /** + * Named segment sub-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; + if (segments != null) { + for (ProductAnalyticsJourneyAudienceSegmentQuery item : segments) { + this.unparsed |= item.unparsed; + } + } + } + + public ProductAnalyticsJourneyAudienceFilters users( + List users) { + this.users = users; + if (users != null) { + for (ProductAnalyticsJourneyAudienceUserQuery item : users) { + this.unparsed |= item.unparsed; + } + } + return this; + } + + public ProductAnalyticsJourneyAudienceFilters addUsersItem( + ProductAnalyticsJourneyAudienceUserQuery usersItem) { + if (this.users == null) { + this.users = new ArrayList<>(); + } + this.users.add(usersItem); + this.unparsed |= usersItem.unparsed; + return this; + } + + /** + * Named user sub-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; + if (users != null) { + for (ProductAnalyticsJourneyAudienceUserQuery item : users) { + this.unparsed |= item.unparsed; + } + } + } + + /** + * 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 ProductAnalyticsJourneyAudienceFilters + */ + @JsonAnySetter + public ProductAnalyticsJourneyAudienceFilters 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 ProductAnalyticsJourneyAudienceFilters object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsJourneyAudienceFilters productAnalyticsJourneyAudienceFilters = + (ProductAnalyticsJourneyAudienceFilters) o; + return Objects.equals(this.accounts, productAnalyticsJourneyAudienceFilters.accounts) + && Objects.equals(this.formula, productAnalyticsJourneyAudienceFilters.formula) + && Objects.equals(this.segments, productAnalyticsJourneyAudienceFilters.segments) + && Objects.equals(this.users, productAnalyticsJourneyAudienceFilters.users) + && Objects.equals( + this.additionalProperties, productAnalyticsJourneyAudienceFilters.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(accounts, formula, segments, users, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsJourneyAudienceFilters {\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/ProductAnalyticsJourneyAudienceSegmentQuery.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyAudienceSegmentQuery.java new file mode 100644 index 00000000000..19da5b90eb3 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyAudienceSegmentQuery.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; + +/** A named sub-query selecting a saved segment. */ +@JsonPropertyOrder({ + ProductAnalyticsJourneyAudienceSegmentQuery.JSON_PROPERTY_NAME, + ProductAnalyticsJourneyAudienceSegmentQuery.JSON_PROPERTY_SEGMENT_ID +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsJourneyAudienceSegmentQuery { + @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 String segmentId; + + public ProductAnalyticsJourneyAudienceSegmentQuery() {} + + @JsonCreator + public ProductAnalyticsJourneyAudienceSegmentQuery( + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, + @JsonProperty(required = true, value = JSON_PROPERTY_SEGMENT_ID) String segmentId) { + this.name = name; + this.segmentId = segmentId; + } + + public ProductAnalyticsJourneyAudienceSegmentQuery name(String name) { + this.name = name; + return this; + } + + /** + * Unique name for this sub-query, referenced from 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 ProductAnalyticsJourneyAudienceSegmentQuery segmentId(String segmentId) { + this.segmentId = segmentId; + return this; + } + + /** + * Identifier of the saved segment. + * + * @return segmentId + */ + @JsonProperty(JSON_PROPERTY_SEGMENT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getSegmentId() { + return segmentId; + } + + public void setSegmentId(String 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 ProductAnalyticsJourneyAudienceSegmentQuery + */ + @JsonAnySetter + public ProductAnalyticsJourneyAudienceSegmentQuery 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 ProductAnalyticsJourneyAudienceSegmentQuery object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsJourneyAudienceSegmentQuery productAnalyticsJourneyAudienceSegmentQuery = + (ProductAnalyticsJourneyAudienceSegmentQuery) o; + return Objects.equals(this.name, productAnalyticsJourneyAudienceSegmentQuery.name) + && Objects.equals(this.segmentId, productAnalyticsJourneyAudienceSegmentQuery.segmentId) + && Objects.equals( + this.additionalProperties, + productAnalyticsJourneyAudienceSegmentQuery.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, segmentId, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsJourneyAudienceSegmentQuery {\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/ProductAnalyticsJourneyAudienceUserQuery.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyAudienceUserQuery.java new file mode 100644 index 00000000000..502cb44ae47 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyAudienceUserQuery.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; + +/** A named sub-query selecting a set of users. */ +@JsonPropertyOrder({ + ProductAnalyticsJourneyAudienceUserQuery.JSON_PROPERTY_NAME, + ProductAnalyticsJourneyAudienceUserQuery.JSON_PROPERTY_QUERY +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsJourneyAudienceUserQuery { + @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 ProductAnalyticsJourneyAudienceUserQuery() {} + + @JsonCreator + public ProductAnalyticsJourneyAudienceUserQuery( + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name) { + this.name = name; + } + + public ProductAnalyticsJourneyAudienceUserQuery name(String name) { + this.name = name; + return this; + } + + /** + * Unique name for this sub-query, referenced from 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 ProductAnalyticsJourneyAudienceUserQuery query(String query) { + this.query = query; + return this; + } + + /** + * Search query selecting the 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 ProductAnalyticsJourneyAudienceUserQuery + */ + @JsonAnySetter + public ProductAnalyticsJourneyAudienceUserQuery 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 ProductAnalyticsJourneyAudienceUserQuery object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsJourneyAudienceUserQuery productAnalyticsJourneyAudienceUserQuery = + (ProductAnalyticsJourneyAudienceUserQuery) o; + return Objects.equals(this.name, productAnalyticsJourneyAudienceUserQuery.name) + && Objects.equals(this.query, productAnalyticsJourneyAudienceUserQuery.query) + && Objects.equals( + this.additionalProperties, + productAnalyticsJourneyAudienceUserQuery.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, query, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsJourneyAudienceUserQuery {\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/ProductAnalyticsJourneyComputedColumn.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyComputedColumn.java new file mode 100644 index 00000000000..7fa5d403453 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyComputedColumn.java @@ -0,0 +1,155 @@ +/* + * 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 computed column added to each row. Requesting first_conversion_timestamps adds one + * <node alias>_timestamp key per step. + */ +@JsonPropertyOrder({ProductAnalyticsJourneyComputedColumn.JSON_PROPERTY_NAME}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsJourneyComputedColumn { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_NAME = "name"; + private ProductAnalyticsJourneyComputedColumnName name; + + public ProductAnalyticsJourneyComputedColumn() {} + + @JsonCreator + public ProductAnalyticsJourneyComputedColumn( + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) + ProductAnalyticsJourneyComputedColumnName name) { + this.name = name; + this.unparsed |= !name.isValid(); + } + + public ProductAnalyticsJourneyComputedColumn name( + ProductAnalyticsJourneyComputedColumnName name) { + this.name = name; + this.unparsed |= !name.isValid(); + return this; + } + + /** + * Name of a computed column to add to each row. + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsJourneyComputedColumnName getName() { + return name; + } + + public void setName(ProductAnalyticsJourneyComputedColumnName name) { + if (!name.isValid()) { + this.unparsed = true; + } + this.name = name; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ProductAnalyticsJourneyComputedColumn + */ + @JsonAnySetter + public ProductAnalyticsJourneyComputedColumn 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 ProductAnalyticsJourneyComputedColumn object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsJourneyComputedColumn productAnalyticsJourneyComputedColumn = + (ProductAnalyticsJourneyComputedColumn) o; + return Objects.equals(this.name, productAnalyticsJourneyComputedColumn.name) + && Objects.equals( + this.additionalProperties, productAnalyticsJourneyComputedColumn.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsJourneyComputedColumn {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyComputedColumnName.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyComputedColumnName.java new file mode 100644 index 00000000000..0100822fdd7 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyComputedColumnName.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; + +/** Name of a computed column to add to each row. */ +@JsonSerialize( + using = + ProductAnalyticsJourneyComputedColumnName + .ProductAnalyticsJourneyComputedColumnNameSerializer.class) +public class ProductAnalyticsJourneyComputedColumnName extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("first_conversion_timestamps")); + + public static final ProductAnalyticsJourneyComputedColumnName FIRST_CONVERSION_TIMESTAMPS = + new ProductAnalyticsJourneyComputedColumnName("first_conversion_timestamps"); + + ProductAnalyticsJourneyComputedColumnName(String value) { + super(value, allowedValues); + } + + public static class ProductAnalyticsJourneyComputedColumnNameSerializer + extends StdSerializer { + public ProductAnalyticsJourneyComputedColumnNameSerializer( + Class t) { + super(t); + } + + public ProductAnalyticsJourneyComputedColumnNameSerializer() { + this(null); + } + + @Override + public void serialize( + ProductAnalyticsJourneyComputedColumnName value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ProductAnalyticsJourneyComputedColumnName fromValue(String value) { + return new ProductAnalyticsJourneyComputedColumnName(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyConversionType.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyConversionType.java new file mode 100644 index 00000000000..91ff6e56fe9 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyConversionType.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; + +/** Whether to return the entities that converted at the target step, or those that dropped off. */ +@JsonSerialize( + using = + ProductAnalyticsJourneyConversionType.ProductAnalyticsJourneyConversionTypeSerializer.class) +public class ProductAnalyticsJourneyConversionType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("conversion", "drop-off")); + + public static final ProductAnalyticsJourneyConversionType CONVERSION = + new ProductAnalyticsJourneyConversionType("conversion"); + public static final ProductAnalyticsJourneyConversionType DROP_OFF = + new ProductAnalyticsJourneyConversionType("drop-off"); + + ProductAnalyticsJourneyConversionType(String value) { + super(value, allowedValues); + } + + public static class ProductAnalyticsJourneyConversionTypeSerializer + extends StdSerializer { + public ProductAnalyticsJourneyConversionTypeSerializer( + Class t) { + super(t); + } + + public ProductAnalyticsJourneyConversionTypeSerializer() { + this(null); + } + + @Override + public void serialize( + ProductAnalyticsJourneyConversionType value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ProductAnalyticsJourneyConversionType fromValue(String value) { + return new ProductAnalyticsJourneyConversionType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyEntity.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyEntity.java new file mode 100644 index 00000000000..5bf1510872d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyEntity.java @@ -0,0 +1,61 @@ +/* + * 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 kind of entity returned by a journey list query. */ +@JsonSerialize(using = ProductAnalyticsJourneyEntity.ProductAnalyticsJourneyEntitySerializer.class) +public class ProductAnalyticsJourneyEntity extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("session", "user", "account")); + + public static final ProductAnalyticsJourneyEntity SESSION = + new ProductAnalyticsJourneyEntity("session"); + public static final ProductAnalyticsJourneyEntity USER = + new ProductAnalyticsJourneyEntity("user"); + public static final ProductAnalyticsJourneyEntity ACCOUNT = + new ProductAnalyticsJourneyEntity("account"); + + ProductAnalyticsJourneyEntity(String value) { + super(value, allowedValues); + } + + public static class ProductAnalyticsJourneyEntitySerializer + extends StdSerializer { + public ProductAnalyticsJourneyEntitySerializer(Class t) { + super(t); + } + + public ProductAnalyticsJourneyEntitySerializer() { + this(null); + } + + @Override + public void serialize( + ProductAnalyticsJourneyEntity value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ProductAnalyticsJourneyEntity fromValue(String value) { + return new ProductAnalyticsJourneyEntity(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyFunnelCompute.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyFunnelCompute.java new file mode 100644 index 00000000000..4bec0f8f3e9 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyFunnelCompute.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; + +/** Defines the metric computed at each funnel step. */ +@JsonPropertyOrder({ + ProductAnalyticsJourneyFunnelCompute.JSON_PROPERTY_AGGREGATION, + ProductAnalyticsJourneyFunnelCompute.JSON_PROPERTY_METRIC +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsJourneyFunnelCompute { + @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 ProductAnalyticsJourneyFunnelCompute aggregation(String aggregation) { + this.aggregation = aggregation; + return this; + } + + /** + * Aggregation function: count, cardinality, avg, + * median, min, max, sum, or a percentile of the + * form pc<N> such as pc95. Defaults to cardinality. + * + * @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 ProductAnalyticsJourneyFunnelCompute metric(String metric) { + this.metric = metric; + return this; + } + + /** + * Metric to aggregate on. Defaults to the identity join key. + * + * @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 ProductAnalyticsJourneyFunnelCompute + */ + @JsonAnySetter + public ProductAnalyticsJourneyFunnelCompute 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 ProductAnalyticsJourneyFunnelCompute object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsJourneyFunnelCompute productAnalyticsJourneyFunnelCompute = + (ProductAnalyticsJourneyFunnelCompute) o; + return Objects.equals(this.aggregation, productAnalyticsJourneyFunnelCompute.aggregation) + && Objects.equals(this.metric, productAnalyticsJourneyFunnelCompute.metric) + && Objects.equals( + this.additionalProperties, productAnalyticsJourneyFunnelCompute.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(aggregation, metric, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsJourneyFunnelCompute {\n"); + sb.append(" aggregation: ").append(toIndentedString(aggregation)).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/ProductAnalyticsJourneyFunnelQuery.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyFunnelQuery.java new file mode 100644 index 00000000000..d68eb5cafdb --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyFunnelQuery.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.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; + +/** Query definition for a journey funnel request. */ +@JsonPropertyOrder({ + ProductAnalyticsJourneyFunnelQuery.JSON_PROPERTY_COMPUTE, + ProductAnalyticsJourneyFunnelQuery.JSON_PROPERTY_GROUP_BY, + ProductAnalyticsJourneyFunnelQuery.JSON_PROPERTY_SEARCH +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsJourneyFunnelQuery { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_COMPUTE = "compute"; + private ProductAnalyticsJourneyFunnelCompute compute; + + public static final String JSON_PROPERTY_GROUP_BY = "group_by"; + private List groupBy = null; + + public static final String JSON_PROPERTY_SEARCH = "search"; + private ProductAnalyticsJourneySearch search; + + public ProductAnalyticsJourneyFunnelQuery() {} + + @JsonCreator + public ProductAnalyticsJourneyFunnelQuery( + @JsonProperty(required = true, value = JSON_PROPERTY_SEARCH) + ProductAnalyticsJourneySearch search) { + this.search = search; + this.unparsed |= search.unparsed; + } + + public ProductAnalyticsJourneyFunnelQuery compute(ProductAnalyticsJourneyFunnelCompute compute) { + this.compute = compute; + this.unparsed |= compute.unparsed; + return this; + } + + /** + * Defines the metric computed at each funnel step. + * + * @return compute + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COMPUTE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ProductAnalyticsJourneyFunnelCompute getCompute() { + return compute; + } + + public void setCompute(ProductAnalyticsJourneyFunnelCompute compute) { + this.compute = compute; + if (compute != null) { + this.unparsed |= compute.unparsed; + } + } + + public ProductAnalyticsJourneyFunnelQuery groupBy( + List groupBy) { + this.groupBy = groupBy; + if (groupBy != null) { + for (ProductAnalyticsGraphQueryGroupBy item : groupBy) { + this.unparsed |= item.unparsed; + } + } + return this; + } + + public ProductAnalyticsJourneyFunnelQuery addGroupByItem( + ProductAnalyticsGraphQueryGroupBy groupByItem) { + if (this.groupBy == null) { + this.groupBy = new ArrayList<>(); + } + this.groupBy.add(groupByItem); + this.unparsed |= groupByItem.unparsed; + return this; + } + + /** + * Segments the funnel by the values of one or more facets. + * + * @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; + if (groupBy != null) { + for (ProductAnalyticsGraphQueryGroupBy item : groupBy) { + this.unparsed |= item.unparsed; + } + } + } + + public ProductAnalyticsJourneyFunnelQuery search(ProductAnalyticsJourneySearch search) { + this.search = search; + this.unparsed |= search.unparsed; + return this; + } + + /** + * Defines the steps of the journey and the filters applied to it. + * + * @return search + */ + @JsonProperty(JSON_PROPERTY_SEARCH) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsJourneySearch getSearch() { + return search; + } + + public void setSearch(ProductAnalyticsJourneySearch search) { + this.search = search; + if (search != null) { + this.unparsed |= search.unparsed; + } + } + + /** + * 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 ProductAnalyticsJourneyFunnelQuery + */ + @JsonAnySetter + public ProductAnalyticsJourneyFunnelQuery 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 ProductAnalyticsJourneyFunnelQuery object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsJourneyFunnelQuery productAnalyticsJourneyFunnelQuery = + (ProductAnalyticsJourneyFunnelQuery) o; + return Objects.equals(this.compute, productAnalyticsJourneyFunnelQuery.compute) + && Objects.equals(this.groupBy, productAnalyticsJourneyFunnelQuery.groupBy) + && Objects.equals(this.search, productAnalyticsJourneyFunnelQuery.search) + && Objects.equals( + this.additionalProperties, productAnalyticsJourneyFunnelQuery.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(compute, groupBy, search, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsJourneyFunnelQuery {\n"); + sb.append(" compute: ").append(toIndentedString(compute)).append("\n"); + sb.append(" groupBy: ").append(toIndentedString(groupBy)).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/ProductAnalyticsJourneyFunnelRequest.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyFunnelRequest.java new file mode 100644 index 00000000000..d977f8a1fff --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyFunnelRequest.java @@ -0,0 +1,152 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Request body for a journey funnel analysis. */ +@JsonPropertyOrder({ProductAnalyticsJourneyFunnelRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsJourneyFunnelRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private ProductAnalyticsJourneyFunnelRequestData data; + + public ProductAnalyticsJourneyFunnelRequest() {} + + @JsonCreator + public ProductAnalyticsJourneyFunnelRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + ProductAnalyticsJourneyFunnelRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public ProductAnalyticsJourneyFunnelRequest data(ProductAnalyticsJourneyFunnelRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * The single JSON:API resource carrying a funnel query. Its attributes hold the time window to + * query and the journey whose step-to-step conversion should be measured. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsJourneyFunnelRequestData getData() { + return data; + } + + public void setData(ProductAnalyticsJourneyFunnelRequestData data) { + this.data = data; + if (data != null) { + this.unparsed |= data.unparsed; + } + } + + /** + * 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 ProductAnalyticsJourneyFunnelRequest + */ + @JsonAnySetter + public ProductAnalyticsJourneyFunnelRequest 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 ProductAnalyticsJourneyFunnelRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsJourneyFunnelRequest productAnalyticsJourneyFunnelRequest = + (ProductAnalyticsJourneyFunnelRequest) o; + return Objects.equals(this.data, productAnalyticsJourneyFunnelRequest.data) + && Objects.equals( + this.additionalProperties, productAnalyticsJourneyFunnelRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsJourneyFunnelRequest {\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/ProductAnalyticsJourneyFunnelRequestAttributes.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyFunnelRequestAttributes.java new file mode 100644 index 00000000000..2a27e1cc2cc --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyFunnelRequestAttributes.java @@ -0,0 +1,244 @@ +/* + * 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 of a journey funnel request. */ +@JsonPropertyOrder({ + ProductAnalyticsJourneyFunnelRequestAttributes.JSON_PROPERTY_EXCLUDE_ANONYMOUS_TRAFFIC, + ProductAnalyticsJourneyFunnelRequestAttributes.JSON_PROPERTY_FROM, + ProductAnalyticsJourneyFunnelRequestAttributes.JSON_PROPERTY_QUERY, + ProductAnalyticsJourneyFunnelRequestAttributes.JSON_PROPERTY_TO +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsJourneyFunnelRequestAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_EXCLUDE_ANONYMOUS_TRAFFIC = "exclude_anonymous_traffic"; + private Boolean excludeAnonymousTraffic = false; + + public static final String JSON_PROPERTY_FROM = "from"; + private Long from; + + public static final String JSON_PROPERTY_QUERY = "query"; + private ProductAnalyticsJourneyFunnelQuery query; + + public static final String JSON_PROPERTY_TO = "to"; + private Long to; + + public ProductAnalyticsJourneyFunnelRequestAttributes() {} + + @JsonCreator + public ProductAnalyticsJourneyFunnelRequestAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_FROM) Long from, + @JsonProperty(required = true, value = JSON_PROPERTY_QUERY) + ProductAnalyticsJourneyFunnelQuery query, + @JsonProperty(required = true, value = JSON_PROPERTY_TO) Long to) { + this.from = from; + this.query = query; + this.unparsed |= query.unparsed; + this.to = to; + } + + public ProductAnalyticsJourneyFunnelRequestAttributes excludeAnonymousTraffic( + Boolean excludeAnonymousTraffic) { + this.excludeAnonymousTraffic = excludeAnonymousTraffic; + return this; + } + + /** + * Whether to exclude sessions that are not tied to an identified user. + * + * @return excludeAnonymousTraffic + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EXCLUDE_ANONYMOUS_TRAFFIC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getExcludeAnonymousTraffic() { + return excludeAnonymousTraffic; + } + + public void setExcludeAnonymousTraffic(Boolean excludeAnonymousTraffic) { + this.excludeAnonymousTraffic = excludeAnonymousTraffic; + } + + public ProductAnalyticsJourneyFunnelRequestAttributes from(Long from) { + this.from = from; + return this; + } + + /** + * Start of the query window, in epoch milliseconds. + * + * @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 ProductAnalyticsJourneyFunnelRequestAttributes query( + ProductAnalyticsJourneyFunnelQuery query) { + this.query = query; + this.unparsed |= query.unparsed; + return this; + } + + /** + * Query definition for a journey funnel request. + * + * @return query + */ + @JsonProperty(JSON_PROPERTY_QUERY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsJourneyFunnelQuery getQuery() { + return query; + } + + public void setQuery(ProductAnalyticsJourneyFunnelQuery query) { + this.query = query; + if (query != null) { + this.unparsed |= query.unparsed; + } + } + + public ProductAnalyticsJourneyFunnelRequestAttributes to(Long to) { + this.to = to; + return this; + } + + /** + * End of the query window, 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 ProductAnalyticsJourneyFunnelRequestAttributes + */ + @JsonAnySetter + public ProductAnalyticsJourneyFunnelRequestAttributes 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 ProductAnalyticsJourneyFunnelRequestAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsJourneyFunnelRequestAttributes productAnalyticsJourneyFunnelRequestAttributes = + (ProductAnalyticsJourneyFunnelRequestAttributes) o; + return Objects.equals( + this.excludeAnonymousTraffic, + productAnalyticsJourneyFunnelRequestAttributes.excludeAnonymousTraffic) + && Objects.equals(this.from, productAnalyticsJourneyFunnelRequestAttributes.from) + && Objects.equals(this.query, productAnalyticsJourneyFunnelRequestAttributes.query) + && Objects.equals(this.to, productAnalyticsJourneyFunnelRequestAttributes.to) + && Objects.equals( + this.additionalProperties, + productAnalyticsJourneyFunnelRequestAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(excludeAnonymousTraffic, from, query, to, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsJourneyFunnelRequestAttributes {\n"); + sb.append(" excludeAnonymousTraffic: ") + .append(toIndentedString(excludeAnonymousTraffic)) + .append("\n"); + sb.append(" from: ").append(toIndentedString(from)).append("\n"); + sb.append(" query: ").append(toIndentedString(query)).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/ProductAnalyticsJourneyFunnelRequestData.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyFunnelRequestData.java new file mode 100644 index 00000000000..a938651b8c6 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyFunnelRequestData.java @@ -0,0 +1,192 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * The single JSON:API resource carrying a funnel query. Its attributes hold the time window to + * query and the journey whose step-to-step conversion should be measured. + */ +@JsonPropertyOrder({ + ProductAnalyticsJourneyFunnelRequestData.JSON_PROPERTY_ATTRIBUTES, + ProductAnalyticsJourneyFunnelRequestData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsJourneyFunnelRequestData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private ProductAnalyticsJourneyFunnelRequestAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ProductAnalyticsJourneyRequestType type; + + public ProductAnalyticsJourneyFunnelRequestData() {} + + @JsonCreator + public ProductAnalyticsJourneyFunnelRequestData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + ProductAnalyticsJourneyFunnelRequestAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + ProductAnalyticsJourneyRequestType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public ProductAnalyticsJourneyFunnelRequestData attributes( + ProductAnalyticsJourneyFunnelRequestAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of a journey funnel request. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsJourneyFunnelRequestAttributes getAttributes() { + return attributes; + } + + public void setAttributes(ProductAnalyticsJourneyFunnelRequestAttributes attributes) { + this.attributes = attributes; + if (attributes != null) { + this.unparsed |= attributes.unparsed; + } + } + + public ProductAnalyticsJourneyFunnelRequestData type(ProductAnalyticsJourneyRequestType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The resource type identifier for a journey funnel request. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsJourneyRequestType getType() { + return type; + } + + public void setType(ProductAnalyticsJourneyRequestType 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 ProductAnalyticsJourneyFunnelRequestData + */ + @JsonAnySetter + public ProductAnalyticsJourneyFunnelRequestData 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 ProductAnalyticsJourneyFunnelRequestData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsJourneyFunnelRequestData productAnalyticsJourneyFunnelRequestData = + (ProductAnalyticsJourneyFunnelRequestData) o; + return Objects.equals(this.attributes, productAnalyticsJourneyFunnelRequestData.attributes) + && Objects.equals(this.type, productAnalyticsJourneyFunnelRequestData.type) + && Objects.equals( + this.additionalProperties, + productAnalyticsJourneyFunnelRequestData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsJourneyFunnelRequestData {\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/ProductAnalyticsJourneyFunnelResponse.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyFunnelResponse.java new file mode 100644 index 00000000000..bfa158cd275 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyFunnelResponse.java @@ -0,0 +1,153 @@ +/* + * 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; + +/** Response for a journey funnel analysis. */ +@JsonPropertyOrder({ProductAnalyticsJourneyFunnelResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsJourneyFunnelResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private ProductAnalyticsJourneyFunnelResponseData data; + + public ProductAnalyticsJourneyFunnelResponse() {} + + @JsonCreator + public ProductAnalyticsJourneyFunnelResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + ProductAnalyticsJourneyFunnelResponseData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public ProductAnalyticsJourneyFunnelResponse data( + ProductAnalyticsJourneyFunnelResponseData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * The single JSON:API resource holding a computed funnel. Its attributes contain the number of + * entities that entered, the end-to-end conversion, and one entry per funnel step. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsJourneyFunnelResponseData getData() { + return data; + } + + public void setData(ProductAnalyticsJourneyFunnelResponseData data) { + this.data = data; + if (data != null) { + this.unparsed |= data.unparsed; + } + } + + /** + * 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 ProductAnalyticsJourneyFunnelResponse + */ + @JsonAnySetter + public ProductAnalyticsJourneyFunnelResponse 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 ProductAnalyticsJourneyFunnelResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsJourneyFunnelResponse productAnalyticsJourneyFunnelResponse = + (ProductAnalyticsJourneyFunnelResponse) o; + return Objects.equals(this.data, productAnalyticsJourneyFunnelResponse.data) + && Objects.equals( + this.additionalProperties, productAnalyticsJourneyFunnelResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsJourneyFunnelResponse {\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/ProductAnalyticsJourneyFunnelResponseAttributes.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyFunnelResponseAttributes.java new file mode 100644 index 00000000000..438303de8b7 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyFunnelResponseAttributes.java @@ -0,0 +1,281 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Attributes of a journey funnel response. */ +@JsonPropertyOrder({ + ProductAnalyticsJourneyFunnelResponseAttributes.JSON_PROPERTY_END_TO_END_CONVERSION_RATE, + ProductAnalyticsJourneyFunnelResponseAttributes.JSON_PROPERTY_END_TO_END_ELAPSED_TIME, + ProductAnalyticsJourneyFunnelResponseAttributes.JSON_PROPERTY_FUNNEL_STEPS, + ProductAnalyticsJourneyFunnelResponseAttributes.JSON_PROPERTY_INITIAL_COUNT +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsJourneyFunnelResponseAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_END_TO_END_CONVERSION_RATE = + "end_to_end_conversion_rate"; + private Double endToEndConversionRate; + + public static final String JSON_PROPERTY_END_TO_END_ELAPSED_TIME = "end_to_end_elapsed_time"; + private ProductAnalyticsElapsedTime endToEndElapsedTime; + + public static final String JSON_PROPERTY_FUNNEL_STEPS = "funnel_steps"; + private List funnelSteps = new ArrayList<>(); + + public static final String JSON_PROPERTY_INITIAL_COUNT = "initial_count"; + private Long initialCount; + + public ProductAnalyticsJourneyFunnelResponseAttributes() {} + + @JsonCreator + public ProductAnalyticsJourneyFunnelResponseAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_END_TO_END_CONVERSION_RATE) + Double endToEndConversionRate, + @JsonProperty(required = true, value = JSON_PROPERTY_END_TO_END_ELAPSED_TIME) + ProductAnalyticsElapsedTime endToEndElapsedTime, + @JsonProperty(required = true, value = JSON_PROPERTY_FUNNEL_STEPS) + List funnelSteps, + @JsonProperty(required = true, value = JSON_PROPERTY_INITIAL_COUNT) Long initialCount) { + this.endToEndConversionRate = endToEndConversionRate; + this.endToEndElapsedTime = endToEndElapsedTime; + this.unparsed |= endToEndElapsedTime.unparsed; + this.funnelSteps = funnelSteps; + for (ProductAnalyticsJourneyFunnelStep item : funnelSteps) { + this.unparsed |= item.unparsed; + } + this.initialCount = initialCount; + } + + public ProductAnalyticsJourneyFunnelResponseAttributes endToEndConversionRate( + Double endToEndConversionRate) { + this.endToEndConversionRate = endToEndConversionRate; + return this; + } + + /** + * Conversion rate from the first step to the last step. + * + * @return endToEndConversionRate + */ + @JsonProperty(JSON_PROPERTY_END_TO_END_CONVERSION_RATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Double getEndToEndConversionRate() { + return endToEndConversionRate; + } + + public void setEndToEndConversionRate(Double endToEndConversionRate) { + this.endToEndConversionRate = endToEndConversionRate; + } + + public ProductAnalyticsJourneyFunnelResponseAttributes endToEndElapsedTime( + ProductAnalyticsElapsedTime endToEndElapsedTime) { + this.endToEndElapsedTime = endToEndElapsedTime; + this.unparsed |= endToEndElapsedTime.unparsed; + return this; + } + + /** + * Elapsed time statistics (min/max/avg in milliseconds). + * + * @return endToEndElapsedTime + */ + @JsonProperty(JSON_PROPERTY_END_TO_END_ELAPSED_TIME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsElapsedTime getEndToEndElapsedTime() { + return endToEndElapsedTime; + } + + public void setEndToEndElapsedTime(ProductAnalyticsElapsedTime endToEndElapsedTime) { + this.endToEndElapsedTime = endToEndElapsedTime; + if (endToEndElapsedTime != null) { + this.unparsed |= endToEndElapsedTime.unparsed; + } + } + + public ProductAnalyticsJourneyFunnelResponseAttributes funnelSteps( + List funnelSteps) { + this.funnelSteps = funnelSteps; + for (ProductAnalyticsJourneyFunnelStep item : funnelSteps) { + this.unparsed |= item.unparsed; + } + return this; + } + + public ProductAnalyticsJourneyFunnelResponseAttributes addFunnelStepsItem( + ProductAnalyticsJourneyFunnelStep funnelStepsItem) { + this.funnelSteps.add(funnelStepsItem); + this.unparsed |= funnelStepsItem.unparsed; + return this; + } + + /** + * The funnel steps, in the order given by the search expression. + * + * @return funnelSteps + */ + @JsonProperty(JSON_PROPERTY_FUNNEL_STEPS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getFunnelSteps() { + return funnelSteps; + } + + public void setFunnelSteps(List funnelSteps) { + this.funnelSteps = funnelSteps; + if (funnelSteps != null) { + for (ProductAnalyticsJourneyFunnelStep item : funnelSteps) { + this.unparsed |= item.unparsed; + } + } + } + + public ProductAnalyticsJourneyFunnelResponseAttributes initialCount(Long initialCount) { + this.initialCount = initialCount; + return this; + } + + /** + * Number of entities that entered the funnel. + * + * @return initialCount + */ + @JsonProperty(JSON_PROPERTY_INITIAL_COUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getInitialCount() { + return initialCount; + } + + public void setInitialCount(Long initialCount) { + this.initialCount = initialCount; + } + + /** + * 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 ProductAnalyticsJourneyFunnelResponseAttributes + */ + @JsonAnySetter + public ProductAnalyticsJourneyFunnelResponseAttributes 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 ProductAnalyticsJourneyFunnelResponseAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsJourneyFunnelResponseAttributes + productAnalyticsJourneyFunnelResponseAttributes = + (ProductAnalyticsJourneyFunnelResponseAttributes) o; + return Objects.equals( + this.endToEndConversionRate, + productAnalyticsJourneyFunnelResponseAttributes.endToEndConversionRate) + && Objects.equals( + this.endToEndElapsedTime, + productAnalyticsJourneyFunnelResponseAttributes.endToEndElapsedTime) + && Objects.equals( + this.funnelSteps, productAnalyticsJourneyFunnelResponseAttributes.funnelSteps) + && Objects.equals( + this.initialCount, productAnalyticsJourneyFunnelResponseAttributes.initialCount) + && Objects.equals( + this.additionalProperties, + productAnalyticsJourneyFunnelResponseAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + endToEndConversionRate, + endToEndElapsedTime, + funnelSteps, + initialCount, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsJourneyFunnelResponseAttributes {\n"); + sb.append(" endToEndConversionRate: ") + .append(toIndentedString(endToEndConversionRate)) + .append("\n"); + sb.append(" endToEndElapsedTime: ") + .append(toIndentedString(endToEndElapsedTime)) + .append("\n"); + sb.append(" funnelSteps: ").append(toIndentedString(funnelSteps)).append("\n"); + sb.append(" initialCount: ").append(toIndentedString(initialCount)).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/ProductAnalyticsJourneyFunnelResponseData.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyFunnelResponseData.java new file mode 100644 index 00000000000..403ac511d24 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyFunnelResponseData.java @@ -0,0 +1,221 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * The single JSON:API resource holding a computed funnel. Its attributes contain the number of + * entities that entered, the end-to-end conversion, and one entry per funnel step. + */ +@JsonPropertyOrder({ + ProductAnalyticsJourneyFunnelResponseData.JSON_PROPERTY_ATTRIBUTES, + ProductAnalyticsJourneyFunnelResponseData.JSON_PROPERTY_ID, + ProductAnalyticsJourneyFunnelResponseData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsJourneyFunnelResponseData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private ProductAnalyticsJourneyFunnelResponseAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ProductAnalyticsJourneyFunnelResponseType type; + + public ProductAnalyticsJourneyFunnelResponseData() {} + + @JsonCreator + public ProductAnalyticsJourneyFunnelResponseData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + ProductAnalyticsJourneyFunnelResponseAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + ProductAnalyticsJourneyFunnelResponseType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public ProductAnalyticsJourneyFunnelResponseData attributes( + ProductAnalyticsJourneyFunnelResponseAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of a journey funnel response. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsJourneyFunnelResponseAttributes getAttributes() { + return attributes; + } + + public void setAttributes(ProductAnalyticsJourneyFunnelResponseAttributes attributes) { + this.attributes = attributes; + if (attributes != null) { + this.unparsed |= attributes.unparsed; + } + } + + public ProductAnalyticsJourneyFunnelResponseData id(String id) { + this.id = id; + return this; + } + + /** + * Identifier of this result. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public ProductAnalyticsJourneyFunnelResponseData type( + ProductAnalyticsJourneyFunnelResponseType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The resource type identifier for a journey funnel response. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsJourneyFunnelResponseType getType() { + return type; + } + + public void setType(ProductAnalyticsJourneyFunnelResponseType 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 ProductAnalyticsJourneyFunnelResponseData + */ + @JsonAnySetter + public ProductAnalyticsJourneyFunnelResponseData 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 ProductAnalyticsJourneyFunnelResponseData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsJourneyFunnelResponseData productAnalyticsJourneyFunnelResponseData = + (ProductAnalyticsJourneyFunnelResponseData) o; + return Objects.equals(this.attributes, productAnalyticsJourneyFunnelResponseData.attributes) + && Objects.equals(this.id, productAnalyticsJourneyFunnelResponseData.id) + && Objects.equals(this.type, productAnalyticsJourneyFunnelResponseData.type) + && Objects.equals( + this.additionalProperties, + productAnalyticsJourneyFunnelResponseData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsJourneyFunnelResponseData {\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/ProductAnalyticsJourneyFunnelResponseType.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyFunnelResponseType.java new file mode 100644 index 00000000000..b8c206722f1 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyFunnelResponseType.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 resource type identifier for a journey funnel response. */ +@JsonSerialize( + using = + ProductAnalyticsJourneyFunnelResponseType + .ProductAnalyticsJourneyFunnelResponseTypeSerializer.class) +public class ProductAnalyticsJourneyFunnelResponseType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("funnel_response")); + + public static final ProductAnalyticsJourneyFunnelResponseType FUNNEL_RESPONSE = + new ProductAnalyticsJourneyFunnelResponseType("funnel_response"); + + ProductAnalyticsJourneyFunnelResponseType(String value) { + super(value, allowedValues); + } + + public static class ProductAnalyticsJourneyFunnelResponseTypeSerializer + extends StdSerializer { + public ProductAnalyticsJourneyFunnelResponseTypeSerializer( + Class t) { + super(t); + } + + public ProductAnalyticsJourneyFunnelResponseTypeSerializer() { + this(null); + } + + @Override + public void serialize( + ProductAnalyticsJourneyFunnelResponseType value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ProductAnalyticsJourneyFunnelResponseType fromValue(String value) { + return new ProductAnalyticsJourneyFunnelResponseType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyFunnelStep.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyFunnelStep.java new file mode 100644 index 00000000000..a49f3d161c5 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyFunnelStep.java @@ -0,0 +1,291 @@ +/* + * 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; + +/** A single step of the funnel with its conversion counts and timings. */ +@JsonPropertyOrder({ + ProductAnalyticsJourneyFunnelStep.JSON_PROPERTY_ELAPSED_TIME_TO_NEXT_STEP, + ProductAnalyticsJourneyFunnelStep.JSON_PROPERTY_GROUPS, + ProductAnalyticsJourneyFunnelStep.JSON_PROPERTY_LABEL, + ProductAnalyticsJourneyFunnelStep.JSON_PROPERTY_UNIT, + ProductAnalyticsJourneyFunnelStep.JSON_PROPERTY_VALUE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsJourneyFunnelStep { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ELAPSED_TIME_TO_NEXT_STEP = "elapsed_time_to_next_step"; + private ProductAnalyticsElapsedTime elapsedTimeToNextStep; + + public static final String JSON_PROPERTY_GROUPS = "groups"; + private List groups = new ArrayList<>(); + + public static final String JSON_PROPERTY_LABEL = "label"; + private String label; + + public static final String JSON_PROPERTY_UNIT = "unit"; + private String unit; + + public static final String JSON_PROPERTY_VALUE = "value"; + private Double value; + + public ProductAnalyticsJourneyFunnelStep() {} + + @JsonCreator + public ProductAnalyticsJourneyFunnelStep( + @JsonProperty(required = true, value = JSON_PROPERTY_ELAPSED_TIME_TO_NEXT_STEP) + ProductAnalyticsElapsedTime elapsedTimeToNextStep, + @JsonProperty(required = true, value = JSON_PROPERTY_GROUPS) + List groups, + @JsonProperty(required = true, value = JSON_PROPERTY_LABEL) String label, + @JsonProperty(required = true, value = JSON_PROPERTY_UNIT) String unit, + @JsonProperty(required = true, value = JSON_PROPERTY_VALUE) Double value) { + this.elapsedTimeToNextStep = elapsedTimeToNextStep; + this.unparsed |= elapsedTimeToNextStep.unparsed; + this.groups = groups; + for (ProductAnalyticsJourneyFunnelStepGroup item : groups) { + this.unparsed |= item.unparsed; + } + this.label = label; + this.unit = unit; + this.value = value; + } + + public ProductAnalyticsJourneyFunnelStep elapsedTimeToNextStep( + ProductAnalyticsElapsedTime elapsedTimeToNextStep) { + this.elapsedTimeToNextStep = elapsedTimeToNextStep; + this.unparsed |= elapsedTimeToNextStep.unparsed; + return this; + } + + /** + * Elapsed time statistics (min/max/avg in milliseconds). + * + * @return elapsedTimeToNextStep + */ + @JsonProperty(JSON_PROPERTY_ELAPSED_TIME_TO_NEXT_STEP) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsElapsedTime getElapsedTimeToNextStep() { + return elapsedTimeToNextStep; + } + + public void setElapsedTimeToNextStep(ProductAnalyticsElapsedTime elapsedTimeToNextStep) { + this.elapsedTimeToNextStep = elapsedTimeToNextStep; + if (elapsedTimeToNextStep != null) { + this.unparsed |= elapsedTimeToNextStep.unparsed; + } + } + + public ProductAnalyticsJourneyFunnelStep groups( + List groups) { + this.groups = groups; + for (ProductAnalyticsJourneyFunnelStepGroup item : groups) { + this.unparsed |= item.unparsed; + } + return this; + } + + public ProductAnalyticsJourneyFunnelStep addGroupsItem( + ProductAnalyticsJourneyFunnelStepGroup groupsItem) { + this.groups.add(groupsItem); + this.unparsed |= groupsItem.unparsed; + return this; + } + + /** + * Breakdown of this step by the requested group-by facets. + * + * @return groups + */ + @JsonProperty(JSON_PROPERTY_GROUPS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getGroups() { + return groups; + } + + public void setGroups(List groups) { + this.groups = groups; + if (groups != null) { + for (ProductAnalyticsJourneyFunnelStepGroup item : groups) { + this.unparsed |= item.unparsed; + } + } + } + + public ProductAnalyticsJourneyFunnelStep label(String label) { + this.label = label; + return this; + } + + /** + * Label of the step, derived from the node alias. + * + * @return label + */ + @JsonProperty(JSON_PROPERTY_LABEL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getLabel() { + return label; + } + + public void setLabel(String label) { + this.label = label; + } + + public ProductAnalyticsJourneyFunnelStep unit(String unit) { + this.unit = unit; + return this; + } + + /** + * Unit of the elapsed time values. + * + * @return unit + */ + @JsonProperty(JSON_PROPERTY_UNIT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getUnit() { + return unit; + } + + public void setUnit(String unit) { + this.unit = unit; + } + + public ProductAnalyticsJourneyFunnelStep value(Double value) { + this.value = value; + return this; + } + + /** + * Value of the computed metric at this step. + * + * @return value + */ + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Double getValue() { + return value; + } + + public void setValue(Double 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 ProductAnalyticsJourneyFunnelStep + */ + @JsonAnySetter + public ProductAnalyticsJourneyFunnelStep 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 ProductAnalyticsJourneyFunnelStep object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsJourneyFunnelStep productAnalyticsJourneyFunnelStep = + (ProductAnalyticsJourneyFunnelStep) o; + return Objects.equals( + this.elapsedTimeToNextStep, productAnalyticsJourneyFunnelStep.elapsedTimeToNextStep) + && Objects.equals(this.groups, productAnalyticsJourneyFunnelStep.groups) + && Objects.equals(this.label, productAnalyticsJourneyFunnelStep.label) + && Objects.equals(this.unit, productAnalyticsJourneyFunnelStep.unit) + && Objects.equals(this.value, productAnalyticsJourneyFunnelStep.value) + && Objects.equals( + this.additionalProperties, productAnalyticsJourneyFunnelStep.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(elapsedTimeToNextStep, groups, label, unit, value, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsJourneyFunnelStep {\n"); + sb.append(" elapsedTimeToNextStep: ") + .append(toIndentedString(elapsedTimeToNextStep)) + .append("\n"); + sb.append(" groups: ").append(toIndentedString(groups)).append("\n"); + sb.append(" label: ").append(toIndentedString(label)).append("\n"); + sb.append(" unit: ").append(toIndentedString(unit)).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/ProductAnalyticsJourneyFunnelStepGroup.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyFunnelStepGroup.java new file mode 100644 index 00000000000..7d28ff8955c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyFunnelStepGroup.java @@ -0,0 +1,251 @@ +/* + * 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; + +/** Breakdown of a funnel step for one combination of group-by values. */ +@JsonPropertyOrder({ + ProductAnalyticsJourneyFunnelStepGroup.JSON_PROPERTY_CONVERSION_COUNT, + ProductAnalyticsJourneyFunnelStepGroup.JSON_PROPERTY_ELAPSED_TIME_TO_NEXT_STEP, + ProductAnalyticsJourneyFunnelStepGroup.JSON_PROPERTY_GROUP_TAGS, + ProductAnalyticsJourneyFunnelStepGroup.JSON_PROPERTY_VALUE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsJourneyFunnelStepGroup { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CONVERSION_COUNT = "conversion_count"; + private Long conversionCount; + + public static final String JSON_PROPERTY_ELAPSED_TIME_TO_NEXT_STEP = "elapsed_time_to_next_step"; + private ProductAnalyticsElapsedTime elapsedTimeToNextStep; + + public static final String JSON_PROPERTY_GROUP_TAGS = "group_tags"; + private List groupTags = new ArrayList<>(); + + public static final String JSON_PROPERTY_VALUE = "value"; + private Double value; + + public ProductAnalyticsJourneyFunnelStepGroup() {} + + @JsonCreator + public ProductAnalyticsJourneyFunnelStepGroup( + @JsonProperty(required = true, value = JSON_PROPERTY_CONVERSION_COUNT) Long conversionCount, + @JsonProperty(required = true, value = JSON_PROPERTY_ELAPSED_TIME_TO_NEXT_STEP) + ProductAnalyticsElapsedTime elapsedTimeToNextStep, + @JsonProperty(required = true, value = JSON_PROPERTY_GROUP_TAGS) List groupTags, + @JsonProperty(required = true, value = JSON_PROPERTY_VALUE) Double value) { + this.conversionCount = conversionCount; + this.elapsedTimeToNextStep = elapsedTimeToNextStep; + this.unparsed |= elapsedTimeToNextStep.unparsed; + this.groupTags = groupTags; + this.value = value; + } + + public ProductAnalyticsJourneyFunnelStepGroup conversionCount(Long conversionCount) { + this.conversionCount = conversionCount; + return this; + } + + /** + * Number of entities in this group that reached the next step. + * + * @return conversionCount + */ + @JsonProperty(JSON_PROPERTY_CONVERSION_COUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getConversionCount() { + return conversionCount; + } + + public void setConversionCount(Long conversionCount) { + this.conversionCount = conversionCount; + } + + public ProductAnalyticsJourneyFunnelStepGroup elapsedTimeToNextStep( + ProductAnalyticsElapsedTime elapsedTimeToNextStep) { + this.elapsedTimeToNextStep = elapsedTimeToNextStep; + this.unparsed |= elapsedTimeToNextStep.unparsed; + return this; + } + + /** + * Elapsed time statistics (min/max/avg in milliseconds). + * + * @return elapsedTimeToNextStep + */ + @JsonProperty(JSON_PROPERTY_ELAPSED_TIME_TO_NEXT_STEP) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsElapsedTime getElapsedTimeToNextStep() { + return elapsedTimeToNextStep; + } + + public void setElapsedTimeToNextStep(ProductAnalyticsElapsedTime elapsedTimeToNextStep) { + this.elapsedTimeToNextStep = elapsedTimeToNextStep; + if (elapsedTimeToNextStep != null) { + this.unparsed |= elapsedTimeToNextStep.unparsed; + } + } + + public ProductAnalyticsJourneyFunnelStepGroup groupTags(List groupTags) { + this.groupTags = groupTags; + return this; + } + + public ProductAnalyticsJourneyFunnelStepGroup addGroupTagsItem(String groupTagsItem) { + this.groupTags.add(groupTagsItem); + return this; + } + + /** + * Group-by values identifying this cohort. + * + * @return groupTags + */ + @JsonProperty(JSON_PROPERTY_GROUP_TAGS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getGroupTags() { + return groupTags; + } + + public void setGroupTags(List groupTags) { + this.groupTags = groupTags; + } + + public ProductAnalyticsJourneyFunnelStepGroup value(Double value) { + this.value = value; + return this; + } + + /** + * Value of the computed metric for this group at this step. + * + * @return value + */ + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Double getValue() { + return value; + } + + public void setValue(Double 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 ProductAnalyticsJourneyFunnelStepGroup + */ + @JsonAnySetter + public ProductAnalyticsJourneyFunnelStepGroup 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 ProductAnalyticsJourneyFunnelStepGroup object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsJourneyFunnelStepGroup productAnalyticsJourneyFunnelStepGroup = + (ProductAnalyticsJourneyFunnelStepGroup) o; + return Objects.equals( + this.conversionCount, productAnalyticsJourneyFunnelStepGroup.conversionCount) + && Objects.equals( + this.elapsedTimeToNextStep, + productAnalyticsJourneyFunnelStepGroup.elapsedTimeToNextStep) + && Objects.equals(this.groupTags, productAnalyticsJourneyFunnelStepGroup.groupTags) + && Objects.equals(this.value, productAnalyticsJourneyFunnelStepGroup.value) + && Objects.equals( + this.additionalProperties, productAnalyticsJourneyFunnelStepGroup.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + conversionCount, elapsedTimeToNextStep, groupTags, value, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsJourneyFunnelStepGroup {\n"); + sb.append(" conversionCount: ").append(toIndentedString(conversionCount)).append("\n"); + sb.append(" elapsedTimeToNextStep: ") + .append(toIndentedString(elapsedTimeToNextStep)) + .append("\n"); + sb.append(" groupTags: ").append(toIndentedString(groupTags)).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/ProductAnalyticsJourneyListQuery.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyListQuery.java new file mode 100644 index 00000000000..d433ce881e2 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyListQuery.java @@ -0,0 +1,446 @@ +/* + * 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; + +/** Query definition for a journey list request. */ +@JsonPropertyOrder({ + ProductAnalyticsJourneyListQuery.JSON_PROPERTY_COMPUTED_COLUMNS, + ProductAnalyticsJourneyListQuery.JSON_PROPERTY_CONVERSION_TYPE, + ProductAnalyticsJourneyListQuery.JSON_PROPERTY_ENTITY_COLUMNS, + ProductAnalyticsJourneyListQuery.JSON_PROPERTY_ENTITY_FILTERS, + ProductAnalyticsJourneyListQuery.JSON_PROPERTY_GROUP_BY, + ProductAnalyticsJourneyListQuery.JSON_PROPERTY_LIMIT, + ProductAnalyticsJourneyListQuery.JSON_PROPERTY_SEARCH, + ProductAnalyticsJourneyListQuery.JSON_PROPERTY_SORT, + ProductAnalyticsJourneyListQuery.JSON_PROPERTY_TARGET +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsJourneyListQuery { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_COMPUTED_COLUMNS = "computed_columns"; + private List computedColumns = null; + + public static final String JSON_PROPERTY_CONVERSION_TYPE = "conversion_type"; + private ProductAnalyticsJourneyConversionType conversionType; + + public static final String JSON_PROPERTY_ENTITY_COLUMNS = "entity_columns"; + private List entityColumns = null; + + public static final String JSON_PROPERTY_ENTITY_FILTERS = "entity_filters"; + private String entityFilters; + + public static final String JSON_PROPERTY_GROUP_BY = "group_by"; + private List groupBy = null; + + public static final String JSON_PROPERTY_LIMIT = "limit"; + private Long limit; + + public static final String JSON_PROPERTY_SEARCH = "search"; + private ProductAnalyticsJourneySearch search; + + public static final String JSON_PROPERTY_SORT = "sort"; + private ProductAnalyticsJourneyListSort sort; + + public static final String JSON_PROPERTY_TARGET = "target"; + private ProductAnalyticsJourneyTarget target; + + public ProductAnalyticsJourneyListQuery() {} + + @JsonCreator + public ProductAnalyticsJourneyListQuery( + @JsonProperty(required = true, value = JSON_PROPERTY_SEARCH) + ProductAnalyticsJourneySearch search) { + this.search = search; + this.unparsed |= search.unparsed; + } + + public ProductAnalyticsJourneyListQuery computedColumns( + List computedColumns) { + this.computedColumns = computedColumns; + if (computedColumns != null) { + for (ProductAnalyticsJourneyComputedColumn item : computedColumns) { + this.unparsed |= item.unparsed; + } + } + return this; + } + + public ProductAnalyticsJourneyListQuery addComputedColumnsItem( + ProductAnalyticsJourneyComputedColumn computedColumnsItem) { + if (this.computedColumns == null) { + this.computedColumns = new ArrayList<>(); + } + this.computedColumns.add(computedColumnsItem); + this.unparsed |= computedColumnsItem.unparsed; + return this; + } + + /** + * Computed columns to add to each row. + * + * @return computedColumns + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COMPUTED_COLUMNS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getComputedColumns() { + return computedColumns; + } + + public void setComputedColumns(List computedColumns) { + this.computedColumns = computedColumns; + if (computedColumns != null) { + for (ProductAnalyticsJourneyComputedColumn item : computedColumns) { + this.unparsed |= item.unparsed; + } + } + } + + public ProductAnalyticsJourneyListQuery conversionType( + ProductAnalyticsJourneyConversionType conversionType) { + this.conversionType = conversionType; + this.unparsed |= !conversionType.isValid(); + return this; + } + + /** + * Whether to return the entities that converted at the target step, or those that dropped off. + * + * @return conversionType + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONVERSION_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ProductAnalyticsJourneyConversionType getConversionType() { + return conversionType; + } + + public void setConversionType(ProductAnalyticsJourneyConversionType conversionType) { + if (!conversionType.isValid()) { + this.unparsed = true; + } + this.conversionType = conversionType; + } + + public ProductAnalyticsJourneyListQuery entityColumns(List entityColumns) { + this.entityColumns = entityColumns; + return this; + } + + public ProductAnalyticsJourneyListQuery addEntityColumnsItem(String entityColumnsItem) { + if (this.entityColumns == null) { + this.entityColumns = new ArrayList<>(); + } + this.entityColumns.add(entityColumnsItem); + return this; + } + + /** + * Attribute columns to return for each row, in addition to the identity join key and + * timestamp. + * + * @return entityColumns + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENTITY_COLUMNS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getEntityColumns() { + return entityColumns; + } + + public void setEntityColumns(List entityColumns) { + this.entityColumns = entityColumns; + } + + public ProductAnalyticsJourneyListQuery entityFilters(String entityFilters) { + this.entityFilters = entityFilters; + return this; + } + + /** + * Additional search query applied to the returned rows. + * + * @return entityFilters + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENTITY_FILTERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEntityFilters() { + return entityFilters; + } + + public void setEntityFilters(String entityFilters) { + this.entityFilters = entityFilters; + } + + public ProductAnalyticsJourneyListQuery groupBy(List groupBy) { + this.groupBy = groupBy; + if (groupBy != null) { + for (ProductAnalyticsGraphQueryGroupBy item : groupBy) { + this.unparsed |= item.unparsed; + } + } + return this; + } + + public ProductAnalyticsJourneyListQuery addGroupByItem( + ProductAnalyticsGraphQueryGroupBy groupByItem) { + if (this.groupBy == null) { + this.groupBy = new ArrayList<>(); + } + this.groupBy.add(groupByItem); + this.unparsed |= groupByItem.unparsed; + return this; + } + + /** + * Segments the results by the values of one or more facets. + * + * @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; + if (groupBy != null) { + for (ProductAnalyticsGraphQueryGroupBy item : groupBy) { + this.unparsed |= item.unparsed; + } + } + } + + public ProductAnalyticsJourneyListQuery limit(Long limit) { + this.limit = limit; + return this; + } + + /** + * Maximum number of rows to return. Omit it to let the service choose. minimum: 1 + * + * @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 ProductAnalyticsJourneyListQuery search(ProductAnalyticsJourneySearch search) { + this.search = search; + this.unparsed |= search.unparsed; + return this; + } + + /** + * Defines the steps of the journey and the filters applied to it. + * + * @return search + */ + @JsonProperty(JSON_PROPERTY_SEARCH) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsJourneySearch getSearch() { + return search; + } + + public void setSearch(ProductAnalyticsJourneySearch search) { + this.search = search; + if (search != null) { + this.unparsed |= search.unparsed; + } + } + + public ProductAnalyticsJourneyListQuery sort(ProductAnalyticsJourneyListSort sort) { + this.sort = sort; + this.unparsed |= sort.unparsed; + return this; + } + + /** + * Sort configuration for the returned rows. The sort is applied only when facet is + * one of the returned columns; otherwise it is ignored. + * + * @return sort + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SORT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ProductAnalyticsJourneyListSort getSort() { + return sort; + } + + public void setSort(ProductAnalyticsJourneyListSort sort) { + this.sort = sort; + if (sort != null) { + this.unparsed |= sort.unparsed; + } + } + + public ProductAnalyticsJourneyListQuery target(ProductAnalyticsJourneyTarget target) { + this.target = target; + this.unparsed |= target.unparsed; + return this; + } + + /** + * A reference to a step, or a range of steps, in the journey. Use a node target to + * name a single step, or a path target to name the range between two steps. + * + * @return target + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TARGET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ProductAnalyticsJourneyTarget getTarget() { + return target; + } + + public void setTarget(ProductAnalyticsJourneyTarget target) { + this.target = target; + if (target != null) { + this.unparsed |= target.unparsed; + } + } + + /** + * 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 ProductAnalyticsJourneyListQuery + */ + @JsonAnySetter + public ProductAnalyticsJourneyListQuery 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 ProductAnalyticsJourneyListQuery object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsJourneyListQuery productAnalyticsJourneyListQuery = + (ProductAnalyticsJourneyListQuery) o; + return Objects.equals(this.computedColumns, productAnalyticsJourneyListQuery.computedColumns) + && Objects.equals(this.conversionType, productAnalyticsJourneyListQuery.conversionType) + && Objects.equals(this.entityColumns, productAnalyticsJourneyListQuery.entityColumns) + && Objects.equals(this.entityFilters, productAnalyticsJourneyListQuery.entityFilters) + && Objects.equals(this.groupBy, productAnalyticsJourneyListQuery.groupBy) + && Objects.equals(this.limit, productAnalyticsJourneyListQuery.limit) + && Objects.equals(this.search, productAnalyticsJourneyListQuery.search) + && Objects.equals(this.sort, productAnalyticsJourneyListQuery.sort) + && Objects.equals(this.target, productAnalyticsJourneyListQuery.target) + && Objects.equals( + this.additionalProperties, productAnalyticsJourneyListQuery.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + computedColumns, + conversionType, + entityColumns, + entityFilters, + groupBy, + limit, + search, + sort, + target, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsJourneyListQuery {\n"); + sb.append(" computedColumns: ").append(toIndentedString(computedColumns)).append("\n"); + sb.append(" conversionType: ").append(toIndentedString(conversionType)).append("\n"); + sb.append(" entityColumns: ").append(toIndentedString(entityColumns)).append("\n"); + sb.append(" entityFilters: ").append(toIndentedString(entityFilters)).append("\n"); + sb.append(" groupBy: ").append(toIndentedString(groupBy)).append("\n"); + sb.append(" limit: ").append(toIndentedString(limit)).append("\n"); + sb.append(" search: ").append(toIndentedString(search)).append("\n"); + sb.append(" sort: ").append(toIndentedString(sort)).append("\n"); + sb.append(" target: ").append(toIndentedString(target)).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/ProductAnalyticsJourneyListRequest.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyListRequest.java new file mode 100644 index 00000000000..c209900a423 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyListRequest.java @@ -0,0 +1,152 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Request body for a journey list query. */ +@JsonPropertyOrder({ProductAnalyticsJourneyListRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsJourneyListRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private ProductAnalyticsJourneyListRequestData data; + + public ProductAnalyticsJourneyListRequest() {} + + @JsonCreator + public ProductAnalyticsJourneyListRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + ProductAnalyticsJourneyListRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public ProductAnalyticsJourneyListRequest data(ProductAnalyticsJourneyListRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * The single JSON:API resource carrying a journey list query. Its attributes hold the time window + * and the journey whose matching entities should be listed, one row each. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsJourneyListRequestData getData() { + return data; + } + + public void setData(ProductAnalyticsJourneyListRequestData data) { + this.data = data; + if (data != null) { + this.unparsed |= data.unparsed; + } + } + + /** + * 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 ProductAnalyticsJourneyListRequest + */ + @JsonAnySetter + public ProductAnalyticsJourneyListRequest 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 ProductAnalyticsJourneyListRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsJourneyListRequest productAnalyticsJourneyListRequest = + (ProductAnalyticsJourneyListRequest) o; + return Objects.equals(this.data, productAnalyticsJourneyListRequest.data) + && Objects.equals( + this.additionalProperties, productAnalyticsJourneyListRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsJourneyListRequest {\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/ProductAnalyticsJourneyListRequestAttributes.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyListRequestAttributes.java new file mode 100644 index 00000000000..5136b61a7f6 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyListRequestAttributes.java @@ -0,0 +1,212 @@ +/* + * 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 of a journey list request. */ +@JsonPropertyOrder({ + ProductAnalyticsJourneyListRequestAttributes.JSON_PROPERTY_FROM, + ProductAnalyticsJourneyListRequestAttributes.JSON_PROPERTY_QUERY, + ProductAnalyticsJourneyListRequestAttributes.JSON_PROPERTY_TO +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsJourneyListRequestAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_FROM = "from"; + private Long from; + + public static final String JSON_PROPERTY_QUERY = "query"; + private ProductAnalyticsJourneyListQuery query; + + public static final String JSON_PROPERTY_TO = "to"; + private Long to; + + public ProductAnalyticsJourneyListRequestAttributes() {} + + @JsonCreator + public ProductAnalyticsJourneyListRequestAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_FROM) Long from, + @JsonProperty(required = true, value = JSON_PROPERTY_QUERY) + ProductAnalyticsJourneyListQuery query, + @JsonProperty(required = true, value = JSON_PROPERTY_TO) Long to) { + this.from = from; + this.query = query; + this.unparsed |= query.unparsed; + this.to = to; + } + + public ProductAnalyticsJourneyListRequestAttributes from(Long from) { + this.from = from; + return this; + } + + /** + * Start of the query window, in epoch milliseconds. + * + * @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 ProductAnalyticsJourneyListRequestAttributes query( + ProductAnalyticsJourneyListQuery query) { + this.query = query; + this.unparsed |= query.unparsed; + return this; + } + + /** + * Query definition for a journey list request. + * + * @return query + */ + @JsonProperty(JSON_PROPERTY_QUERY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsJourneyListQuery getQuery() { + return query; + } + + public void setQuery(ProductAnalyticsJourneyListQuery query) { + this.query = query; + if (query != null) { + this.unparsed |= query.unparsed; + } + } + + public ProductAnalyticsJourneyListRequestAttributes to(Long to) { + this.to = to; + return this; + } + + /** + * End of the query window, 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 ProductAnalyticsJourneyListRequestAttributes + */ + @JsonAnySetter + public ProductAnalyticsJourneyListRequestAttributes 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 ProductAnalyticsJourneyListRequestAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsJourneyListRequestAttributes productAnalyticsJourneyListRequestAttributes = + (ProductAnalyticsJourneyListRequestAttributes) o; + return Objects.equals(this.from, productAnalyticsJourneyListRequestAttributes.from) + && Objects.equals(this.query, productAnalyticsJourneyListRequestAttributes.query) + && Objects.equals(this.to, productAnalyticsJourneyListRequestAttributes.to) + && Objects.equals( + this.additionalProperties, + productAnalyticsJourneyListRequestAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(from, query, to, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsJourneyListRequestAttributes {\n"); + sb.append(" from: ").append(toIndentedString(from)).append("\n"); + sb.append(" query: ").append(toIndentedString(query)).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/ProductAnalyticsJourneyListRequestData.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyListRequestData.java new file mode 100644 index 00000000000..f8b2bb5f1f2 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyListRequestData.java @@ -0,0 +1,191 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * The single JSON:API resource carrying a journey list query. Its attributes hold the time window + * and the journey whose matching entities should be listed, one row each. + */ +@JsonPropertyOrder({ + ProductAnalyticsJourneyListRequestData.JSON_PROPERTY_ATTRIBUTES, + ProductAnalyticsJourneyListRequestData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsJourneyListRequestData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private ProductAnalyticsJourneyListRequestAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ProductAnalyticsJourneyListRequestType type; + + public ProductAnalyticsJourneyListRequestData() {} + + @JsonCreator + public ProductAnalyticsJourneyListRequestData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + ProductAnalyticsJourneyListRequestAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + ProductAnalyticsJourneyListRequestType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public ProductAnalyticsJourneyListRequestData attributes( + ProductAnalyticsJourneyListRequestAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of a journey list request. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsJourneyListRequestAttributes getAttributes() { + return attributes; + } + + public void setAttributes(ProductAnalyticsJourneyListRequestAttributes attributes) { + this.attributes = attributes; + if (attributes != null) { + this.unparsed |= attributes.unparsed; + } + } + + public ProductAnalyticsJourneyListRequestData type(ProductAnalyticsJourneyListRequestType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The resource type identifier for a journey list request. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsJourneyListRequestType getType() { + return type; + } + + public void setType(ProductAnalyticsJourneyListRequestType 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 ProductAnalyticsJourneyListRequestData + */ + @JsonAnySetter + public ProductAnalyticsJourneyListRequestData 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 ProductAnalyticsJourneyListRequestData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsJourneyListRequestData productAnalyticsJourneyListRequestData = + (ProductAnalyticsJourneyListRequestData) o; + return Objects.equals(this.attributes, productAnalyticsJourneyListRequestData.attributes) + && Objects.equals(this.type, productAnalyticsJourneyListRequestData.type) + && Objects.equals( + this.additionalProperties, productAnalyticsJourneyListRequestData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsJourneyListRequestData {\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/ProductAnalyticsJourneyListRequestType.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyListRequestType.java new file mode 100644 index 00000000000..11ae4ba134b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyListRequestType.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 resource type identifier for a journey list request. */ +@JsonSerialize( + using = + ProductAnalyticsJourneyListRequestType.ProductAnalyticsJourneyListRequestTypeSerializer + .class) +public class ProductAnalyticsJourneyListRequestType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("journey_list_request")); + + public static final ProductAnalyticsJourneyListRequestType JOURNEY_LIST_REQUEST = + new ProductAnalyticsJourneyListRequestType("journey_list_request"); + + ProductAnalyticsJourneyListRequestType(String value) { + super(value, allowedValues); + } + + public static class ProductAnalyticsJourneyListRequestTypeSerializer + extends StdSerializer { + public ProductAnalyticsJourneyListRequestTypeSerializer( + Class t) { + super(t); + } + + public ProductAnalyticsJourneyListRequestTypeSerializer() { + this(null); + } + + @Override + public void serialize( + ProductAnalyticsJourneyListRequestType value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ProductAnalyticsJourneyListRequestType fromValue(String value) { + return new ProductAnalyticsJourneyListRequestType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyListResponse.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyListResponse.java new file mode 100644 index 00000000000..c8dff7e1007 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyListResponse.java @@ -0,0 +1,152 @@ +/* + * 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; + +/** Response for a journey list query. */ +@JsonPropertyOrder({ProductAnalyticsJourneyListResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsJourneyListResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private ProductAnalyticsJourneyListResponseData data; + + public ProductAnalyticsJourneyListResponse() {} + + @JsonCreator + public ProductAnalyticsJourneyListResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + ProductAnalyticsJourneyListResponseData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public ProductAnalyticsJourneyListResponse data(ProductAnalyticsJourneyListResponseData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * The single JSON:API resource holding the entities matching a journey. Its attributes contain + * the returned rows and the total number of rows that matched, ignoring limit. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsJourneyListResponseData getData() { + return data; + } + + public void setData(ProductAnalyticsJourneyListResponseData data) { + this.data = data; + if (data != null) { + this.unparsed |= data.unparsed; + } + } + + /** + * 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 ProductAnalyticsJourneyListResponse + */ + @JsonAnySetter + public ProductAnalyticsJourneyListResponse 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 ProductAnalyticsJourneyListResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsJourneyListResponse productAnalyticsJourneyListResponse = + (ProductAnalyticsJourneyListResponse) o; + return Objects.equals(this.data, productAnalyticsJourneyListResponse.data) + && Objects.equals( + this.additionalProperties, productAnalyticsJourneyListResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsJourneyListResponse {\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/ProductAnalyticsJourneyListResponseAttributes.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyListResponseAttributes.java new file mode 100644 index 00000000000..b8d0a12fd77 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyListResponseAttributes.java @@ -0,0 +1,221 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Attributes of a journey list response. */ +@JsonPropertyOrder({ + ProductAnalyticsJourneyListResponseAttributes.JSON_PROPERTY_ENTITY, + ProductAnalyticsJourneyListResponseAttributes.JSON_PROPERTY_RECORDS, + ProductAnalyticsJourneyListResponseAttributes.JSON_PROPERTY_TOTAL_COUNT +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsJourneyListResponseAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ENTITY = "entity"; + private ProductAnalyticsJourneyEntity entity; + + public static final String JSON_PROPERTY_RECORDS = "records"; + private List> records = new ArrayList<>(); + + public static final String JSON_PROPERTY_TOTAL_COUNT = "total_count"; + private Long totalCount; + + public ProductAnalyticsJourneyListResponseAttributes() {} + + @JsonCreator + public ProductAnalyticsJourneyListResponseAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_ENTITY) + ProductAnalyticsJourneyEntity entity, + @JsonProperty(required = true, value = JSON_PROPERTY_RECORDS) + List> records, + @JsonProperty(required = true, value = JSON_PROPERTY_TOTAL_COUNT) Long totalCount) { + this.entity = entity; + this.unparsed |= !entity.isValid(); + this.records = records; + this.totalCount = totalCount; + } + + public ProductAnalyticsJourneyListResponseAttributes entity( + ProductAnalyticsJourneyEntity entity) { + this.entity = entity; + this.unparsed |= !entity.isValid(); + return this; + } + + /** + * The kind of entity returned by a journey list query. + * + * @return entity + */ + @JsonProperty(JSON_PROPERTY_ENTITY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsJourneyEntity getEntity() { + return entity; + } + + public void setEntity(ProductAnalyticsJourneyEntity entity) { + if (!entity.isValid()) { + this.unparsed = true; + } + this.entity = entity; + } + + public ProductAnalyticsJourneyListResponseAttributes records(List> records) { + this.records = records; + return this; + } + + public ProductAnalyticsJourneyListResponseAttributes addRecordsItem( + Map recordsItem) { + this.records.add(recordsItem); + return this; + } + + /** + * The returned rows. + * + * @return records + */ + @JsonProperty(JSON_PROPERTY_RECORDS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List> getRecords() { + return records; + } + + public void setRecords(List> records) { + this.records = records; + } + + public ProductAnalyticsJourneyListResponseAttributes totalCount(Long totalCount) { + this.totalCount = totalCount; + return this; + } + + /** + * Total number of rows matching the query, ignoring limit. + * + * @return totalCount + */ + @JsonProperty(JSON_PROPERTY_TOTAL_COUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getTotalCount() { + return totalCount; + } + + public void setTotalCount(Long totalCount) { + this.totalCount = totalCount; + } + + /** + * 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 ProductAnalyticsJourneyListResponseAttributes + */ + @JsonAnySetter + public ProductAnalyticsJourneyListResponseAttributes 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 ProductAnalyticsJourneyListResponseAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsJourneyListResponseAttributes productAnalyticsJourneyListResponseAttributes = + (ProductAnalyticsJourneyListResponseAttributes) o; + return Objects.equals(this.entity, productAnalyticsJourneyListResponseAttributes.entity) + && Objects.equals(this.records, productAnalyticsJourneyListResponseAttributes.records) + && Objects.equals(this.totalCount, productAnalyticsJourneyListResponseAttributes.totalCount) + && Objects.equals( + this.additionalProperties, + productAnalyticsJourneyListResponseAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(entity, records, totalCount, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsJourneyListResponseAttributes {\n"); + sb.append(" entity: ").append(toIndentedString(entity)).append("\n"); + sb.append(" records: ").append(toIndentedString(records)).append("\n"); + sb.append(" totalCount: ").append(toIndentedString(totalCount)).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/ProductAnalyticsJourneyListResponseData.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyListResponseData.java new file mode 100644 index 00000000000..31eb8d7b5cc --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyListResponseData.java @@ -0,0 +1,221 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * The single JSON:API resource holding the entities matching a journey. Its attributes contain the + * returned rows and the total number of rows that matched, ignoring limit. + */ +@JsonPropertyOrder({ + ProductAnalyticsJourneyListResponseData.JSON_PROPERTY_ATTRIBUTES, + ProductAnalyticsJourneyListResponseData.JSON_PROPERTY_ID, + ProductAnalyticsJourneyListResponseData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsJourneyListResponseData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private ProductAnalyticsJourneyListResponseAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ProductAnalyticsJourneyListResponseType type; + + public ProductAnalyticsJourneyListResponseData() {} + + @JsonCreator + public ProductAnalyticsJourneyListResponseData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + ProductAnalyticsJourneyListResponseAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + ProductAnalyticsJourneyListResponseType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public ProductAnalyticsJourneyListResponseData attributes( + ProductAnalyticsJourneyListResponseAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of a journey list response. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsJourneyListResponseAttributes getAttributes() { + return attributes; + } + + public void setAttributes(ProductAnalyticsJourneyListResponseAttributes attributes) { + this.attributes = attributes; + if (attributes != null) { + this.unparsed |= attributes.unparsed; + } + } + + public ProductAnalyticsJourneyListResponseData id(String id) { + this.id = id; + return this; + } + + /** + * Identifier of this result. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public ProductAnalyticsJourneyListResponseData type( + ProductAnalyticsJourneyListResponseType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The resource type identifier for a journey list response. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsJourneyListResponseType getType() { + return type; + } + + public void setType(ProductAnalyticsJourneyListResponseType 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 ProductAnalyticsJourneyListResponseData + */ + @JsonAnySetter + public ProductAnalyticsJourneyListResponseData 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 ProductAnalyticsJourneyListResponseData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsJourneyListResponseData productAnalyticsJourneyListResponseData = + (ProductAnalyticsJourneyListResponseData) o; + return Objects.equals(this.attributes, productAnalyticsJourneyListResponseData.attributes) + && Objects.equals(this.id, productAnalyticsJourneyListResponseData.id) + && Objects.equals(this.type, productAnalyticsJourneyListResponseData.type) + && Objects.equals( + this.additionalProperties, + productAnalyticsJourneyListResponseData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsJourneyListResponseData {\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/ProductAnalyticsJourneyListResponseType.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyListResponseType.java new file mode 100644 index 00000000000..bba417a4be9 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyListResponseType.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 resource type identifier for a journey list response. */ +@JsonSerialize( + using = + ProductAnalyticsJourneyListResponseType.ProductAnalyticsJourneyListResponseTypeSerializer + .class) +public class ProductAnalyticsJourneyListResponseType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("journey_list_response")); + + public static final ProductAnalyticsJourneyListResponseType JOURNEY_LIST_RESPONSE = + new ProductAnalyticsJourneyListResponseType("journey_list_response"); + + ProductAnalyticsJourneyListResponseType(String value) { + super(value, allowedValues); + } + + public static class ProductAnalyticsJourneyListResponseTypeSerializer + extends StdSerializer { + public ProductAnalyticsJourneyListResponseTypeSerializer( + Class t) { + super(t); + } + + public ProductAnalyticsJourneyListResponseTypeSerializer() { + this(null); + } + + @Override + public void serialize( + ProductAnalyticsJourneyListResponseType value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ProductAnalyticsJourneyListResponseType fromValue(String value) { + return new ProductAnalyticsJourneyListResponseType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyListSort.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyListSort.java new file mode 100644 index 00000000000..09a416f046d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyListSort.java @@ -0,0 +1,173 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.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 the returned rows. The sort is applied only when facet is one + * of the returned columns; otherwise it is ignored. + */ +@JsonPropertyOrder({ + ProductAnalyticsJourneyListSort.JSON_PROPERTY_FACET, + ProductAnalyticsJourneyListSort.JSON_PROPERTY_ORDER +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsJourneyListSort { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_FACET = "facet"; + private String facet; + + public static final String JSON_PROPERTY_ORDER = "order"; + private QuerySortOrder order = QuerySortOrder.DESC; + + public ProductAnalyticsJourneyListSort facet(String facet) { + this.facet = facet; + return this; + } + + /** + * Column to sort on. + * + * @return facet + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FACET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFacet() { + return facet; + } + + public void setFacet(String facet) { + this.facet = facet; + } + + public ProductAnalyticsJourneyListSort 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 ProductAnalyticsJourneyListSort + */ + @JsonAnySetter + public ProductAnalyticsJourneyListSort 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 ProductAnalyticsJourneyListSort object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsJourneyListSort productAnalyticsJourneyListSort = + (ProductAnalyticsJourneyListSort) o; + return Objects.equals(this.facet, productAnalyticsJourneyListSort.facet) + && Objects.equals(this.order, productAnalyticsJourneyListSort.order) + && Objects.equals( + this.additionalProperties, productAnalyticsJourneyListSort.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(facet, order, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsJourneyListSort {\n"); + sb.append(" facet: ").append(toIndentedString(facet)).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/ProductAnalyticsJourneyNodeTarget.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyNodeTarget.java new file mode 100644 index 00000000000..daa0ac61696 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyNodeTarget.java @@ -0,0 +1,181 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** A reference to a single step of the journey. */ +@JsonPropertyOrder({ + ProductAnalyticsJourneyNodeTarget.JSON_PROPERTY_TYPE, + ProductAnalyticsJourneyNodeTarget.JSON_PROPERTY_VALUE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsJourneyNodeTarget { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_TYPE = "type"; + private ProductAnalyticsJourneyNodeTargetType type; + + public static final String JSON_PROPERTY_VALUE = "value"; + private String value; + + public ProductAnalyticsJourneyNodeTarget() {} + + @JsonCreator + public ProductAnalyticsJourneyNodeTarget( + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + ProductAnalyticsJourneyNodeTargetType type, + @JsonProperty(required = true, value = JSON_PROPERTY_VALUE) String value) { + this.type = type; + this.unparsed |= !type.isValid(); + this.value = value; + } + + public ProductAnalyticsJourneyNodeTarget type(ProductAnalyticsJourneyNodeTargetType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The discriminator identifying a target that references a single step. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsJourneyNodeTargetType getType() { + return type; + } + + public void setType(ProductAnalyticsJourneyNodeTargetType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + public ProductAnalyticsJourneyNodeTarget value(String value) { + this.value = value; + return this; + } + + /** + * Alias of the targeted node. + * + * @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 ProductAnalyticsJourneyNodeTarget + */ + @JsonAnySetter + public ProductAnalyticsJourneyNodeTarget 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 ProductAnalyticsJourneyNodeTarget object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsJourneyNodeTarget productAnalyticsJourneyNodeTarget = + (ProductAnalyticsJourneyNodeTarget) o; + return Objects.equals(this.type, productAnalyticsJourneyNodeTarget.type) + && Objects.equals(this.value, productAnalyticsJourneyNodeTarget.value) + && Objects.equals( + this.additionalProperties, productAnalyticsJourneyNodeTarget.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(type, value, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsJourneyNodeTarget {\n"); + sb.append(" type: ").append(toIndentedString(type)).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/ProductAnalyticsJourneyNodeTargetType.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyNodeTargetType.java new file mode 100644 index 00000000000..2bdba4a96dd --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyNodeTargetType.java @@ -0,0 +1,61 @@ +/* + * 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 discriminator identifying a target that references a single step. */ +@JsonSerialize( + using = + ProductAnalyticsJourneyNodeTargetType.ProductAnalyticsJourneyNodeTargetTypeSerializer.class) +public class ProductAnalyticsJourneyNodeTargetType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("node")); + + public static final ProductAnalyticsJourneyNodeTargetType NODE = + new ProductAnalyticsJourneyNodeTargetType("node"); + + ProductAnalyticsJourneyNodeTargetType(String value) { + super(value, allowedValues); + } + + public static class ProductAnalyticsJourneyNodeTargetTypeSerializer + extends StdSerializer { + public ProductAnalyticsJourneyNodeTargetTypeSerializer( + Class t) { + super(t); + } + + public ProductAnalyticsJourneyNodeTargetTypeSerializer() { + this(null); + } + + @Override + public void serialize( + ProductAnalyticsJourneyNodeTargetType value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ProductAnalyticsJourneyNodeTargetType fromValue(String value) { + return new ProductAnalyticsJourneyNodeTargetType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyPathTarget.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyPathTarget.java new file mode 100644 index 00000000000..6147402e783 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyPathTarget.java @@ -0,0 +1,209 @@ +/* + * 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 reference to the range of steps between two nodes of the journey. */ +@JsonPropertyOrder({ + ProductAnalyticsJourneyPathTarget.JSON_PROPERTY_END, + ProductAnalyticsJourneyPathTarget.JSON_PROPERTY_START, + ProductAnalyticsJourneyPathTarget.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsJourneyPathTarget { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_END = "end"; + private String end; + + public static final String JSON_PROPERTY_START = "start"; + private String start; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ProductAnalyticsJourneyPathTargetType type; + + public ProductAnalyticsJourneyPathTarget() {} + + @JsonCreator + public ProductAnalyticsJourneyPathTarget( + @JsonProperty(required = true, value = JSON_PROPERTY_END) String end, + @JsonProperty(required = true, value = JSON_PROPERTY_START) String start, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + ProductAnalyticsJourneyPathTargetType type) { + this.end = end; + this.start = start; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public ProductAnalyticsJourneyPathTarget end(String end) { + this.end = end; + return this; + } + + /** + * Alias of the node the path ends at. + * + * @return end + */ + @JsonProperty(JSON_PROPERTY_END) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getEnd() { + return end; + } + + public void setEnd(String end) { + this.end = end; + } + + public ProductAnalyticsJourneyPathTarget start(String start) { + this.start = start; + return this; + } + + /** + * Alias of the node the path starts at. + * + * @return start + */ + @JsonProperty(JSON_PROPERTY_START) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getStart() { + return start; + } + + public void setStart(String start) { + this.start = start; + } + + public ProductAnalyticsJourneyPathTarget type(ProductAnalyticsJourneyPathTargetType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The discriminator identifying a target that references a range of steps. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsJourneyPathTargetType getType() { + return type; + } + + public void setType(ProductAnalyticsJourneyPathTargetType 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 ProductAnalyticsJourneyPathTarget + */ + @JsonAnySetter + public ProductAnalyticsJourneyPathTarget 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 ProductAnalyticsJourneyPathTarget object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsJourneyPathTarget productAnalyticsJourneyPathTarget = + (ProductAnalyticsJourneyPathTarget) o; + return Objects.equals(this.end, productAnalyticsJourneyPathTarget.end) + && Objects.equals(this.start, productAnalyticsJourneyPathTarget.start) + && Objects.equals(this.type, productAnalyticsJourneyPathTarget.type) + && Objects.equals( + this.additionalProperties, productAnalyticsJourneyPathTarget.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(end, start, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsJourneyPathTarget {\n"); + sb.append(" end: ").append(toIndentedString(end)).append("\n"); + sb.append(" start: ").append(toIndentedString(start)).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/ProductAnalyticsJourneyPathTargetType.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyPathTargetType.java new file mode 100644 index 00000000000..f263eeba552 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyPathTargetType.java @@ -0,0 +1,61 @@ +/* + * 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 discriminator identifying a target that references a range of steps. */ +@JsonSerialize( + using = + ProductAnalyticsJourneyPathTargetType.ProductAnalyticsJourneyPathTargetTypeSerializer.class) +public class ProductAnalyticsJourneyPathTargetType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("path")); + + public static final ProductAnalyticsJourneyPathTargetType PATH = + new ProductAnalyticsJourneyPathTargetType("path"); + + ProductAnalyticsJourneyPathTargetType(String value) { + super(value, allowedValues); + } + + public static class ProductAnalyticsJourneyPathTargetTypeSerializer + extends StdSerializer { + public ProductAnalyticsJourneyPathTargetTypeSerializer( + Class t) { + super(t); + } + + public ProductAnalyticsJourneyPathTargetTypeSerializer() { + this(null); + } + + @Override + public void serialize( + ProductAnalyticsJourneyPathTargetType value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ProductAnalyticsJourneyPathTargetType fromValue(String value) { + return new ProductAnalyticsJourneyPathTargetType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyRequestType.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyRequestType.java new file mode 100644 index 00000000000..8b0abb96c6b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyRequestType.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; + +/** The resource type identifier for a journey funnel request. */ +@JsonSerialize( + using = ProductAnalyticsJourneyRequestType.ProductAnalyticsJourneyRequestTypeSerializer.class) +public class ProductAnalyticsJourneyRequestType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("journey_request")); + + public static final ProductAnalyticsJourneyRequestType JOURNEY_REQUEST = + new ProductAnalyticsJourneyRequestType("journey_request"); + + ProductAnalyticsJourneyRequestType(String value) { + super(value, allowedValues); + } + + public static class ProductAnalyticsJourneyRequestTypeSerializer + extends StdSerializer { + public ProductAnalyticsJourneyRequestTypeSerializer( + Class t) { + super(t); + } + + public ProductAnalyticsJourneyRequestTypeSerializer() { + this(null); + } + + @Override + public void serialize( + ProductAnalyticsJourneyRequestType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ProductAnalyticsJourneyRequestType fromValue(String value) { + return new ProductAnalyticsJourneyRequestType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyScalarCompute.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyScalarCompute.java new file mode 100644 index 00000000000..56bc28f642b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyScalarCompute.java @@ -0,0 +1,211 @@ +/* + * 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; + +/** Defines the metric computed over the journey for a scalar query. */ +@JsonPropertyOrder({ + ProductAnalyticsJourneyScalarCompute.JSON_PROPERTY_AGGREGATION, + ProductAnalyticsJourneyScalarCompute.JSON_PROPERTY_METRIC, + ProductAnalyticsJourneyScalarCompute.JSON_PROPERTY_TARGET +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsJourneyScalarCompute { + @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_TARGET = "target"; + private ProductAnalyticsJourneyTarget target; + + public ProductAnalyticsJourneyScalarCompute() {} + + @JsonCreator + public ProductAnalyticsJourneyScalarCompute( + @JsonProperty(required = true, value = JSON_PROPERTY_AGGREGATION) String aggregation) { + this.aggregation = aggregation; + } + + public ProductAnalyticsJourneyScalarCompute aggregation(String aggregation) { + this.aggregation = aggregation; + return this; + } + + /** + * Aggregation function: count, cardinality, avg, + * median, min, max, sum, or a percentile of the + * form pc<N> such as pc95. Defaults to cardinality. + * + * @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 ProductAnalyticsJourneyScalarCompute metric(String metric) { + this.metric = metric; + return this; + } + + /** + * Metric to aggregate on. Use a facet path such as @view.time_spent, or one of the + * journey metrics __dd.conversion, __dd.conversion_rate, + * __dd.time_to_convert, or __dd.dropoff_rate. Defaults to + * __dd.conversion. + * + * @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 ProductAnalyticsJourneyScalarCompute target(ProductAnalyticsJourneyTarget target) { + this.target = target; + this.unparsed |= target.unparsed; + return this; + } + + /** + * A reference to a step, or a range of steps, in the journey. Use a node target to + * name a single step, or a path target to name the range between two steps. + * + * @return target + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TARGET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ProductAnalyticsJourneyTarget getTarget() { + return target; + } + + public void setTarget(ProductAnalyticsJourneyTarget target) { + this.target = target; + if (target != null) { + this.unparsed |= target.unparsed; + } + } + + /** + * 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 ProductAnalyticsJourneyScalarCompute + */ + @JsonAnySetter + public ProductAnalyticsJourneyScalarCompute 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 ProductAnalyticsJourneyScalarCompute object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsJourneyScalarCompute productAnalyticsJourneyScalarCompute = + (ProductAnalyticsJourneyScalarCompute) o; + return Objects.equals(this.aggregation, productAnalyticsJourneyScalarCompute.aggregation) + && Objects.equals(this.metric, productAnalyticsJourneyScalarCompute.metric) + && Objects.equals(this.target, productAnalyticsJourneyScalarCompute.target) + && Objects.equals( + this.additionalProperties, productAnalyticsJourneyScalarCompute.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(aggregation, metric, target, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsJourneyScalarCompute {\n"); + sb.append(" aggregation: ").append(toIndentedString(aggregation)).append("\n"); + sb.append(" metric: ").append(toIndentedString(metric)).append("\n"); + sb.append(" target: ").append(toIndentedString(target)).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/ProductAnalyticsJourneyScalarQuery.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyScalarQuery.java new file mode 100644 index 00000000000..91e858873d7 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyScalarQuery.java @@ -0,0 +1,264 @@ +/* + * 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; + +/** Query definition for a journey scalar request. */ +@JsonPropertyOrder({ + ProductAnalyticsJourneyScalarQuery.JSON_PROPERTY_COMPUTE, + ProductAnalyticsJourneyScalarQuery.JSON_PROPERTY_GROUP_BY, + ProductAnalyticsJourneyScalarQuery.JSON_PROPERTY_QUERY_ID, + ProductAnalyticsJourneyScalarQuery.JSON_PROPERTY_SEARCH +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsJourneyScalarQuery { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_COMPUTE = "compute"; + private ProductAnalyticsJourneyScalarCompute compute; + + public static final String JSON_PROPERTY_GROUP_BY = "group_by"; + private List groupBy = null; + + public static final String JSON_PROPERTY_QUERY_ID = "query_id"; + private String queryId; + + public static final String JSON_PROPERTY_SEARCH = "search"; + private ProductAnalyticsJourneySearch search; + + public ProductAnalyticsJourneyScalarQuery() {} + + @JsonCreator + public ProductAnalyticsJourneyScalarQuery( + @JsonProperty(required = true, value = JSON_PROPERTY_COMPUTE) + ProductAnalyticsJourneyScalarCompute compute, + @JsonProperty(required = true, value = JSON_PROPERTY_SEARCH) + ProductAnalyticsJourneySearch search) { + this.compute = compute; + this.unparsed |= compute.unparsed; + this.search = search; + this.unparsed |= search.unparsed; + } + + public ProductAnalyticsJourneyScalarQuery compute(ProductAnalyticsJourneyScalarCompute compute) { + this.compute = compute; + this.unparsed |= compute.unparsed; + return this; + } + + /** + * Defines the metric computed over the journey for a scalar query. + * + * @return compute + */ + @JsonProperty(JSON_PROPERTY_COMPUTE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsJourneyScalarCompute getCompute() { + return compute; + } + + public void setCompute(ProductAnalyticsJourneyScalarCompute compute) { + this.compute = compute; + if (compute != null) { + this.unparsed |= compute.unparsed; + } + } + + public ProductAnalyticsJourneyScalarQuery groupBy( + List groupBy) { + this.groupBy = groupBy; + if (groupBy != null) { + for (ProductAnalyticsGraphQueryGroupBy item : groupBy) { + this.unparsed |= item.unparsed; + } + } + return this; + } + + public ProductAnalyticsJourneyScalarQuery addGroupByItem( + ProductAnalyticsGraphQueryGroupBy groupByItem) { + if (this.groupBy == null) { + this.groupBy = new ArrayList<>(); + } + this.groupBy.add(groupByItem); + this.unparsed |= groupByItem.unparsed; + return this; + } + + /** + * Segments the results by the values of one or more facets. + * + * @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; + if (groupBy != null) { + for (ProductAnalyticsGraphQueryGroupBy item : groupBy) { + this.unparsed |= item.unparsed; + } + } + } + + public ProductAnalyticsJourneyScalarQuery queryId(String queryId) { + this.queryId = queryId; + return this; + } + + /** + * Caller-defined identifier echoed back in the results. + * + * @return queryId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_QUERY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getQueryId() { + return queryId; + } + + public void setQueryId(String queryId) { + this.queryId = queryId; + } + + public ProductAnalyticsJourneyScalarQuery search(ProductAnalyticsJourneySearch search) { + this.search = search; + this.unparsed |= search.unparsed; + return this; + } + + /** + * Defines the steps of the journey and the filters applied to it. + * + * @return search + */ + @JsonProperty(JSON_PROPERTY_SEARCH) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsJourneySearch getSearch() { + return search; + } + + public void setSearch(ProductAnalyticsJourneySearch search) { + this.search = search; + if (search != null) { + this.unparsed |= search.unparsed; + } + } + + /** + * 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 ProductAnalyticsJourneyScalarQuery + */ + @JsonAnySetter + public ProductAnalyticsJourneyScalarQuery 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 ProductAnalyticsJourneyScalarQuery object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsJourneyScalarQuery productAnalyticsJourneyScalarQuery = + (ProductAnalyticsJourneyScalarQuery) o; + return Objects.equals(this.compute, productAnalyticsJourneyScalarQuery.compute) + && Objects.equals(this.groupBy, productAnalyticsJourneyScalarQuery.groupBy) + && Objects.equals(this.queryId, productAnalyticsJourneyScalarQuery.queryId) + && Objects.equals(this.search, productAnalyticsJourneyScalarQuery.search) + && Objects.equals( + this.additionalProperties, productAnalyticsJourneyScalarQuery.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(compute, groupBy, queryId, search, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsJourneyScalarQuery {\n"); + sb.append(" compute: ").append(toIndentedString(compute)).append("\n"); + sb.append(" groupBy: ").append(toIndentedString(groupBy)).append("\n"); + sb.append(" queryId: ").append(toIndentedString(queryId)).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/ProductAnalyticsJourneyScalarRequest.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyScalarRequest.java new file mode 100644 index 00000000000..beaf9abbbf4 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyScalarRequest.java @@ -0,0 +1,152 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Request body for a journey scalar query. */ +@JsonPropertyOrder({ProductAnalyticsJourneyScalarRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsJourneyScalarRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private ProductAnalyticsJourneyScalarRequestData data; + + public ProductAnalyticsJourneyScalarRequest() {} + + @JsonCreator + public ProductAnalyticsJourneyScalarRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + ProductAnalyticsJourneyScalarRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public ProductAnalyticsJourneyScalarRequest data(ProductAnalyticsJourneyScalarRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * The single JSON:API resource carrying a journey scalar query. Its attributes hold the time + * window and the journey metric to reduce to one value over that window. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsJourneyScalarRequestData getData() { + return data; + } + + public void setData(ProductAnalyticsJourneyScalarRequestData data) { + this.data = data; + if (data != null) { + this.unparsed |= data.unparsed; + } + } + + /** + * 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 ProductAnalyticsJourneyScalarRequest + */ + @JsonAnySetter + public ProductAnalyticsJourneyScalarRequest 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 ProductAnalyticsJourneyScalarRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsJourneyScalarRequest productAnalyticsJourneyScalarRequest = + (ProductAnalyticsJourneyScalarRequest) o; + return Objects.equals(this.data, productAnalyticsJourneyScalarRequest.data) + && Objects.equals( + this.additionalProperties, productAnalyticsJourneyScalarRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsJourneyScalarRequest {\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/ProductAnalyticsJourneyScalarRequestAttributes.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyScalarRequestAttributes.java new file mode 100644 index 00000000000..51a984c27ad --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyScalarRequestAttributes.java @@ -0,0 +1,212 @@ +/* + * 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 of a journey scalar request. */ +@JsonPropertyOrder({ + ProductAnalyticsJourneyScalarRequestAttributes.JSON_PROPERTY_FROM, + ProductAnalyticsJourneyScalarRequestAttributes.JSON_PROPERTY_QUERY, + ProductAnalyticsJourneyScalarRequestAttributes.JSON_PROPERTY_TO +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsJourneyScalarRequestAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_FROM = "from"; + private Long from; + + public static final String JSON_PROPERTY_QUERY = "query"; + private ProductAnalyticsJourneyScalarQuery query; + + public static final String JSON_PROPERTY_TO = "to"; + private Long to; + + public ProductAnalyticsJourneyScalarRequestAttributes() {} + + @JsonCreator + public ProductAnalyticsJourneyScalarRequestAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_FROM) Long from, + @JsonProperty(required = true, value = JSON_PROPERTY_QUERY) + ProductAnalyticsJourneyScalarQuery query, + @JsonProperty(required = true, value = JSON_PROPERTY_TO) Long to) { + this.from = from; + this.query = query; + this.unparsed |= query.unparsed; + this.to = to; + } + + public ProductAnalyticsJourneyScalarRequestAttributes from(Long from) { + this.from = from; + return this; + } + + /** + * Start of the query window, in epoch milliseconds. + * + * @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 ProductAnalyticsJourneyScalarRequestAttributes query( + ProductAnalyticsJourneyScalarQuery query) { + this.query = query; + this.unparsed |= query.unparsed; + return this; + } + + /** + * Query definition for a journey scalar request. + * + * @return query + */ + @JsonProperty(JSON_PROPERTY_QUERY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsJourneyScalarQuery getQuery() { + return query; + } + + public void setQuery(ProductAnalyticsJourneyScalarQuery query) { + this.query = query; + if (query != null) { + this.unparsed |= query.unparsed; + } + } + + public ProductAnalyticsJourneyScalarRequestAttributes to(Long to) { + this.to = to; + return this; + } + + /** + * End of the query window, 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 ProductAnalyticsJourneyScalarRequestAttributes + */ + @JsonAnySetter + public ProductAnalyticsJourneyScalarRequestAttributes 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 ProductAnalyticsJourneyScalarRequestAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsJourneyScalarRequestAttributes productAnalyticsJourneyScalarRequestAttributes = + (ProductAnalyticsJourneyScalarRequestAttributes) o; + return Objects.equals(this.from, productAnalyticsJourneyScalarRequestAttributes.from) + && Objects.equals(this.query, productAnalyticsJourneyScalarRequestAttributes.query) + && Objects.equals(this.to, productAnalyticsJourneyScalarRequestAttributes.to) + && Objects.equals( + this.additionalProperties, + productAnalyticsJourneyScalarRequestAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(from, query, to, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsJourneyScalarRequestAttributes {\n"); + sb.append(" from: ").append(toIndentedString(from)).append("\n"); + sb.append(" query: ").append(toIndentedString(query)).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/ProductAnalyticsJourneyScalarRequestData.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyScalarRequestData.java new file mode 100644 index 00000000000..aec9970da04 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyScalarRequestData.java @@ -0,0 +1,193 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * The single JSON:API resource carrying a journey scalar query. Its attributes hold the time window + * and the journey metric to reduce to one value over that window. + */ +@JsonPropertyOrder({ + ProductAnalyticsJourneyScalarRequestData.JSON_PROPERTY_ATTRIBUTES, + ProductAnalyticsJourneyScalarRequestData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsJourneyScalarRequestData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private ProductAnalyticsJourneyScalarRequestAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ProductAnalyticsFormulaJourneyRequestType type; + + public ProductAnalyticsJourneyScalarRequestData() {} + + @JsonCreator + public ProductAnalyticsJourneyScalarRequestData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + ProductAnalyticsJourneyScalarRequestAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + ProductAnalyticsFormulaJourneyRequestType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public ProductAnalyticsJourneyScalarRequestData attributes( + ProductAnalyticsJourneyScalarRequestAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of a journey scalar request. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsJourneyScalarRequestAttributes getAttributes() { + return attributes; + } + + public void setAttributes(ProductAnalyticsJourneyScalarRequestAttributes attributes) { + this.attributes = attributes; + if (attributes != null) { + this.unparsed |= attributes.unparsed; + } + } + + public ProductAnalyticsJourneyScalarRequestData type( + ProductAnalyticsFormulaJourneyRequestType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The resource type identifier for a journey timeseries or scalar request. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsFormulaJourneyRequestType getType() { + return type; + } + + public void setType(ProductAnalyticsFormulaJourneyRequestType 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 ProductAnalyticsJourneyScalarRequestData + */ + @JsonAnySetter + public ProductAnalyticsJourneyScalarRequestData 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 ProductAnalyticsJourneyScalarRequestData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsJourneyScalarRequestData productAnalyticsJourneyScalarRequestData = + (ProductAnalyticsJourneyScalarRequestData) o; + return Objects.equals(this.attributes, productAnalyticsJourneyScalarRequestData.attributes) + && Objects.equals(this.type, productAnalyticsJourneyScalarRequestData.type) + && Objects.equals( + this.additionalProperties, + productAnalyticsJourneyScalarRequestData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsJourneyScalarRequestData {\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/ProductAnalyticsJourneyScalarResponse.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyScalarResponse.java new file mode 100644 index 00000000000..ebe376e06cd --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyScalarResponse.java @@ -0,0 +1,153 @@ +/* + * 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; + +/** Response for a journey scalar query. */ +@JsonPropertyOrder({ProductAnalyticsJourneyScalarResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsJourneyScalarResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private ProductAnalyticsJourneyScalarResponseData data; + + public ProductAnalyticsJourneyScalarResponse() {} + + @JsonCreator + public ProductAnalyticsJourneyScalarResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + ProductAnalyticsJourneyScalarResponseData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public ProductAnalyticsJourneyScalarResponse data( + ProductAnalyticsJourneyScalarResponseData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * The single JSON:API resource holding journey scalar results. Its attributes contain one value + * per group, suitable for a query value or top list widget. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsJourneyScalarResponseData getData() { + return data; + } + + public void setData(ProductAnalyticsJourneyScalarResponseData data) { + this.data = data; + if (data != null) { + this.unparsed |= data.unparsed; + } + } + + /** + * 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 ProductAnalyticsJourneyScalarResponse + */ + @JsonAnySetter + public ProductAnalyticsJourneyScalarResponse 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 ProductAnalyticsJourneyScalarResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsJourneyScalarResponse productAnalyticsJourneyScalarResponse = + (ProductAnalyticsJourneyScalarResponse) o; + return Objects.equals(this.data, productAnalyticsJourneyScalarResponse.data) + && Objects.equals( + this.additionalProperties, productAnalyticsJourneyScalarResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsJourneyScalarResponse {\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/ProductAnalyticsJourneyScalarResponseData.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyScalarResponseData.java new file mode 100644 index 00000000000..cd4aafeee29 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyScalarResponseData.java @@ -0,0 +1,221 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * The single JSON:API resource holding journey scalar results. Its attributes contain one value per + * group, suitable for a query value or top list widget. + */ +@JsonPropertyOrder({ + ProductAnalyticsJourneyScalarResponseData.JSON_PROPERTY_ATTRIBUTES, + ProductAnalyticsJourneyScalarResponseData.JSON_PROPERTY_ID, + ProductAnalyticsJourneyScalarResponseData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsJourneyScalarResponseData { + @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 ProductAnalyticsJourneyScalarResponseType type; + + public ProductAnalyticsJourneyScalarResponseData() {} + + @JsonCreator + public ProductAnalyticsJourneyScalarResponseData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + ProductAnalyticsScalarResponseAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + ProductAnalyticsJourneyScalarResponseType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public ProductAnalyticsJourneyScalarResponseData attributes( + ProductAnalyticsScalarResponseAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of a scalar analytics response, containing the result columns. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsScalarResponseAttributes getAttributes() { + return attributes; + } + + public void setAttributes(ProductAnalyticsScalarResponseAttributes attributes) { + this.attributes = attributes; + if (attributes != null) { + this.unparsed |= attributes.unparsed; + } + } + + public ProductAnalyticsJourneyScalarResponseData id(String id) { + this.id = id; + return this; + } + + /** + * Identifier of this result. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public ProductAnalyticsJourneyScalarResponseData type( + ProductAnalyticsJourneyScalarResponseType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The resource type identifier for a journey scalar response. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsJourneyScalarResponseType getType() { + return type; + } + + public void setType(ProductAnalyticsJourneyScalarResponseType 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 ProductAnalyticsJourneyScalarResponseData + */ + @JsonAnySetter + public ProductAnalyticsJourneyScalarResponseData 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 ProductAnalyticsJourneyScalarResponseData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsJourneyScalarResponseData productAnalyticsJourneyScalarResponseData = + (ProductAnalyticsJourneyScalarResponseData) o; + return Objects.equals(this.attributes, productAnalyticsJourneyScalarResponseData.attributes) + && Objects.equals(this.id, productAnalyticsJourneyScalarResponseData.id) + && Objects.equals(this.type, productAnalyticsJourneyScalarResponseData.type) + && Objects.equals( + this.additionalProperties, + productAnalyticsJourneyScalarResponseData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsJourneyScalarResponseData {\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/ProductAnalyticsJourneyScalarResponseType.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyScalarResponseType.java new file mode 100644 index 00000000000..01603652b32 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyScalarResponseType.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 resource type identifier for a journey scalar response. */ +@JsonSerialize( + using = + ProductAnalyticsJourneyScalarResponseType + .ProductAnalyticsJourneyScalarResponseTypeSerializer.class) +public class ProductAnalyticsJourneyScalarResponseType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("journey_scalar_response")); + + public static final ProductAnalyticsJourneyScalarResponseType JOURNEY_SCALAR_RESPONSE = + new ProductAnalyticsJourneyScalarResponseType("journey_scalar_response"); + + ProductAnalyticsJourneyScalarResponseType(String value) { + super(value, allowedValues); + } + + public static class ProductAnalyticsJourneyScalarResponseTypeSerializer + extends StdSerializer { + public ProductAnalyticsJourneyScalarResponseTypeSerializer( + Class t) { + super(t); + } + + public ProductAnalyticsJourneyScalarResponseTypeSerializer() { + this(null); + } + + @Override + public void serialize( + ProductAnalyticsJourneyScalarResponseType value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ProductAnalyticsJourneyScalarResponseType fromValue(String value) { + return new ProductAnalyticsJourneyScalarResponseType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneySearch.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneySearch.java new file mode 100644 index 00000000000..b5260e08bbb --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneySearch.java @@ -0,0 +1,246 @@ +/* + * 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; + +/** Defines the steps of the journey and the filters applied to it. */ +@JsonPropertyOrder({ + ProductAnalyticsJourneySearch.JSON_PROPERTY_EXPRESSION, + ProductAnalyticsJourneySearch.JSON_PROPERTY_FILTERS, + ProductAnalyticsJourneySearch.JSON_PROPERTY_JOIN_KEYS, + ProductAnalyticsJourneySearch.JSON_PROPERTY_NODE_OBJECTS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsJourneySearch { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_EXPRESSION = "expression"; + private String expression; + + public static final String JSON_PROPERTY_FILTERS = "filters"; + private ProductAnalyticsJourneySearchFilters filters; + + public static final String JSON_PROPERTY_JOIN_KEYS = "join_keys"; + private ProductAnalyticsJoinKeys joinKeys; + + public static final String JSON_PROPERTY_NODE_OBJECTS = "node_objects"; + private Map nodeObjects = + new HashMap(); + + public ProductAnalyticsJourneySearch() {} + + @JsonCreator + public ProductAnalyticsJourneySearch( + @JsonProperty(required = true, value = JSON_PROPERTY_EXPRESSION) String expression, + @JsonProperty(required = true, value = JSON_PROPERTY_NODE_OBJECTS) + Map nodeObjects) { + this.expression = expression; + this.nodeObjects = nodeObjects; + } + + public ProductAnalyticsJourneySearch expression(String expression) { + this.expression = expression; + return this; + } + + /** + * Expression combining the node aliases in order, for example A -> B -> C. + * + * @return expression + */ + @JsonProperty(JSON_PROPERTY_EXPRESSION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getExpression() { + return expression; + } + + public void setExpression(String expression) { + this.expression = expression; + } + + public ProductAnalyticsJourneySearch filters(ProductAnalyticsJourneySearchFilters filters) { + this.filters = filters; + this.unparsed |= filters.unparsed; + return this; + } + + /** + * Filters applied on top of the journey step expression. + * + * @return filters + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILTERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ProductAnalyticsJourneySearchFilters getFilters() { + return filters; + } + + public void setFilters(ProductAnalyticsJourneySearchFilters filters) { + this.filters = filters; + if (filters != null) { + this.unparsed |= filters.unparsed; + } + } + + public ProductAnalyticsJourneySearch joinKeys(ProductAnalyticsJoinKeys joinKeys) { + this.joinKeys = joinKeys; + this.unparsed |= joinKeys.unparsed; + return this; + } + + /** + * Identity join keys used to stitch events belonging to the same user or session. + * + * @return joinKeys + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_JOIN_KEYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ProductAnalyticsJoinKeys getJoinKeys() { + return joinKeys; + } + + public void setJoinKeys(ProductAnalyticsJoinKeys joinKeys) { + this.joinKeys = joinKeys; + if (joinKeys != null) { + this.unparsed |= joinKeys.unparsed; + } + } + + public ProductAnalyticsJourneySearch nodeObjects( + Map nodeObjects) { + this.nodeObjects = nodeObjects; + return this; + } + + public ProductAnalyticsJourneySearch putNodeObjectsItem( + String key, ProductAnalyticsBaseQuery nodeObjectsItem) { + this.nodeObjects.put(key, nodeObjectsItem); + return this; + } + + /** + * Map of node alias to the query matching that step of the journey. Every alias used in + * expression must have an entry here. + * + * @return nodeObjects + */ + @JsonProperty(JSON_PROPERTY_NODE_OBJECTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Map getNodeObjects() { + return nodeObjects; + } + + public void setNodeObjects(Map nodeObjects) { + this.nodeObjects = nodeObjects; + } + + /** + * 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 ProductAnalyticsJourneySearch + */ + @JsonAnySetter + public ProductAnalyticsJourneySearch 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 ProductAnalyticsJourneySearch object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsJourneySearch productAnalyticsJourneySearch = (ProductAnalyticsJourneySearch) o; + return Objects.equals(this.expression, productAnalyticsJourneySearch.expression) + && Objects.equals(this.filters, productAnalyticsJourneySearch.filters) + && Objects.equals(this.joinKeys, productAnalyticsJourneySearch.joinKeys) + && Objects.equals(this.nodeObjects, productAnalyticsJourneySearch.nodeObjects) + && Objects.equals( + this.additionalProperties, productAnalyticsJourneySearch.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(expression, filters, joinKeys, nodeObjects, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsJourneySearch {\n"); + sb.append(" expression: ").append(toIndentedString(expression)).append("\n"); + sb.append(" filters: ").append(toIndentedString(filters)).append("\n"); + sb.append(" joinKeys: ").append(toIndentedString(joinKeys)).append("\n"); + sb.append(" nodeObjects: ").append(toIndentedString(nodeObjects)).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/ProductAnalyticsJourneySearchFilters.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneySearchFilters.java new file mode 100644 index 00000000000..d86981be118 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneySearchFilters.java @@ -0,0 +1,223 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.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; + +/** Filters applied on top of the journey step expression. */ +@JsonPropertyOrder({ + ProductAnalyticsJourneySearchFilters.JSON_PROPERTY_AUDIENCE_FILTERS, + ProductAnalyticsJourneySearchFilters.JSON_PROPERTY_GRAPH_FILTERS, + ProductAnalyticsJourneySearchFilters.JSON_PROPERTY_STRING_FILTER +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsJourneySearchFilters { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_AUDIENCE_FILTERS = "audience_filters"; + private ProductAnalyticsJourneyAudienceFilters audienceFilters; + + public static final String JSON_PROPERTY_GRAPH_FILTERS = "graph_filters"; + private List graphFilters = null; + + public static final String JSON_PROPERTY_STRING_FILTER = "string_filter"; + private String stringFilter; + + public ProductAnalyticsJourneySearchFilters audienceFilters( + ProductAnalyticsJourneyAudienceFilters audienceFilters) { + this.audienceFilters = audienceFilters; + this.unparsed |= audienceFilters.unparsed; + return this; + } + + /** + * Restricts the journey to an audience built from named sub-queries. Sub-query names must be + * unique across users, segments, and accounts. + * + * @return audienceFilters + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AUDIENCE_FILTERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ProductAnalyticsJourneyAudienceFilters getAudienceFilters() { + return audienceFilters; + } + + public void setAudienceFilters(ProductAnalyticsJourneyAudienceFilters audienceFilters) { + this.audienceFilters = audienceFilters; + if (audienceFilters != null) { + this.unparsed |= audienceFilters.unparsed; + } + } + + public ProductAnalyticsJourneySearchFilters graphFilters( + List graphFilters) { + this.graphFilters = graphFilters; + if (graphFilters != null) { + for (ProductAnalyticsJourneySearchGraphFilter item : graphFilters) { + this.unparsed |= item.unparsed; + } + } + return this; + } + + public ProductAnalyticsJourneySearchFilters addGraphFiltersItem( + ProductAnalyticsJourneySearchGraphFilter graphFiltersItem) { + if (this.graphFilters == null) { + this.graphFilters = new ArrayList<>(); + } + this.graphFilters.add(graphFiltersItem); + this.unparsed |= graphFiltersItem.unparsed; + return this; + } + + /** + * Filters on journey-level metrics such as time to convert. + * + * @return graphFilters + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_GRAPH_FILTERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getGraphFilters() { + return graphFilters; + } + + public void setGraphFilters(List graphFilters) { + this.graphFilters = graphFilters; + if (graphFilters != null) { + for (ProductAnalyticsJourneySearchGraphFilter item : graphFilters) { + this.unparsed |= item.unparsed; + } + } + } + + public ProductAnalyticsJourneySearchFilters stringFilter(String stringFilter) { + this.stringFilter = stringFilter; + return this; + } + + /** + * Free-text search query applied to the whole journey. + * + * @return stringFilter + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STRING_FILTER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getStringFilter() { + return stringFilter; + } + + public void setStringFilter(String stringFilter) { + this.stringFilter = stringFilter; + } + + /** + * 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 ProductAnalyticsJourneySearchFilters + */ + @JsonAnySetter + public ProductAnalyticsJourneySearchFilters 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 ProductAnalyticsJourneySearchFilters object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsJourneySearchFilters productAnalyticsJourneySearchFilters = + (ProductAnalyticsJourneySearchFilters) o; + return Objects.equals( + this.audienceFilters, productAnalyticsJourneySearchFilters.audienceFilters) + && Objects.equals(this.graphFilters, productAnalyticsJourneySearchFilters.graphFilters) + && Objects.equals(this.stringFilter, productAnalyticsJourneySearchFilters.stringFilter) + && Objects.equals( + this.additionalProperties, productAnalyticsJourneySearchFilters.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(audienceFilters, graphFilters, stringFilter, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsJourneySearchFilters {\n"); + sb.append(" audienceFilters: ").append(toIndentedString(audienceFilters)).append("\n"); + sb.append(" graphFilters: ").append(toIndentedString(graphFilters)).append("\n"); + sb.append(" stringFilter: ").append(toIndentedString(stringFilter)).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/ProductAnalyticsJourneySearchGraphFilter.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneySearchGraphFilter.java new file mode 100644 index 00000000000..3c101b22865 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneySearchGraphFilter.java @@ -0,0 +1,250 @@ +/* + * 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 filter applied to a step, or a range of steps, of the journey graph. */ +@JsonPropertyOrder({ + ProductAnalyticsJourneySearchGraphFilter.JSON_PROPERTY_NAME, + ProductAnalyticsJourneySearchGraphFilter.JSON_PROPERTY_OPERATOR, + ProductAnalyticsJourneySearchGraphFilter.JSON_PROPERTY_TARGET, + ProductAnalyticsJourneySearchGraphFilter.JSON_PROPERTY_VALUE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsJourneySearchGraphFilter { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_NAME = "name"; + private ProductAnalyticsJourneySearchGraphFilterName name; + + public static final String JSON_PROPERTY_OPERATOR = "operator"; + private ProductAnalyticsJourneySearchGraphFilterOperator operator; + + public static final String JSON_PROPERTY_TARGET = "target"; + private ProductAnalyticsJourneyTarget target; + + public static final String JSON_PROPERTY_VALUE = "value"; + private Long value; + + public ProductAnalyticsJourneySearchGraphFilter() {} + + @JsonCreator + public ProductAnalyticsJourneySearchGraphFilter( + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) + ProductAnalyticsJourneySearchGraphFilterName name, + @JsonProperty(required = true, value = JSON_PROPERTY_OPERATOR) + ProductAnalyticsJourneySearchGraphFilterOperator operator, + @JsonProperty(required = true, value = JSON_PROPERTY_VALUE) Long value) { + this.name = name; + this.unparsed |= !name.isValid(); + this.operator = operator; + this.unparsed |= !operator.isValid(); + this.value = value; + } + + public ProductAnalyticsJourneySearchGraphFilter name( + ProductAnalyticsJourneySearchGraphFilterName name) { + this.name = name; + this.unparsed |= !name.isValid(); + return this; + } + + /** + * The journey-level metric the graph filter applies to. + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsJourneySearchGraphFilterName getName() { + return name; + } + + public void setName(ProductAnalyticsJourneySearchGraphFilterName name) { + if (!name.isValid()) { + this.unparsed = true; + } + this.name = name; + } + + public ProductAnalyticsJourneySearchGraphFilter operator( + ProductAnalyticsJourneySearchGraphFilterOperator operator) { + this.operator = operator; + this.unparsed |= !operator.isValid(); + return this; + } + + /** + * Comparison operator applied to the graph filter value. + * + * @return operator + */ + @JsonProperty(JSON_PROPERTY_OPERATOR) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsJourneySearchGraphFilterOperator getOperator() { + return operator; + } + + public void setOperator(ProductAnalyticsJourneySearchGraphFilterOperator operator) { + if (!operator.isValid()) { + this.unparsed = true; + } + this.operator = operator; + } + + public ProductAnalyticsJourneySearchGraphFilter target(ProductAnalyticsJourneyTarget target) { + this.target = target; + this.unparsed |= target.unparsed; + return this; + } + + /** + * A reference to a step, or a range of steps, in the journey. Use a node target to + * name a single step, or a path target to name the range between two steps. + * + * @return target + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TARGET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ProductAnalyticsJourneyTarget getTarget() { + return target; + } + + public void setTarget(ProductAnalyticsJourneyTarget target) { + this.target = target; + if (target != null) { + this.unparsed |= target.unparsed; + } + } + + public ProductAnalyticsJourneySearchGraphFilter value(Long value) { + this.value = value; + return this; + } + + /** + * Value compared against the metric. Durations are expressed in milliseconds. + * + * @return value + */ + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getValue() { + return value; + } + + public void setValue(Long 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 ProductAnalyticsJourneySearchGraphFilter + */ + @JsonAnySetter + public ProductAnalyticsJourneySearchGraphFilter 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 ProductAnalyticsJourneySearchGraphFilter object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsJourneySearchGraphFilter productAnalyticsJourneySearchGraphFilter = + (ProductAnalyticsJourneySearchGraphFilter) o; + return Objects.equals(this.name, productAnalyticsJourneySearchGraphFilter.name) + && Objects.equals(this.operator, productAnalyticsJourneySearchGraphFilter.operator) + && Objects.equals(this.target, productAnalyticsJourneySearchGraphFilter.target) + && Objects.equals(this.value, productAnalyticsJourneySearchGraphFilter.value) + && Objects.equals( + this.additionalProperties, + productAnalyticsJourneySearchGraphFilter.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, operator, target, value, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsJourneySearchGraphFilter {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" operator: ").append(toIndentedString(operator)).append("\n"); + sb.append(" target: ").append(toIndentedString(target)).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/ProductAnalyticsJourneySearchGraphFilterName.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneySearchGraphFilterName.java new file mode 100644 index 00000000000..492eecfe049 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneySearchGraphFilterName.java @@ -0,0 +1,68 @@ +/* + * 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 journey-level metric the graph filter applies to. */ +@JsonSerialize( + using = + ProductAnalyticsJourneySearchGraphFilterName + .ProductAnalyticsJourneySearchGraphFilterNameSerializer.class) +public class ProductAnalyticsJourneySearchGraphFilterName extends ModelEnum { + + private static final Set allowedValues = + new HashSet( + Arrays.asList("__dd.time_to_convert", "__dd.session", "__dd.dropoff_rate")); + + public static final ProductAnalyticsJourneySearchGraphFilterName TIME_TO_CONVERT = + new ProductAnalyticsJourneySearchGraphFilterName("__dd.time_to_convert"); + public static final ProductAnalyticsJourneySearchGraphFilterName SESSION = + new ProductAnalyticsJourneySearchGraphFilterName("__dd.session"); + public static final ProductAnalyticsJourneySearchGraphFilterName DROPOFF_RATE = + new ProductAnalyticsJourneySearchGraphFilterName("__dd.dropoff_rate"); + + ProductAnalyticsJourneySearchGraphFilterName(String value) { + super(value, allowedValues); + } + + public static class ProductAnalyticsJourneySearchGraphFilterNameSerializer + extends StdSerializer { + public ProductAnalyticsJourneySearchGraphFilterNameSerializer( + Class t) { + super(t); + } + + public ProductAnalyticsJourneySearchGraphFilterNameSerializer() { + this(null); + } + + @Override + public void serialize( + ProductAnalyticsJourneySearchGraphFilterName value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ProductAnalyticsJourneySearchGraphFilterName fromValue(String value) { + return new ProductAnalyticsJourneySearchGraphFilterName(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneySearchGraphFilterOperator.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneySearchGraphFilterOperator.java new file mode 100644 index 00000000000..61b31359ecb --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneySearchGraphFilterOperator.java @@ -0,0 +1,71 @@ +/* + * 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; + +/** Comparison operator applied to the graph filter value. */ +@JsonSerialize( + using = + ProductAnalyticsJourneySearchGraphFilterOperator + .ProductAnalyticsJourneySearchGraphFilterOperatorSerializer.class) +public class ProductAnalyticsJourneySearchGraphFilterOperator extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("=", "<", ">", "<=", ">=")); + + public static final ProductAnalyticsJourneySearchGraphFilterOperator EQUAL = + new ProductAnalyticsJourneySearchGraphFilterOperator("="); + public static final ProductAnalyticsJourneySearchGraphFilterOperator LESS_THAN = + new ProductAnalyticsJourneySearchGraphFilterOperator("<"); + public static final ProductAnalyticsJourneySearchGraphFilterOperator GREATER_THAN = + new ProductAnalyticsJourneySearchGraphFilterOperator(">"); + public static final ProductAnalyticsJourneySearchGraphFilterOperator LESS_THAN_OR_EQUAL = + new ProductAnalyticsJourneySearchGraphFilterOperator("<="); + public static final ProductAnalyticsJourneySearchGraphFilterOperator GREATER_THAN_OR_EQUAL = + new ProductAnalyticsJourneySearchGraphFilterOperator(">="); + + ProductAnalyticsJourneySearchGraphFilterOperator(String value) { + super(value, allowedValues); + } + + public static class ProductAnalyticsJourneySearchGraphFilterOperatorSerializer + extends StdSerializer { + public ProductAnalyticsJourneySearchGraphFilterOperatorSerializer( + Class t) { + super(t); + } + + public ProductAnalyticsJourneySearchGraphFilterOperatorSerializer() { + this(null); + } + + @Override + public void serialize( + ProductAnalyticsJourneySearchGraphFilterOperator value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ProductAnalyticsJourneySearchGraphFilterOperator fromValue(String value) { + return new ProductAnalyticsJourneySearchGraphFilterOperator(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyTarget.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyTarget.java new file mode 100644 index 00000000000..ef483fadbe7 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyTarget.java @@ -0,0 +1,297 @@ +/* + * 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 = ProductAnalyticsJourneyTarget.ProductAnalyticsJourneyTargetDeserializer.class) +@JsonSerialize(using = ProductAnalyticsJourneyTarget.ProductAnalyticsJourneyTargetSerializer.class) +public class ProductAnalyticsJourneyTarget extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(ProductAnalyticsJourneyTarget.class.getName()); + + @JsonIgnore public boolean unparsed = false; + + public static class ProductAnalyticsJourneyTargetSerializer + extends StdSerializer { + public ProductAnalyticsJourneyTargetSerializer(Class t) { + super(t); + } + + public ProductAnalyticsJourneyTargetSerializer() { + this(null); + } + + @Override + public void serialize( + ProductAnalyticsJourneyTarget value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.getActualInstance()); + } + } + + public static class ProductAnalyticsJourneyTargetDeserializer + extends StdDeserializer { + public ProductAnalyticsJourneyTargetDeserializer() { + this(ProductAnalyticsJourneyTarget.class); + } + + public ProductAnalyticsJourneyTargetDeserializer(Class vc) { + super(vc); + } + + @Override + public ProductAnalyticsJourneyTarget 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 ProductAnalyticsJourneyNodeTarget + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (ProductAnalyticsJourneyNodeTarget.class.equals(Integer.class) + || ProductAnalyticsJourneyNodeTarget.class.equals(Long.class) + || ProductAnalyticsJourneyNodeTarget.class.equals(Float.class) + || ProductAnalyticsJourneyNodeTarget.class.equals(Double.class) + || ProductAnalyticsJourneyNodeTarget.class.equals(Boolean.class) + || ProductAnalyticsJourneyNodeTarget.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((ProductAnalyticsJourneyNodeTarget.class.equals(Integer.class) + || ProductAnalyticsJourneyNodeTarget.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((ProductAnalyticsJourneyNodeTarget.class.equals(Float.class) + || ProductAnalyticsJourneyNodeTarget.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (ProductAnalyticsJourneyNodeTarget.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (ProductAnalyticsJourneyNodeTarget.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(ProductAnalyticsJourneyNodeTarget.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 (!((ProductAnalyticsJourneyNodeTarget) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'ProductAnalyticsJourneyNodeTarget'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log( + Level.FINER, "Input data does not match schema 'ProductAnalyticsJourneyNodeTarget'", e); + } + + // deserialize ProductAnalyticsJourneyPathTarget + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (ProductAnalyticsJourneyPathTarget.class.equals(Integer.class) + || ProductAnalyticsJourneyPathTarget.class.equals(Long.class) + || ProductAnalyticsJourneyPathTarget.class.equals(Float.class) + || ProductAnalyticsJourneyPathTarget.class.equals(Double.class) + || ProductAnalyticsJourneyPathTarget.class.equals(Boolean.class) + || ProductAnalyticsJourneyPathTarget.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((ProductAnalyticsJourneyPathTarget.class.equals(Integer.class) + || ProductAnalyticsJourneyPathTarget.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((ProductAnalyticsJourneyPathTarget.class.equals(Float.class) + || ProductAnalyticsJourneyPathTarget.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (ProductAnalyticsJourneyPathTarget.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (ProductAnalyticsJourneyPathTarget.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(ProductAnalyticsJourneyPathTarget.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 (!((ProductAnalyticsJourneyPathTarget) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'ProductAnalyticsJourneyPathTarget'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log( + Level.FINER, "Input data does not match schema 'ProductAnalyticsJourneyPathTarget'", e); + } + + ProductAnalyticsJourneyTarget ret = new ProductAnalyticsJourneyTarget(); + 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 ProductAnalyticsJourneyTarget getNullValue(DeserializationContext ctxt) + throws JsonMappingException { + throw new JsonMappingException( + ctxt.getParser(), "ProductAnalyticsJourneyTarget cannot be null"); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public ProductAnalyticsJourneyTarget() { + super("oneOf", Boolean.FALSE); + } + + public ProductAnalyticsJourneyTarget(ProductAnalyticsJourneyNodeTarget o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public ProductAnalyticsJourneyTarget(ProductAnalyticsJourneyPathTarget o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put( + "ProductAnalyticsJourneyNodeTarget", + new GenericType() {}); + schemas.put( + "ProductAnalyticsJourneyPathTarget", + new GenericType() {}); + JSON.registerDescendants( + ProductAnalyticsJourneyTarget.class, Collections.unmodifiableMap(schemas)); + } + + @Override + public Map getSchemas() { + return ProductAnalyticsJourneyTarget.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: ProductAnalyticsJourneyNodeTarget, + * ProductAnalyticsJourneyPathTarget + * + *

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( + ProductAnalyticsJourneyNodeTarget.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf( + ProductAnalyticsJourneyPathTarget.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 ProductAnalyticsJourneyNodeTarget," + + " ProductAnalyticsJourneyPathTarget"); + } + + /** + * Get the actual instance, which can be the following: ProductAnalyticsJourneyNodeTarget, + * ProductAnalyticsJourneyPathTarget + * + * @return The actual instance (ProductAnalyticsJourneyNodeTarget, + * ProductAnalyticsJourneyPathTarget) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `ProductAnalyticsJourneyNodeTarget`. If the actual instance is not + * `ProductAnalyticsJourneyNodeTarget`, the ClassCastException will be thrown. + * + * @return The actual instance of `ProductAnalyticsJourneyNodeTarget` + * @throws ClassCastException if the instance is not `ProductAnalyticsJourneyNodeTarget` + */ + public ProductAnalyticsJourneyNodeTarget getProductAnalyticsJourneyNodeTarget() + throws ClassCastException { + return (ProductAnalyticsJourneyNodeTarget) super.getActualInstance(); + } + + /** + * Get the actual instance of `ProductAnalyticsJourneyPathTarget`. If the actual instance is not + * `ProductAnalyticsJourneyPathTarget`, the ClassCastException will be thrown. + * + * @return The actual instance of `ProductAnalyticsJourneyPathTarget` + * @throws ClassCastException if the instance is not `ProductAnalyticsJourneyPathTarget` + */ + public ProductAnalyticsJourneyPathTarget getProductAnalyticsJourneyPathTarget() + throws ClassCastException { + return (ProductAnalyticsJourneyPathTarget) super.getActualInstance(); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyTimeseriesResponse.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyTimeseriesResponse.java new file mode 100644 index 00000000000..3062270cf31 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyTimeseriesResponse.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.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; + +/** Response for a journey timeseries query. */ +@JsonPropertyOrder({ProductAnalyticsJourneyTimeseriesResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsJourneyTimeseriesResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private ProductAnalyticsJourneyTimeseriesResponseData data; + + public ProductAnalyticsJourneyTimeseriesResponse() {} + + @JsonCreator + public ProductAnalyticsJourneyTimeseriesResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + ProductAnalyticsJourneyTimeseriesResponseData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public ProductAnalyticsJourneyTimeseriesResponse data( + ProductAnalyticsJourneyTimeseriesResponseData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * The single JSON:API resource holding journey timeseries results. Its attributes contain one + * series per group along with the timestamps the points fall on. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsJourneyTimeseriesResponseData getData() { + return data; + } + + public void setData(ProductAnalyticsJourneyTimeseriesResponseData data) { + this.data = data; + if (data != null) { + this.unparsed |= data.unparsed; + } + } + + /** + * 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 ProductAnalyticsJourneyTimeseriesResponse + */ + @JsonAnySetter + public ProductAnalyticsJourneyTimeseriesResponse 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 ProductAnalyticsJourneyTimeseriesResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsJourneyTimeseriesResponse productAnalyticsJourneyTimeseriesResponse = + (ProductAnalyticsJourneyTimeseriesResponse) o; + return Objects.equals(this.data, productAnalyticsJourneyTimeseriesResponse.data) + && Objects.equals( + this.additionalProperties, + productAnalyticsJourneyTimeseriesResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsJourneyTimeseriesResponse {\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/ProductAnalyticsJourneyTimeseriesResponseData.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyTimeseriesResponseData.java new file mode 100644 index 00000000000..8f49c3efbc1 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyTimeseriesResponseData.java @@ -0,0 +1,223 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * The single JSON:API resource holding journey timeseries results. Its attributes contain one + * series per group along with the timestamps the points fall on. + */ +@JsonPropertyOrder({ + ProductAnalyticsJourneyTimeseriesResponseData.JSON_PROPERTY_ATTRIBUTES, + ProductAnalyticsJourneyTimeseriesResponseData.JSON_PROPERTY_ID, + ProductAnalyticsJourneyTimeseriesResponseData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsJourneyTimeseriesResponseData { + @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 ProductAnalyticsJourneyTimeseriesResponseType type; + + public ProductAnalyticsJourneyTimeseriesResponseData() {} + + @JsonCreator + public ProductAnalyticsJourneyTimeseriesResponseData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + ProductAnalyticsTimeseriesResponseAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + ProductAnalyticsJourneyTimeseriesResponseType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public ProductAnalyticsJourneyTimeseriesResponseData attributes( + ProductAnalyticsTimeseriesResponseAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of a timeseries analytics response, containing series data, timestamps, and interval + * definitions. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsTimeseriesResponseAttributes getAttributes() { + return attributes; + } + + public void setAttributes(ProductAnalyticsTimeseriesResponseAttributes attributes) { + this.attributes = attributes; + if (attributes != null) { + this.unparsed |= attributes.unparsed; + } + } + + public ProductAnalyticsJourneyTimeseriesResponseData id(String id) { + this.id = id; + return this; + } + + /** + * Identifier of this result. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public ProductAnalyticsJourneyTimeseriesResponseData type( + ProductAnalyticsJourneyTimeseriesResponseType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The resource type identifier for a journey timeseries response. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsJourneyTimeseriesResponseType getType() { + return type; + } + + public void setType(ProductAnalyticsJourneyTimeseriesResponseType 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 ProductAnalyticsJourneyTimeseriesResponseData + */ + @JsonAnySetter + public ProductAnalyticsJourneyTimeseriesResponseData 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 ProductAnalyticsJourneyTimeseriesResponseData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsJourneyTimeseriesResponseData productAnalyticsJourneyTimeseriesResponseData = + (ProductAnalyticsJourneyTimeseriesResponseData) o; + return Objects.equals(this.attributes, productAnalyticsJourneyTimeseriesResponseData.attributes) + && Objects.equals(this.id, productAnalyticsJourneyTimeseriesResponseData.id) + && Objects.equals(this.type, productAnalyticsJourneyTimeseriesResponseData.type) + && Objects.equals( + this.additionalProperties, + productAnalyticsJourneyTimeseriesResponseData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsJourneyTimeseriesResponseData {\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/ProductAnalyticsJourneyTimeseriesResponseType.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyTimeseriesResponseType.java new file mode 100644 index 00000000000..4032fabf1e4 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsJourneyTimeseriesResponseType.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 resource type identifier for a journey timeseries response. */ +@JsonSerialize( + using = + ProductAnalyticsJourneyTimeseriesResponseType + .ProductAnalyticsJourneyTimeseriesResponseTypeSerializer.class) +public class ProductAnalyticsJourneyTimeseriesResponseType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("journey_timeseries_response")); + + public static final ProductAnalyticsJourneyTimeseriesResponseType JOURNEY_TIMESERIES_RESPONSE = + new ProductAnalyticsJourneyTimeseriesResponseType("journey_timeseries_response"); + + ProductAnalyticsJourneyTimeseriesResponseType(String value) { + super(value, allowedValues); + } + + public static class ProductAnalyticsJourneyTimeseriesResponseTypeSerializer + extends StdSerializer { + public ProductAnalyticsJourneyTimeseriesResponseTypeSerializer( + Class t) { + super(t); + } + + public ProductAnalyticsJourneyTimeseriesResponseTypeSerializer() { + this(null); + } + + @Override + public void serialize( + ProductAnalyticsJourneyTimeseriesResponseType value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ProductAnalyticsJourneyTimeseriesResponseType fromValue(String value) { + return new ProductAnalyticsJourneyTimeseriesResponseType(value); + } +} 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 index 4a052f5bab7..78dc7650697 100644 --- a/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsResponseMeta.java +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsResponseMeta.java @@ -37,7 +37,7 @@ public ProductAnalyticsResponseMeta requestId(String requestId) { } /** - * Unique identifier for the request, used for multi-step query continuation. + * Unique identifier of the query. * * @return requestId */ diff --git a/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionAggregationTarget.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionAggregationTarget.java new file mode 100644 index 00000000000..d928def7b3c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionAggregationTarget.java @@ -0,0 +1,184 @@ +/* + * 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; + +/** Selects the rolled-up row that aggregates every cohort, rather than a single cohort. */ +@JsonPropertyOrder({ + ProductAnalyticsRetentionAggregationTarget.JSON_PROPERTY_TYPE, + ProductAnalyticsRetentionAggregationTarget.JSON_PROPERTY_VALUE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsRetentionAggregationTarget { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_TYPE = "type"; + private ProductAnalyticsRetentionAggregationTargetType type; + + public static final String JSON_PROPERTY_VALUE = "value"; + private String value; + + public ProductAnalyticsRetentionAggregationTarget() {} + + @JsonCreator + public ProductAnalyticsRetentionAggregationTarget( + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + ProductAnalyticsRetentionAggregationTargetType type, + @JsonProperty(required = true, value = JSON_PROPERTY_VALUE) String value) { + this.type = type; + this.unparsed |= !type.isValid(); + this.value = value; + } + + public ProductAnalyticsRetentionAggregationTarget type( + ProductAnalyticsRetentionAggregationTargetType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The discriminator identifying a target selected by aggregation. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsRetentionAggregationTargetType getType() { + return type; + } + + public void setType(ProductAnalyticsRetentionAggregationTargetType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + public ProductAnalyticsRetentionAggregationTarget value(String value) { + this.value = value; + return this; + } + + /** + * The aggregation that produced the rolled-up row. + * + * @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 ProductAnalyticsRetentionAggregationTarget + */ + @JsonAnySetter + public ProductAnalyticsRetentionAggregationTarget 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 ProductAnalyticsRetentionAggregationTarget object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsRetentionAggregationTarget productAnalyticsRetentionAggregationTarget = + (ProductAnalyticsRetentionAggregationTarget) o; + return Objects.equals(this.type, productAnalyticsRetentionAggregationTarget.type) + && Objects.equals(this.value, productAnalyticsRetentionAggregationTarget.value) + && Objects.equals( + this.additionalProperties, + productAnalyticsRetentionAggregationTarget.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(type, value, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsRetentionAggregationTarget {\n"); + sb.append(" type: ").append(toIndentedString(type)).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/ProductAnalyticsRetentionAggregationTargetType.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionAggregationTargetType.java new file mode 100644 index 00000000000..38141e73d01 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionAggregationTargetType.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 discriminator identifying a target selected by aggregation. */ +@JsonSerialize( + using = + ProductAnalyticsRetentionAggregationTargetType + .ProductAnalyticsRetentionAggregationTargetTypeSerializer.class) +public class ProductAnalyticsRetentionAggregationTargetType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("aggregation")); + + public static final ProductAnalyticsRetentionAggregationTargetType AGGREGATION = + new ProductAnalyticsRetentionAggregationTargetType("aggregation"); + + ProductAnalyticsRetentionAggregationTargetType(String value) { + super(value, allowedValues); + } + + public static class ProductAnalyticsRetentionAggregationTargetTypeSerializer + extends StdSerializer { + public ProductAnalyticsRetentionAggregationTargetTypeSerializer( + Class t) { + super(t); + } + + public ProductAnalyticsRetentionAggregationTargetTypeSerializer() { + this(null); + } + + @Override + public void serialize( + ProductAnalyticsRetentionAggregationTargetType value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ProductAnalyticsRetentionAggregationTargetType fromValue(String value) { + return new ProductAnalyticsRetentionAggregationTargetType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionCalendarTimeInterval.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionCalendarTimeInterval.java new file mode 100644 index 00000000000..b59222f6203 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionCalendarTimeInterval.java @@ -0,0 +1,191 @@ +/* + * 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 retention interval aligned to calendar boundaries. */ +@JsonPropertyOrder({ + ProductAnalyticsRetentionCalendarTimeInterval.JSON_PROPERTY_TYPE, + ProductAnalyticsRetentionCalendarTimeInterval.JSON_PROPERTY_VALUE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsRetentionCalendarTimeInterval { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_TYPE = "type"; + private ProductAnalyticsRetentionCalendarTimeIntervalType type; + + public static final String JSON_PROPERTY_VALUE = "value"; + private ProductAnalyticsCalendarInterval value; + + public ProductAnalyticsRetentionCalendarTimeInterval() {} + + @JsonCreator + public ProductAnalyticsRetentionCalendarTimeInterval( + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + ProductAnalyticsRetentionCalendarTimeIntervalType type, + @JsonProperty(required = true, value = JSON_PROPERTY_VALUE) + ProductAnalyticsCalendarInterval value) { + this.type = type; + this.unparsed |= !type.isValid(); + this.value = value; + this.unparsed |= value.unparsed; + } + + public ProductAnalyticsRetentionCalendarTimeInterval type( + ProductAnalyticsRetentionCalendarTimeIntervalType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The discriminator identifying a calendar-aligned retention interval. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsRetentionCalendarTimeIntervalType getType() { + return type; + } + + public void setType(ProductAnalyticsRetentionCalendarTimeIntervalType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + public ProductAnalyticsRetentionCalendarTimeInterval value( + ProductAnalyticsCalendarInterval value) { + this.value = value; + this.unparsed |= value.unparsed; + return this; + } + + /** + * A calendar-aligned bucket definition, such as "every 1 week starting on Monday". + * + * @return value + */ + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsCalendarInterval getValue() { + return value; + } + + public void setValue(ProductAnalyticsCalendarInterval value) { + this.value = value; + if (value != null) { + this.unparsed |= value.unparsed; + } + } + + /** + * 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 ProductAnalyticsRetentionCalendarTimeInterval + */ + @JsonAnySetter + public ProductAnalyticsRetentionCalendarTimeInterval 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 ProductAnalyticsRetentionCalendarTimeInterval object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsRetentionCalendarTimeInterval productAnalyticsRetentionCalendarTimeInterval = + (ProductAnalyticsRetentionCalendarTimeInterval) o; + return Objects.equals(this.type, productAnalyticsRetentionCalendarTimeInterval.type) + && Objects.equals(this.value, productAnalyticsRetentionCalendarTimeInterval.value) + && Objects.equals( + this.additionalProperties, + productAnalyticsRetentionCalendarTimeInterval.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(type, value, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsRetentionCalendarTimeInterval {\n"); + sb.append(" type: ").append(toIndentedString(type)).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/ProductAnalyticsRetentionCalendarTimeIntervalType.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionCalendarTimeIntervalType.java new file mode 100644 index 00000000000..d204d09ec42 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionCalendarTimeIntervalType.java @@ -0,0 +1,62 @@ +/* + * 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 discriminator identifying a calendar-aligned retention interval. */ +@JsonSerialize( + using = + ProductAnalyticsRetentionCalendarTimeIntervalType + .ProductAnalyticsRetentionCalendarTimeIntervalTypeSerializer.class) +public class ProductAnalyticsRetentionCalendarTimeIntervalType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("calendar")); + + public static final ProductAnalyticsRetentionCalendarTimeIntervalType CALENDAR = + new ProductAnalyticsRetentionCalendarTimeIntervalType("calendar"); + + ProductAnalyticsRetentionCalendarTimeIntervalType(String value) { + super(value, allowedValues); + } + + public static class ProductAnalyticsRetentionCalendarTimeIntervalTypeSerializer + extends StdSerializer { + public ProductAnalyticsRetentionCalendarTimeIntervalTypeSerializer( + Class t) { + super(t); + } + + public ProductAnalyticsRetentionCalendarTimeIntervalTypeSerializer() { + this(null); + } + + @Override + public void serialize( + ProductAnalyticsRetentionCalendarTimeIntervalType value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ProductAnalyticsRetentionCalendarTimeIntervalType fromValue(String value) { + return new ProductAnalyticsRetentionCalendarTimeIntervalType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionCellScope.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionCellScope.java new file mode 100644 index 00000000000..61381786f5c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionCellScope.java @@ -0,0 +1,227 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.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; + +/** + * Narrows a retention query to a single cell, at the intersection of one cohort and one return + * period. + */ +@JsonPropertyOrder({ + ProductAnalyticsRetentionCellScope.JSON_PROPERTY_COHORT_TARGET, + ProductAnalyticsRetentionCellScope.JSON_PROPERTY_RETURN_PERIOD_TARGET, + ProductAnalyticsRetentionCellScope.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsRetentionCellScope { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_COHORT_TARGET = "cohort_target"; + private ProductAnalyticsRetentionCohortTarget cohortTarget; + + public static final String JSON_PROPERTY_RETURN_PERIOD_TARGET = "return_period_target"; + private ProductAnalyticsRetentionIndexTarget returnPeriodTarget; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ProductAnalyticsRetentionCellScopeType type; + + public ProductAnalyticsRetentionCellScope() {} + + @JsonCreator + public ProductAnalyticsRetentionCellScope( + @JsonProperty(required = true, value = JSON_PROPERTY_COHORT_TARGET) + ProductAnalyticsRetentionCohortTarget cohortTarget, + @JsonProperty(required = true, value = JSON_PROPERTY_RETURN_PERIOD_TARGET) + ProductAnalyticsRetentionIndexTarget returnPeriodTarget, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + ProductAnalyticsRetentionCellScopeType type) { + this.cohortTarget = cohortTarget; + this.unparsed |= cohortTarget.unparsed; + this.returnPeriodTarget = returnPeriodTarget; + this.unparsed |= returnPeriodTarget.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public ProductAnalyticsRetentionCellScope cohortTarget( + ProductAnalyticsRetentionCohortTarget cohortTarget) { + this.cohortTarget = cohortTarget; + this.unparsed |= cohortTarget.unparsed; + return this; + } + + /** + * Selects a cohort, either by index or by the aggregation that rolls all cohorts together. + * + * @return cohortTarget + */ + @JsonProperty(JSON_PROPERTY_COHORT_TARGET) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsRetentionCohortTarget getCohortTarget() { + return cohortTarget; + } + + public void setCohortTarget(ProductAnalyticsRetentionCohortTarget cohortTarget) { + this.cohortTarget = cohortTarget; + if (cohortTarget != null) { + this.unparsed |= cohortTarget.unparsed; + } + } + + public ProductAnalyticsRetentionCellScope returnPeriodTarget( + ProductAnalyticsRetentionIndexTarget returnPeriodTarget) { + this.returnPeriodTarget = returnPeriodTarget; + this.unparsed |= returnPeriodTarget.unparsed; + return this; + } + + /** + * Selects a cohort or return period by its zero-based position in the grid. + * + * @return returnPeriodTarget + */ + @JsonProperty(JSON_PROPERTY_RETURN_PERIOD_TARGET) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsRetentionIndexTarget getReturnPeriodTarget() { + return returnPeriodTarget; + } + + public void setReturnPeriodTarget(ProductAnalyticsRetentionIndexTarget returnPeriodTarget) { + this.returnPeriodTarget = returnPeriodTarget; + if (returnPeriodTarget != null) { + this.unparsed |= returnPeriodTarget.unparsed; + } + } + + public ProductAnalyticsRetentionCellScope type(ProductAnalyticsRetentionCellScopeType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The discriminator identifying a scope narrowed to one grid cell. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsRetentionCellScopeType getType() { + return type; + } + + public void setType(ProductAnalyticsRetentionCellScopeType 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 ProductAnalyticsRetentionCellScope + */ + @JsonAnySetter + public ProductAnalyticsRetentionCellScope 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 ProductAnalyticsRetentionCellScope object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsRetentionCellScope productAnalyticsRetentionCellScope = + (ProductAnalyticsRetentionCellScope) o; + return Objects.equals(this.cohortTarget, productAnalyticsRetentionCellScope.cohortTarget) + && Objects.equals( + this.returnPeriodTarget, productAnalyticsRetentionCellScope.returnPeriodTarget) + && Objects.equals(this.type, productAnalyticsRetentionCellScope.type) + && Objects.equals( + this.additionalProperties, productAnalyticsRetentionCellScope.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(cohortTarget, returnPeriodTarget, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsRetentionCellScope {\n"); + sb.append(" cohortTarget: ").append(toIndentedString(cohortTarget)).append("\n"); + sb.append(" returnPeriodTarget: ").append(toIndentedString(returnPeriodTarget)).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/ProductAnalyticsRetentionCellScopeType.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionCellScopeType.java new file mode 100644 index 00000000000..34496071325 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionCellScopeType.java @@ -0,0 +1,62 @@ +/* + * 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 discriminator identifying a scope narrowed to one grid cell. */ +@JsonSerialize( + using = + ProductAnalyticsRetentionCellScopeType.ProductAnalyticsRetentionCellScopeTypeSerializer + .class) +public class ProductAnalyticsRetentionCellScopeType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("cell")); + + public static final ProductAnalyticsRetentionCellScopeType CELL = + new ProductAnalyticsRetentionCellScopeType("cell"); + + ProductAnalyticsRetentionCellScopeType(String value) { + super(value, allowedValues); + } + + public static class ProductAnalyticsRetentionCellScopeTypeSerializer + extends StdSerializer { + public ProductAnalyticsRetentionCellScopeTypeSerializer( + Class t) { + super(t); + } + + public ProductAnalyticsRetentionCellScopeTypeSerializer() { + this(null); + } + + @Override + public void serialize( + ProductAnalyticsRetentionCellScopeType value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ProductAnalyticsRetentionCellScopeType fromValue(String value) { + return new ProductAnalyticsRetentionCellScopeType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionCohortCriteria.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionCohortCriteria.java new file mode 100644 index 00000000000..bee2c504d72 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionCohortCriteria.java @@ -0,0 +1,194 @@ +/* + * 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; + +/** + * Defines the event that places an entity into a cohort, and how cohorts are bucketed over time. + */ +@JsonPropertyOrder({ + ProductAnalyticsRetentionCohortCriteria.JSON_PROPERTY_BASE_QUERY, + ProductAnalyticsRetentionCohortCriteria.JSON_PROPERTY_TIME_INTERVAL +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsRetentionCohortCriteria { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_BASE_QUERY = "base_query"; + private ProductAnalyticsBaseQuery baseQuery; + + public static final String JSON_PROPERTY_TIME_INTERVAL = "time_interval"; + private ProductAnalyticsRetentionTimeInterval timeInterval; + + public ProductAnalyticsRetentionCohortCriteria() {} + + @JsonCreator + public ProductAnalyticsRetentionCohortCriteria( + @JsonProperty(required = true, value = JSON_PROPERTY_BASE_QUERY) + ProductAnalyticsBaseQuery baseQuery, + @JsonProperty(required = true, value = JSON_PROPERTY_TIME_INTERVAL) + ProductAnalyticsRetentionTimeInterval timeInterval) { + this.baseQuery = baseQuery; + this.unparsed |= baseQuery.unparsed; + this.timeInterval = timeInterval; + this.unparsed |= timeInterval.unparsed; + } + + public ProductAnalyticsRetentionCohortCriteria baseQuery(ProductAnalyticsBaseQuery baseQuery) { + this.baseQuery = baseQuery; + this.unparsed |= baseQuery.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 baseQuery + */ + @JsonProperty(JSON_PROPERTY_BASE_QUERY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsBaseQuery getBaseQuery() { + return baseQuery; + } + + public void setBaseQuery(ProductAnalyticsBaseQuery baseQuery) { + this.baseQuery = baseQuery; + if (baseQuery != null) { + this.unparsed |= baseQuery.unparsed; + } + } + + public ProductAnalyticsRetentionCohortCriteria timeInterval( + ProductAnalyticsRetentionTimeInterval timeInterval) { + this.timeInterval = timeInterval; + this.unparsed |= timeInterval.unparsed; + return this; + } + + /** + * A retention interval, either aligned to calendar boundaries or of a fixed length. Cohort + * criteria use calendar intervals; return criteria use fixed intervals. + * + * @return timeInterval + */ + @JsonProperty(JSON_PROPERTY_TIME_INTERVAL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsRetentionTimeInterval getTimeInterval() { + return timeInterval; + } + + public void setTimeInterval(ProductAnalyticsRetentionTimeInterval timeInterval) { + this.timeInterval = timeInterval; + if (timeInterval != null) { + this.unparsed |= timeInterval.unparsed; + } + } + + /** + * 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 ProductAnalyticsRetentionCohortCriteria + */ + @JsonAnySetter + public ProductAnalyticsRetentionCohortCriteria 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 ProductAnalyticsRetentionCohortCriteria object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsRetentionCohortCriteria productAnalyticsRetentionCohortCriteria = + (ProductAnalyticsRetentionCohortCriteria) o; + return Objects.equals(this.baseQuery, productAnalyticsRetentionCohortCriteria.baseQuery) + && Objects.equals(this.timeInterval, productAnalyticsRetentionCohortCriteria.timeInterval) + && Objects.equals( + this.additionalProperties, + productAnalyticsRetentionCohortCriteria.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(baseQuery, timeInterval, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsRetentionCohortCriteria {\n"); + sb.append(" baseQuery: ").append(toIndentedString(baseQuery)).append("\n"); + sb.append(" timeInterval: ").append(toIndentedString(timeInterval)).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/ProductAnalyticsRetentionCohortScope.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionCohortScope.java new file mode 100644 index 00000000000..a7b308eff5f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionCohortScope.java @@ -0,0 +1,187 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Narrows a retention query to a single cohort row. */ +@JsonPropertyOrder({ + ProductAnalyticsRetentionCohortScope.JSON_PROPERTY_TARGET, + ProductAnalyticsRetentionCohortScope.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsRetentionCohortScope { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_TARGET = "target"; + private ProductAnalyticsRetentionCohortTarget target; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ProductAnalyticsRetentionCohortScopeType type; + + public ProductAnalyticsRetentionCohortScope() {} + + @JsonCreator + public ProductAnalyticsRetentionCohortScope( + @JsonProperty(required = true, value = JSON_PROPERTY_TARGET) + ProductAnalyticsRetentionCohortTarget target, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + ProductAnalyticsRetentionCohortScopeType type) { + this.target = target; + this.unparsed |= target.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public ProductAnalyticsRetentionCohortScope target(ProductAnalyticsRetentionCohortTarget target) { + this.target = target; + this.unparsed |= target.unparsed; + return this; + } + + /** + * Selects a cohort, either by index or by the aggregation that rolls all cohorts together. + * + * @return target + */ + @JsonProperty(JSON_PROPERTY_TARGET) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsRetentionCohortTarget getTarget() { + return target; + } + + public void setTarget(ProductAnalyticsRetentionCohortTarget target) { + this.target = target; + if (target != null) { + this.unparsed |= target.unparsed; + } + } + + public ProductAnalyticsRetentionCohortScope type(ProductAnalyticsRetentionCohortScopeType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The discriminator identifying a scope narrowed to one cohort. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsRetentionCohortScopeType getType() { + return type; + } + + public void setType(ProductAnalyticsRetentionCohortScopeType 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 ProductAnalyticsRetentionCohortScope + */ + @JsonAnySetter + public ProductAnalyticsRetentionCohortScope 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 ProductAnalyticsRetentionCohortScope object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsRetentionCohortScope productAnalyticsRetentionCohortScope = + (ProductAnalyticsRetentionCohortScope) o; + return Objects.equals(this.target, productAnalyticsRetentionCohortScope.target) + && Objects.equals(this.type, productAnalyticsRetentionCohortScope.type) + && Objects.equals( + this.additionalProperties, productAnalyticsRetentionCohortScope.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(target, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsRetentionCohortScope {\n"); + sb.append(" target: ").append(toIndentedString(target)).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/ProductAnalyticsRetentionCohortScopeType.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionCohortScopeType.java new file mode 100644 index 00000000000..9e3ddaf7f01 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionCohortScopeType.java @@ -0,0 +1,62 @@ +/* + * 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 discriminator identifying a scope narrowed to one cohort. */ +@JsonSerialize( + using = + ProductAnalyticsRetentionCohortScopeType.ProductAnalyticsRetentionCohortScopeTypeSerializer + .class) +public class ProductAnalyticsRetentionCohortScopeType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("cohort")); + + public static final ProductAnalyticsRetentionCohortScopeType COHORT = + new ProductAnalyticsRetentionCohortScopeType("cohort"); + + ProductAnalyticsRetentionCohortScopeType(String value) { + super(value, allowedValues); + } + + public static class ProductAnalyticsRetentionCohortScopeTypeSerializer + extends StdSerializer { + public ProductAnalyticsRetentionCohortScopeTypeSerializer( + Class t) { + super(t); + } + + public ProductAnalyticsRetentionCohortScopeTypeSerializer() { + this(null); + } + + @Override + public void serialize( + ProductAnalyticsRetentionCohortScopeType value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ProductAnalyticsRetentionCohortScopeType fromValue(String value) { + return new ProductAnalyticsRetentionCohortScopeType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionCohortTarget.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionCohortTarget.java new file mode 100644 index 00000000000..2be36572f0a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionCohortTarget.java @@ -0,0 +1,314 @@ +/* + * 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 = + ProductAnalyticsRetentionCohortTarget.ProductAnalyticsRetentionCohortTargetDeserializer + .class) +@JsonSerialize( + using = + ProductAnalyticsRetentionCohortTarget.ProductAnalyticsRetentionCohortTargetSerializer.class) +public class ProductAnalyticsRetentionCohortTarget extends AbstractOpenApiSchema { + private static final Logger log = + Logger.getLogger(ProductAnalyticsRetentionCohortTarget.class.getName()); + + @JsonIgnore public boolean unparsed = false; + + public static class ProductAnalyticsRetentionCohortTargetSerializer + extends StdSerializer { + public ProductAnalyticsRetentionCohortTargetSerializer( + Class t) { + super(t); + } + + public ProductAnalyticsRetentionCohortTargetSerializer() { + this(null); + } + + @Override + public void serialize( + ProductAnalyticsRetentionCohortTarget value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.getActualInstance()); + } + } + + public static class ProductAnalyticsRetentionCohortTargetDeserializer + extends StdDeserializer { + public ProductAnalyticsRetentionCohortTargetDeserializer() { + this(ProductAnalyticsRetentionCohortTarget.class); + } + + public ProductAnalyticsRetentionCohortTargetDeserializer(Class vc) { + super(vc); + } + + @Override + public ProductAnalyticsRetentionCohortTarget 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 ProductAnalyticsRetentionIndexTarget + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (ProductAnalyticsRetentionIndexTarget.class.equals(Integer.class) + || ProductAnalyticsRetentionIndexTarget.class.equals(Long.class) + || ProductAnalyticsRetentionIndexTarget.class.equals(Float.class) + || ProductAnalyticsRetentionIndexTarget.class.equals(Double.class) + || ProductAnalyticsRetentionIndexTarget.class.equals(Boolean.class) + || ProductAnalyticsRetentionIndexTarget.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((ProductAnalyticsRetentionIndexTarget.class.equals(Integer.class) + || ProductAnalyticsRetentionIndexTarget.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((ProductAnalyticsRetentionIndexTarget.class.equals(Float.class) + || ProductAnalyticsRetentionIndexTarget.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (ProductAnalyticsRetentionIndexTarget.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (ProductAnalyticsRetentionIndexTarget.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = + tree.traverse(jp.getCodec()).readValueAs(ProductAnalyticsRetentionIndexTarget.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 (!((ProductAnalyticsRetentionIndexTarget) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'ProductAnalyticsRetentionIndexTarget'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log( + Level.FINER, + "Input data does not match schema 'ProductAnalyticsRetentionIndexTarget'", + e); + } + + // deserialize ProductAnalyticsRetentionAggregationTarget + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (ProductAnalyticsRetentionAggregationTarget.class.equals(Integer.class) + || ProductAnalyticsRetentionAggregationTarget.class.equals(Long.class) + || ProductAnalyticsRetentionAggregationTarget.class.equals(Float.class) + || ProductAnalyticsRetentionAggregationTarget.class.equals(Double.class) + || ProductAnalyticsRetentionAggregationTarget.class.equals(Boolean.class) + || ProductAnalyticsRetentionAggregationTarget.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((ProductAnalyticsRetentionAggregationTarget.class.equals(Integer.class) + || ProductAnalyticsRetentionAggregationTarget.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((ProductAnalyticsRetentionAggregationTarget.class.equals(Float.class) + || ProductAnalyticsRetentionAggregationTarget.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (ProductAnalyticsRetentionAggregationTarget.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (ProductAnalyticsRetentionAggregationTarget.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = + tree.traverse(jp.getCodec()) + .readValueAs(ProductAnalyticsRetentionAggregationTarget.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 (!((ProductAnalyticsRetentionAggregationTarget) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log( + Level.FINER, + "Input data matches schema 'ProductAnalyticsRetentionAggregationTarget'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log( + Level.FINER, + "Input data does not match schema 'ProductAnalyticsRetentionAggregationTarget'", + e); + } + + ProductAnalyticsRetentionCohortTarget ret = new ProductAnalyticsRetentionCohortTarget(); + 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 ProductAnalyticsRetentionCohortTarget getNullValue(DeserializationContext ctxt) + throws JsonMappingException { + throw new JsonMappingException( + ctxt.getParser(), "ProductAnalyticsRetentionCohortTarget cannot be null"); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public ProductAnalyticsRetentionCohortTarget() { + super("oneOf", Boolean.FALSE); + } + + public ProductAnalyticsRetentionCohortTarget(ProductAnalyticsRetentionIndexTarget o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public ProductAnalyticsRetentionCohortTarget(ProductAnalyticsRetentionAggregationTarget o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put( + "ProductAnalyticsRetentionIndexTarget", + new GenericType() {}); + schemas.put( + "ProductAnalyticsRetentionAggregationTarget", + new GenericType() {}); + JSON.registerDescendants( + ProductAnalyticsRetentionCohortTarget.class, Collections.unmodifiableMap(schemas)); + } + + @Override + public Map getSchemas() { + return ProductAnalyticsRetentionCohortTarget.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: ProductAnalyticsRetentionIndexTarget, + * ProductAnalyticsRetentionAggregationTarget + * + *

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( + ProductAnalyticsRetentionIndexTarget.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf( + ProductAnalyticsRetentionAggregationTarget.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 ProductAnalyticsRetentionIndexTarget," + + " ProductAnalyticsRetentionAggregationTarget"); + } + + /** + * Get the actual instance, which can be the following: ProductAnalyticsRetentionIndexTarget, + * ProductAnalyticsRetentionAggregationTarget + * + * @return The actual instance (ProductAnalyticsRetentionIndexTarget, + * ProductAnalyticsRetentionAggregationTarget) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `ProductAnalyticsRetentionIndexTarget`. If the actual instance is + * not `ProductAnalyticsRetentionIndexTarget`, the ClassCastException will be thrown. + * + * @return The actual instance of `ProductAnalyticsRetentionIndexTarget` + * @throws ClassCastException if the instance is not `ProductAnalyticsRetentionIndexTarget` + */ + public ProductAnalyticsRetentionIndexTarget getProductAnalyticsRetentionIndexTarget() + throws ClassCastException { + return (ProductAnalyticsRetentionIndexTarget) super.getActualInstance(); + } + + /** + * Get the actual instance of `ProductAnalyticsRetentionAggregationTarget`. If the actual instance + * is not `ProductAnalyticsRetentionAggregationTarget`, the ClassCastException will be thrown. + * + * @return The actual instance of `ProductAnalyticsRetentionAggregationTarget` + * @throws ClassCastException if the instance is not `ProductAnalyticsRetentionAggregationTarget` + */ + public ProductAnalyticsRetentionAggregationTarget getProductAnalyticsRetentionAggregationTarget() + throws ClassCastException { + return (ProductAnalyticsRetentionAggregationTarget) super.getActualInstance(); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionCompute.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionCompute.java new file mode 100644 index 00000000000..498873c85eb --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionCompute.java @@ -0,0 +1,181 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The metric and aggregation applied to a retention query. */ +@JsonPropertyOrder({ + ProductAnalyticsRetentionCompute.JSON_PROPERTY_AGGREGATION, + ProductAnalyticsRetentionCompute.JSON_PROPERTY_METRIC +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsRetentionCompute { + @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 ProductAnalyticsRetentionComputeMetric metric; + + public ProductAnalyticsRetentionCompute() {} + + @JsonCreator + public ProductAnalyticsRetentionCompute( + @JsonProperty(required = true, value = JSON_PROPERTY_AGGREGATION) String aggregation, + @JsonProperty(required = true, value = JSON_PROPERTY_METRIC) + ProductAnalyticsRetentionComputeMetric metric) { + this.aggregation = aggregation; + this.metric = metric; + this.unparsed |= !metric.isValid(); + } + + public ProductAnalyticsRetentionCompute aggregation(String aggregation) { + this.aggregation = aggregation; + return this; + } + + /** + * The aggregation function applied to the metric, such as count or avg. + * + * @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 ProductAnalyticsRetentionCompute metric(ProductAnalyticsRetentionComputeMetric metric) { + this.metric = metric; + this.unparsed |= !metric.isValid(); + return this; + } + + /** + * The retention metric to compute, either an absolute count or a rate. + * + * @return metric + */ + @JsonProperty(JSON_PROPERTY_METRIC) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsRetentionComputeMetric getMetric() { + return metric; + } + + public void setMetric(ProductAnalyticsRetentionComputeMetric metric) { + if (!metric.isValid()) { + this.unparsed = true; + } + 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 ProductAnalyticsRetentionCompute + */ + @JsonAnySetter + public ProductAnalyticsRetentionCompute 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 ProductAnalyticsRetentionCompute object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsRetentionCompute productAnalyticsRetentionCompute = + (ProductAnalyticsRetentionCompute) o; + return Objects.equals(this.aggregation, productAnalyticsRetentionCompute.aggregation) + && Objects.equals(this.metric, productAnalyticsRetentionCompute.metric) + && Objects.equals( + this.additionalProperties, productAnalyticsRetentionCompute.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(aggregation, metric, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsRetentionCompute {\n"); + sb.append(" aggregation: ").append(toIndentedString(aggregation)).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/ProductAnalyticsRetentionComputeMetric.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionComputeMetric.java new file mode 100644 index 00000000000..4dcd2492f3b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionComputeMetric.java @@ -0,0 +1,65 @@ +/* + * 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 retention metric to compute, either an absolute count or a rate. */ +@JsonSerialize( + using = + ProductAnalyticsRetentionComputeMetric.ProductAnalyticsRetentionComputeMetricSerializer + .class) +public class ProductAnalyticsRetentionComputeMetric extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("__dd.retention", "__dd.retention_rate")); + + public static final ProductAnalyticsRetentionComputeMetric RETENTION = + new ProductAnalyticsRetentionComputeMetric("__dd.retention"); + public static final ProductAnalyticsRetentionComputeMetric RETENTION_RATE = + new ProductAnalyticsRetentionComputeMetric("__dd.retention_rate"); + + ProductAnalyticsRetentionComputeMetric(String value) { + super(value, allowedValues); + } + + public static class ProductAnalyticsRetentionComputeMetricSerializer + extends StdSerializer { + public ProductAnalyticsRetentionComputeMetricSerializer( + Class t) { + super(t); + } + + public ProductAnalyticsRetentionComputeMetricSerializer() { + this(null); + } + + @Override + public void serialize( + ProductAnalyticsRetentionComputeMetric value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ProductAnalyticsRetentionComputeMetric fromValue(String value) { + return new ProductAnalyticsRetentionComputeMetric(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionEntity.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionEntity.java new file mode 100644 index 00000000000..c1fde38060c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionEntity.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 entity whose retention is measured. */ +@JsonSerialize( + using = ProductAnalyticsRetentionEntity.ProductAnalyticsRetentionEntitySerializer.class) +public class ProductAnalyticsRetentionEntity extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("@usr.id", "@account.id")); + + public static final ProductAnalyticsRetentionEntity USER_ID = + new ProductAnalyticsRetentionEntity("@usr.id"); + public static final ProductAnalyticsRetentionEntity ACCOUNT_ID = + new ProductAnalyticsRetentionEntity("@account.id"); + + ProductAnalyticsRetentionEntity(String value) { + super(value, allowedValues); + } + + public static class ProductAnalyticsRetentionEntitySerializer + extends StdSerializer { + public ProductAnalyticsRetentionEntitySerializer(Class t) { + super(t); + } + + public ProductAnalyticsRetentionEntitySerializer() { + this(null); + } + + @Override + public void serialize( + ProductAnalyticsRetentionEntity value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ProductAnalyticsRetentionEntity fromValue(String value) { + return new ProductAnalyticsRetentionEntity(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionFilters.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionFilters.java new file mode 100644 index 00000000000..7d0cac68813 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionFilters.java @@ -0,0 +1,171 @@ +/* + * 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; + +/** Filters narrowing the events considered by a retention query. */ +@JsonPropertyOrder({ + ProductAnalyticsRetentionFilters.JSON_PROPERTY_AUDIENCE_FILTERS, + ProductAnalyticsRetentionFilters.JSON_PROPERTY_STRING_FILTER +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsRetentionFilters { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_AUDIENCE_FILTERS = "audience_filters"; + private ProductAnalyticsAudienceFilters audienceFilters; + + public static final String JSON_PROPERTY_STRING_FILTER = "string_filter"; + private String stringFilter; + + public ProductAnalyticsRetentionFilters 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; + if (audienceFilters != null) { + this.unparsed |= audienceFilters.unparsed; + } + } + + public ProductAnalyticsRetentionFilters stringFilter(String stringFilter) { + this.stringFilter = stringFilter; + return this; + } + + /** + * Free-text search query applied to the events. + * + * @return stringFilter + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STRING_FILTER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getStringFilter() { + return stringFilter; + } + + public void setStringFilter(String stringFilter) { + this.stringFilter = stringFilter; + } + + /** + * 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 ProductAnalyticsRetentionFilters + */ + @JsonAnySetter + public ProductAnalyticsRetentionFilters 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 ProductAnalyticsRetentionFilters object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsRetentionFilters productAnalyticsRetentionFilters = + (ProductAnalyticsRetentionFilters) o; + return Objects.equals(this.audienceFilters, productAnalyticsRetentionFilters.audienceFilters) + && Objects.equals(this.stringFilter, productAnalyticsRetentionFilters.stringFilter) + && Objects.equals( + this.additionalProperties, productAnalyticsRetentionFilters.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(audienceFilters, stringFilter, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsRetentionFilters {\n"); + sb.append(" audienceFilters: ").append(toIndentedString(audienceFilters)).append("\n"); + sb.append(" stringFilter: ").append(toIndentedString(stringFilter)).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/ProductAnalyticsRetentionFixedTimeInterval.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionFixedTimeInterval.java new file mode 100644 index 00000000000..eb9336e5a84 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionFixedTimeInterval.java @@ -0,0 +1,219 @@ +/* + * 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 retention interval of fixed length, such as "7 days". */ +@JsonPropertyOrder({ + ProductAnalyticsRetentionFixedTimeInterval.JSON_PROPERTY_TYPE, + ProductAnalyticsRetentionFixedTimeInterval.JSON_PROPERTY_UNIT, + ProductAnalyticsRetentionFixedTimeInterval.JSON_PROPERTY_VALUE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsRetentionFixedTimeInterval { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_TYPE = "type"; + private ProductAnalyticsRetentionFixedTimeIntervalType type; + + public static final String JSON_PROPERTY_UNIT = "unit"; + private ProductAnalyticsRetentionFixedTimeIntervalUnit unit; + + public static final String JSON_PROPERTY_VALUE = "value"; + private Double value; + + public ProductAnalyticsRetentionFixedTimeInterval() {} + + @JsonCreator + public ProductAnalyticsRetentionFixedTimeInterval( + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + ProductAnalyticsRetentionFixedTimeIntervalType type, + @JsonProperty(required = true, value = JSON_PROPERTY_UNIT) + ProductAnalyticsRetentionFixedTimeIntervalUnit unit, + @JsonProperty(required = true, value = JSON_PROPERTY_VALUE) Double value) { + this.type = type; + this.unparsed |= !type.isValid(); + this.unit = unit; + this.unparsed |= !unit.isValid(); + this.value = value; + } + + public ProductAnalyticsRetentionFixedTimeInterval type( + ProductAnalyticsRetentionFixedTimeIntervalType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The discriminator identifying a fixed-length retention interval. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsRetentionFixedTimeIntervalType getType() { + return type; + } + + public void setType(ProductAnalyticsRetentionFixedTimeIntervalType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + public ProductAnalyticsRetentionFixedTimeInterval unit( + ProductAnalyticsRetentionFixedTimeIntervalUnit unit) { + this.unit = unit; + this.unparsed |= !unit.isValid(); + return this; + } + + /** + * Time unit for a fixed-length retention interval. + * + * @return unit + */ + @JsonProperty(JSON_PROPERTY_UNIT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsRetentionFixedTimeIntervalUnit getUnit() { + return unit; + } + + public void setUnit(ProductAnalyticsRetentionFixedTimeIntervalUnit unit) { + if (!unit.isValid()) { + this.unparsed = true; + } + this.unit = unit; + } + + public ProductAnalyticsRetentionFixedTimeInterval value(Double value) { + this.value = value; + return this; + } + + /** + * Length of the interval, expressed in unit. minimum: 0 + * + * @return value + */ + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Double getValue() { + return value; + } + + public void setValue(Double 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 ProductAnalyticsRetentionFixedTimeInterval + */ + @JsonAnySetter + public ProductAnalyticsRetentionFixedTimeInterval 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 ProductAnalyticsRetentionFixedTimeInterval object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsRetentionFixedTimeInterval productAnalyticsRetentionFixedTimeInterval = + (ProductAnalyticsRetentionFixedTimeInterval) o; + return Objects.equals(this.type, productAnalyticsRetentionFixedTimeInterval.type) + && Objects.equals(this.unit, productAnalyticsRetentionFixedTimeInterval.unit) + && Objects.equals(this.value, productAnalyticsRetentionFixedTimeInterval.value) + && Objects.equals( + this.additionalProperties, + productAnalyticsRetentionFixedTimeInterval.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(type, unit, value, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsRetentionFixedTimeInterval {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" unit: ").append(toIndentedString(unit)).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/ProductAnalyticsRetentionFixedTimeIntervalType.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionFixedTimeIntervalType.java new file mode 100644 index 00000000000..1ea5a5ebe1e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionFixedTimeIntervalType.java @@ -0,0 +1,62 @@ +/* + * 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 discriminator identifying a fixed-length retention interval. */ +@JsonSerialize( + using = + ProductAnalyticsRetentionFixedTimeIntervalType + .ProductAnalyticsRetentionFixedTimeIntervalTypeSerializer.class) +public class ProductAnalyticsRetentionFixedTimeIntervalType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("fixed")); + + public static final ProductAnalyticsRetentionFixedTimeIntervalType FIXED = + new ProductAnalyticsRetentionFixedTimeIntervalType("fixed"); + + ProductAnalyticsRetentionFixedTimeIntervalType(String value) { + super(value, allowedValues); + } + + public static class ProductAnalyticsRetentionFixedTimeIntervalTypeSerializer + extends StdSerializer { + public ProductAnalyticsRetentionFixedTimeIntervalTypeSerializer( + Class t) { + super(t); + } + + public ProductAnalyticsRetentionFixedTimeIntervalTypeSerializer() { + this(null); + } + + @Override + public void serialize( + ProductAnalyticsRetentionFixedTimeIntervalType value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ProductAnalyticsRetentionFixedTimeIntervalType fromValue(String value) { + return new ProductAnalyticsRetentionFixedTimeIntervalType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionFixedTimeIntervalUnit.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionFixedTimeIntervalUnit.java new file mode 100644 index 00000000000..19e48fdd50e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionFixedTimeIntervalUnit.java @@ -0,0 +1,67 @@ +/* + * 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; + +/** Time unit for a fixed-length retention interval. */ +@JsonSerialize( + using = + ProductAnalyticsRetentionFixedTimeIntervalUnit + .ProductAnalyticsRetentionFixedTimeIntervalUnitSerializer.class) +public class ProductAnalyticsRetentionFixedTimeIntervalUnit extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("day", "week", "month")); + + public static final ProductAnalyticsRetentionFixedTimeIntervalUnit DAY = + new ProductAnalyticsRetentionFixedTimeIntervalUnit("day"); + public static final ProductAnalyticsRetentionFixedTimeIntervalUnit WEEK = + new ProductAnalyticsRetentionFixedTimeIntervalUnit("week"); + public static final ProductAnalyticsRetentionFixedTimeIntervalUnit MONTH = + new ProductAnalyticsRetentionFixedTimeIntervalUnit("month"); + + ProductAnalyticsRetentionFixedTimeIntervalUnit(String value) { + super(value, allowedValues); + } + + public static class ProductAnalyticsRetentionFixedTimeIntervalUnitSerializer + extends StdSerializer { + public ProductAnalyticsRetentionFixedTimeIntervalUnitSerializer( + Class t) { + super(t); + } + + public ProductAnalyticsRetentionFixedTimeIntervalUnitSerializer() { + this(null); + } + + @Override + public void serialize( + ProductAnalyticsRetentionFixedTimeIntervalUnit value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ProductAnalyticsRetentionFixedTimeIntervalUnit fromValue(String value) { + return new ProductAnalyticsRetentionFixedTimeIntervalUnit(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionGridCohort.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionGridCohort.java new file mode 100644 index 00000000000..978a1a345c6 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionGridCohort.java @@ -0,0 +1,419 @@ +/* + * 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; + +/** One row of the retention grid, holding the results for a single cohort. */ +@JsonPropertyOrder({ + ProductAnalyticsRetentionGridCohort.JSON_PROPERTY_CELLS, + ProductAnalyticsRetentionGridCohort.JSON_PROPERTY_COHORT_END_TIME, + ProductAnalyticsRetentionGridCohort.JSON_PROPERTY_COHORT_INDEX, + ProductAnalyticsRetentionGridCohort.JSON_PROPERTY_COHORT_SIZE, + ProductAnalyticsRetentionGridCohort.JSON_PROPERTY_COHORT_START_TIME, + ProductAnalyticsRetentionGridCohort.JSON_PROPERTY_GROUP_TAGS, + ProductAnalyticsRetentionGridCohort.JSON_PROPERTY_NAME, + ProductAnalyticsRetentionGridCohort.JSON_PROPERTY_TYPE, + ProductAnalyticsRetentionGridCohort.JSON_PROPERTY_UNIT +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsRetentionGridCohort { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CELLS = "cells"; + private List cells = null; + + public static final String JSON_PROPERTY_COHORT_END_TIME = "cohort_end_time"; + private Long cohortEndTime; + + public static final String JSON_PROPERTY_COHORT_INDEX = "cohort_index"; + private Long cohortIndex; + + public static final String JSON_PROPERTY_COHORT_SIZE = "cohort_size"; + private Long cohortSize; + + public static final String JSON_PROPERTY_COHORT_START_TIME = "cohort_start_time"; + private Long cohortStartTime; + + public static final String JSON_PROPERTY_GROUP_TAGS = "group_tags"; + private List groupTags = null; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ProductAnalyticsRetentionGridCohortType type; + + public static final String JSON_PROPERTY_UNIT = "unit"; + private List unit = null; + + public ProductAnalyticsRetentionGridCohort cells( + List cells) { + this.cells = cells; + if (cells != null) { + for (ProductAnalyticsRetentionGridCohortCell item : cells) { + this.unparsed |= item.unparsed; + } + } + return this; + } + + public ProductAnalyticsRetentionGridCohort addCellsItem( + ProductAnalyticsRetentionGridCohortCell cellsItem) { + if (this.cells == null) { + this.cells = new ArrayList<>(); + } + this.cells.add(cellsItem); + this.unparsed |= cellsItem.unparsed; + return this; + } + + /** + * The cells of the row, one per return period. + * + * @return cells + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CELLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getCells() { + return cells; + } + + public void setCells(List cells) { + this.cells = cells; + if (cells != null) { + for (ProductAnalyticsRetentionGridCohortCell item : cells) { + this.unparsed |= item.unparsed; + } + } + } + + public ProductAnalyticsRetentionGridCohort cohortEndTime(Long cohortEndTime) { + this.cohortEndTime = cohortEndTime; + return this; + } + + /** + * End of the cohort window, in epoch milliseconds. + * + * @return cohortEndTime + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COHORT_END_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getCohortEndTime() { + return cohortEndTime; + } + + public void setCohortEndTime(Long cohortEndTime) { + this.cohortEndTime = cohortEndTime; + } + + public ProductAnalyticsRetentionGridCohort cohortIndex(Long cohortIndex) { + this.cohortIndex = cohortIndex; + return this; + } + + /** + * Zero-based index of the cohort in the grid. + * + * @return cohortIndex + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COHORT_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getCohortIndex() { + return cohortIndex; + } + + public void setCohortIndex(Long cohortIndex) { + this.cohortIndex = cohortIndex; + } + + public ProductAnalyticsRetentionGridCohort cohortSize(Long cohortSize) { + this.cohortSize = cohortSize; + return this; + } + + /** + * Number of entities in the cohort. + * + * @return cohortSize + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COHORT_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getCohortSize() { + return cohortSize; + } + + public void setCohortSize(Long cohortSize) { + this.cohortSize = cohortSize; + } + + public ProductAnalyticsRetentionGridCohort cohortStartTime(Long cohortStartTime) { + this.cohortStartTime = cohortStartTime; + return this; + } + + /** + * Start of the cohort window, in epoch milliseconds. + * + * @return cohortStartTime + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COHORT_START_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getCohortStartTime() { + return cohortStartTime; + } + + public void setCohortStartTime(Long cohortStartTime) { + this.cohortStartTime = cohortStartTime; + } + + public ProductAnalyticsRetentionGridCohort groupTags(List groupTags) { + this.groupTags = groupTags; + return this; + } + + public ProductAnalyticsRetentionGridCohort addGroupTagsItem(String groupTagsItem) { + if (this.groupTags == null) { + this.groupTags = new ArrayList<>(); + } + this.groupTags.add(groupTagsItem); + return this; + } + + /** + * The group-by facet values that identify this row. + * + * @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 ProductAnalyticsRetentionGridCohort name(String name) { + this.name = name; + return this; + } + + /** + * Label identifying the cohort, such as the week it started. + * + * @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 ProductAnalyticsRetentionGridCohort type(ProductAnalyticsRetentionGridCohortType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Whether the row holds one cohort's own numbers, or the weighted roll-up across every cohort. + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ProductAnalyticsRetentionGridCohortType getType() { + return type; + } + + public void setType(ProductAnalyticsRetentionGridCohortType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + public ProductAnalyticsRetentionGridCohort unit(List unit) { + this.unit = unit; + if (unit != null) { + for (ProductAnalyticsUnit item : unit) { + this.unparsed |= item.unparsed; + } + } + return this; + } + + public ProductAnalyticsRetentionGridCohort addUnitItem(ProductAnalyticsUnit unitItem) { + if (this.unit == null) { + this.unit = new ArrayList<>(); + } + this.unit.add(unitItem); + this.unparsed |= unitItem.unparsed; + return this; + } + + /** + * Unit definitions for the cell values. + * + * @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; + if (unit != null) { + for (ProductAnalyticsUnit item : unit) { + this.unparsed |= item.unparsed; + } + } + } + + /** + * 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 ProductAnalyticsRetentionGridCohort + */ + @JsonAnySetter + public ProductAnalyticsRetentionGridCohort 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 ProductAnalyticsRetentionGridCohort object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsRetentionGridCohort productAnalyticsRetentionGridCohort = + (ProductAnalyticsRetentionGridCohort) o; + return Objects.equals(this.cells, productAnalyticsRetentionGridCohort.cells) + && Objects.equals(this.cohortEndTime, productAnalyticsRetentionGridCohort.cohortEndTime) + && Objects.equals(this.cohortIndex, productAnalyticsRetentionGridCohort.cohortIndex) + && Objects.equals(this.cohortSize, productAnalyticsRetentionGridCohort.cohortSize) + && Objects.equals(this.cohortStartTime, productAnalyticsRetentionGridCohort.cohortStartTime) + && Objects.equals(this.groupTags, productAnalyticsRetentionGridCohort.groupTags) + && Objects.equals(this.name, productAnalyticsRetentionGridCohort.name) + && Objects.equals(this.type, productAnalyticsRetentionGridCohort.type) + && Objects.equals(this.unit, productAnalyticsRetentionGridCohort.unit) + && Objects.equals( + this.additionalProperties, productAnalyticsRetentionGridCohort.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + cells, + cohortEndTime, + cohortIndex, + cohortSize, + cohortStartTime, + groupTags, + name, + type, + unit, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsRetentionGridCohort {\n"); + sb.append(" cells: ").append(toIndentedString(cells)).append("\n"); + sb.append(" cohortEndTime: ").append(toIndentedString(cohortEndTime)).append("\n"); + sb.append(" cohortIndex: ").append(toIndentedString(cohortIndex)).append("\n"); + sb.append(" cohortSize: ").append(toIndentedString(cohortSize)).append("\n"); + sb.append(" cohortStartTime: ").append(toIndentedString(cohortStartTime)).append("\n"); + sb.append(" groupTags: ").append(toIndentedString(groupTags)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).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/ProductAnalyticsRetentionGridCohortCell.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionGridCohortCell.java new file mode 100644 index 00000000000..2a6ef142961 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionGridCohortCell.java @@ -0,0 +1,410 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * One cell of the retention grid, holding the result for a single cohort over a single return + * period. Aggregated rows omit the time and count fields. + */ +@JsonPropertyOrder({ + ProductAnalyticsRetentionGridCohortCell.JSON_PROPERTY_CELL_COUNT, + ProductAnalyticsRetentionGridCohortCell.JSON_PROPERTY_CELL_RATE, + ProductAnalyticsRetentionGridCohortCell.JSON_PROPERTY_CELL_RELATIVE_VALUE_CHANGE, + ProductAnalyticsRetentionGridCohortCell.JSON_PROPERTY_CELL_VALUE, + ProductAnalyticsRetentionGridCohortCell.JSON_PROPERTY_IS_PARTIAL_DATA, + ProductAnalyticsRetentionGridCohortCell.JSON_PROPERTY_RETURN_PERIOD_END_TIME, + ProductAnalyticsRetentionGridCohortCell.JSON_PROPERTY_RETURN_PERIOD_INDEX, + ProductAnalyticsRetentionGridCohortCell.JSON_PROPERTY_RETURN_PERIOD_START_TIME, + ProductAnalyticsRetentionGridCohortCell.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsRetentionGridCohortCell { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CELL_COUNT = "cell_count"; + private Long cellCount; + + public static final String JSON_PROPERTY_CELL_RATE = "cell_rate"; + private Double cellRate; + + public static final String JSON_PROPERTY_CELL_RELATIVE_VALUE_CHANGE = + "cell_relative_value_change"; + private JsonNullable cellRelativeValueChange = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_CELL_VALUE = "cell_value"; + private JsonNullable cellValue = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_IS_PARTIAL_DATA = "is_partial_data"; + private Boolean isPartialData; + + public static final String JSON_PROPERTY_RETURN_PERIOD_END_TIME = "return_period_end_time"; + private Long returnPeriodEndTime; + + public static final String JSON_PROPERTY_RETURN_PERIOD_INDEX = "return_period_index"; + private Long returnPeriodIndex; + + public static final String JSON_PROPERTY_RETURN_PERIOD_START_TIME = "return_period_start_time"; + private Long returnPeriodStartTime; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ProductAnalyticsRetentionGridCohortType type; + + public ProductAnalyticsRetentionGridCohortCell cellCount(Long cellCount) { + this.cellCount = cellCount; + return this; + } + + /** + * Number of entities that returned during the period. + * + * @return cellCount + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CELL_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getCellCount() { + return cellCount; + } + + public void setCellCount(Long cellCount) { + this.cellCount = cellCount; + } + + public ProductAnalyticsRetentionGridCohortCell cellRate(Double cellRate) { + this.cellRate = cellRate; + return this; + } + + /** + * Fraction of the cohort that returned, between 0 and 1. + * + * @return cellRate + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CELL_RATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getCellRate() { + return cellRate; + } + + public void setCellRate(Double cellRate) { + this.cellRate = cellRate; + } + + public ProductAnalyticsRetentionGridCohortCell cellRelativeValueChange( + Double cellRelativeValueChange) { + this.cellRelativeValueChange = JsonNullable.of(cellRelativeValueChange); + return this; + } + + /** + * Change in the metric relative to the cohort baseline. + * + * @return cellRelativeValueChange + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Double getCellRelativeValueChange() { + return cellRelativeValueChange.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_CELL_RELATIVE_VALUE_CHANGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getCellRelativeValueChange_JsonNullable() { + return cellRelativeValueChange; + } + + @JsonProperty(JSON_PROPERTY_CELL_RELATIVE_VALUE_CHANGE) + public void setCellRelativeValueChange_JsonNullable( + JsonNullable cellRelativeValueChange) { + this.cellRelativeValueChange = cellRelativeValueChange; + } + + public void setCellRelativeValueChange(Double cellRelativeValueChange) { + this.cellRelativeValueChange = JsonNullable.of(cellRelativeValueChange); + } + + public ProductAnalyticsRetentionGridCohortCell cellValue(Double cellValue) { + this.cellValue = JsonNullable.of(cellValue); + return this; + } + + /** + * Value of the computed metric, when a metric other than the retention rate is requested. + * + * @return cellValue + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Double getCellValue() { + return cellValue.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_CELL_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getCellValue_JsonNullable() { + return cellValue; + } + + @JsonProperty(JSON_PROPERTY_CELL_VALUE) + public void setCellValue_JsonNullable(JsonNullable cellValue) { + this.cellValue = cellValue; + } + + public void setCellValue(Double cellValue) { + this.cellValue = JsonNullable.of(cellValue); + } + + public ProductAnalyticsRetentionGridCohortCell isPartialData(Boolean isPartialData) { + this.isPartialData = isPartialData; + return this; + } + + /** + * Whether the return period is still open, so the numbers are not yet final. + * + * @return isPartialData + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_PARTIAL_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsPartialData() { + return isPartialData; + } + + public void setIsPartialData(Boolean isPartialData) { + this.isPartialData = isPartialData; + } + + public ProductAnalyticsRetentionGridCohortCell returnPeriodEndTime(Long returnPeriodEndTime) { + this.returnPeriodEndTime = returnPeriodEndTime; + return this; + } + + /** + * End of the return period, in epoch milliseconds. + * + * @return returnPeriodEndTime + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RETURN_PERIOD_END_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getReturnPeriodEndTime() { + return returnPeriodEndTime; + } + + public void setReturnPeriodEndTime(Long returnPeriodEndTime) { + this.returnPeriodEndTime = returnPeriodEndTime; + } + + public ProductAnalyticsRetentionGridCohortCell returnPeriodIndex(Long returnPeriodIndex) { + this.returnPeriodIndex = returnPeriodIndex; + return this; + } + + /** + * Zero-based index of the return period this cell belongs to. + * + * @return returnPeriodIndex + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RETURN_PERIOD_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getReturnPeriodIndex() { + return returnPeriodIndex; + } + + public void setReturnPeriodIndex(Long returnPeriodIndex) { + this.returnPeriodIndex = returnPeriodIndex; + } + + public ProductAnalyticsRetentionGridCohortCell returnPeriodStartTime(Long returnPeriodStartTime) { + this.returnPeriodStartTime = returnPeriodStartTime; + return this; + } + + /** + * Start of the return period, in epoch milliseconds. + * + * @return returnPeriodStartTime + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RETURN_PERIOD_START_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getReturnPeriodStartTime() { + return returnPeriodStartTime; + } + + public void setReturnPeriodStartTime(Long returnPeriodStartTime) { + this.returnPeriodStartTime = returnPeriodStartTime; + } + + public ProductAnalyticsRetentionGridCohortCell type( + ProductAnalyticsRetentionGridCohortType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Whether the row holds one cohort's own numbers, or the weighted roll-up across every cohort. + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ProductAnalyticsRetentionGridCohortType getType() { + return type; + } + + public void setType(ProductAnalyticsRetentionGridCohortType 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 ProductAnalyticsRetentionGridCohortCell + */ + @JsonAnySetter + public ProductAnalyticsRetentionGridCohortCell 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 ProductAnalyticsRetentionGridCohortCell object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsRetentionGridCohortCell productAnalyticsRetentionGridCohortCell = + (ProductAnalyticsRetentionGridCohortCell) o; + return Objects.equals(this.cellCount, productAnalyticsRetentionGridCohortCell.cellCount) + && Objects.equals(this.cellRate, productAnalyticsRetentionGridCohortCell.cellRate) + && Objects.equals( + this.cellRelativeValueChange, + productAnalyticsRetentionGridCohortCell.cellRelativeValueChange) + && Objects.equals(this.cellValue, productAnalyticsRetentionGridCohortCell.cellValue) + && Objects.equals(this.isPartialData, productAnalyticsRetentionGridCohortCell.isPartialData) + && Objects.equals( + this.returnPeriodEndTime, productAnalyticsRetentionGridCohortCell.returnPeriodEndTime) + && Objects.equals( + this.returnPeriodIndex, productAnalyticsRetentionGridCohortCell.returnPeriodIndex) + && Objects.equals( + this.returnPeriodStartTime, + productAnalyticsRetentionGridCohortCell.returnPeriodStartTime) + && Objects.equals(this.type, productAnalyticsRetentionGridCohortCell.type) + && Objects.equals( + this.additionalProperties, + productAnalyticsRetentionGridCohortCell.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + cellCount, + cellRate, + cellRelativeValueChange, + cellValue, + isPartialData, + returnPeriodEndTime, + returnPeriodIndex, + returnPeriodStartTime, + type, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsRetentionGridCohortCell {\n"); + sb.append(" cellCount: ").append(toIndentedString(cellCount)).append("\n"); + sb.append(" cellRate: ").append(toIndentedString(cellRate)).append("\n"); + sb.append(" cellRelativeValueChange: ") + .append(toIndentedString(cellRelativeValueChange)) + .append("\n"); + sb.append(" cellValue: ").append(toIndentedString(cellValue)).append("\n"); + sb.append(" isPartialData: ").append(toIndentedString(isPartialData)).append("\n"); + sb.append(" returnPeriodEndTime: ") + .append(toIndentedString(returnPeriodEndTime)) + .append("\n"); + sb.append(" returnPeriodIndex: ").append(toIndentedString(returnPeriodIndex)).append("\n"); + sb.append(" returnPeriodStartTime: ") + .append(toIndentedString(returnPeriodStartTime)) + .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/ProductAnalyticsRetentionGridCohortType.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionGridCohortType.java new file mode 100644 index 00000000000..8bc2e2063f8 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionGridCohortType.java @@ -0,0 +1,65 @@ +/* + * 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; + +/** Whether the row holds one cohort's own numbers, or the weighted roll-up across every cohort. */ +@JsonSerialize( + using = + ProductAnalyticsRetentionGridCohortType.ProductAnalyticsRetentionGridCohortTypeSerializer + .class) +public class ProductAnalyticsRetentionGridCohortType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("raw", "aggregated")); + + public static final ProductAnalyticsRetentionGridCohortType RAW = + new ProductAnalyticsRetentionGridCohortType("raw"); + public static final ProductAnalyticsRetentionGridCohortType AGGREGATED = + new ProductAnalyticsRetentionGridCohortType("aggregated"); + + ProductAnalyticsRetentionGridCohortType(String value) { + super(value, allowedValues); + } + + public static class ProductAnalyticsRetentionGridCohortTypeSerializer + extends StdSerializer { + public ProductAnalyticsRetentionGridCohortTypeSerializer( + Class t) { + super(t); + } + + public ProductAnalyticsRetentionGridCohortTypeSerializer() { + this(null); + } + + @Override + public void serialize( + ProductAnalyticsRetentionGridCohortType value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ProductAnalyticsRetentionGridCohortType fromValue(String value) { + return new ProductAnalyticsRetentionGridCohortType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionGridQuery.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionGridQuery.java new file mode 100644 index 00000000000..77adcaea0ea --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionGridQuery.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.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Query definition for a retention grid or retention metadata request. */ +@JsonPropertyOrder({ + ProductAnalyticsRetentionGridQuery.JSON_PROPERTY_COMPUTATION_SCOPE, + ProductAnalyticsRetentionGridQuery.JSON_PROPERTY_COMPUTE, + ProductAnalyticsRetentionGridQuery.JSON_PROPERTY_GROUP_BY, + ProductAnalyticsRetentionGridQuery.JSON_PROPERTY_SEARCH +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsRetentionGridQuery { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_COMPUTATION_SCOPE = "computation_scope"; + private ProductAnalyticsRetentionScope computationScope; + + public static final String JSON_PROPERTY_COMPUTE = "compute"; + private ProductAnalyticsRetentionCompute compute; + + public static final String JSON_PROPERTY_GROUP_BY = "group_by"; + private List groupBy = null; + + public static final String JSON_PROPERTY_SEARCH = "search"; + private ProductAnalyticsRetentionSearch search; + + public ProductAnalyticsRetentionGridQuery() {} + + @JsonCreator + public ProductAnalyticsRetentionGridQuery( + @JsonProperty(required = true, value = JSON_PROPERTY_COMPUTE) + ProductAnalyticsRetentionCompute compute, + @JsonProperty(required = true, value = JSON_PROPERTY_SEARCH) + ProductAnalyticsRetentionSearch search) { + this.compute = compute; + this.unparsed |= compute.unparsed; + this.search = search; + this.unparsed |= search.unparsed; + } + + public ProductAnalyticsRetentionGridQuery computationScope( + ProductAnalyticsRetentionScope computationScope) { + this.computationScope = computationScope; + this.unparsed |= computationScope.unparsed; + return this; + } + + /** + * Restricts a retention query to part of the grid, so that results can be examined in detail. + * Omit it to compute the whole grid. + * + * @return computationScope + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COMPUTATION_SCOPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ProductAnalyticsRetentionScope getComputationScope() { + return computationScope; + } + + public void setComputationScope(ProductAnalyticsRetentionScope computationScope) { + this.computationScope = computationScope; + if (computationScope != null) { + this.unparsed |= computationScope.unparsed; + } + } + + public ProductAnalyticsRetentionGridQuery compute(ProductAnalyticsRetentionCompute compute) { + this.compute = compute; + this.unparsed |= compute.unparsed; + return this; + } + + /** + * The metric and aggregation applied to a retention query. + * + * @return compute + */ + @JsonProperty(JSON_PROPERTY_COMPUTE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsRetentionCompute getCompute() { + return compute; + } + + public void setCompute(ProductAnalyticsRetentionCompute compute) { + this.compute = compute; + if (compute != null) { + this.unparsed |= compute.unparsed; + } + } + + public ProductAnalyticsRetentionGridQuery groupBy( + List groupBy) { + this.groupBy = groupBy; + if (groupBy != null) { + for (ProductAnalyticsRetentionGroupBy item : groupBy) { + this.unparsed |= item.unparsed; + } + } + return this; + } + + public ProductAnalyticsRetentionGridQuery addGroupByItem( + ProductAnalyticsRetentionGroupBy groupByItem) { + if (this.groupBy == null) { + this.groupBy = new ArrayList<>(); + } + this.groupBy.add(groupByItem); + this.unparsed |= groupByItem.unparsed; + return this; + } + + /** + * Splits the results by the values of one or more facets. + * + * @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; + if (groupBy != null) { + for (ProductAnalyticsRetentionGroupBy item : groupBy) { + this.unparsed |= item.unparsed; + } + } + } + + public ProductAnalyticsRetentionGridQuery search(ProductAnalyticsRetentionSearch search) { + this.search = search; + this.unparsed |= search.unparsed; + return this; + } + + /** + * Defines the cohort and return criteria that make up a retention query. + * + * @return search + */ + @JsonProperty(JSON_PROPERTY_SEARCH) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsRetentionSearch getSearch() { + return search; + } + + public void setSearch(ProductAnalyticsRetentionSearch search) { + this.search = search; + if (search != null) { + this.unparsed |= search.unparsed; + } + } + + /** + * 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 ProductAnalyticsRetentionGridQuery + */ + @JsonAnySetter + public ProductAnalyticsRetentionGridQuery 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 ProductAnalyticsRetentionGridQuery object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsRetentionGridQuery productAnalyticsRetentionGridQuery = + (ProductAnalyticsRetentionGridQuery) o; + return Objects.equals( + this.computationScope, productAnalyticsRetentionGridQuery.computationScope) + && Objects.equals(this.compute, productAnalyticsRetentionGridQuery.compute) + && Objects.equals(this.groupBy, productAnalyticsRetentionGridQuery.groupBy) + && Objects.equals(this.search, productAnalyticsRetentionGridQuery.search) + && Objects.equals( + this.additionalProperties, productAnalyticsRetentionGridQuery.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(computationScope, compute, groupBy, search, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsRetentionGridQuery {\n"); + sb.append(" computationScope: ").append(toIndentedString(computationScope)).append("\n"); + sb.append(" compute: ").append(toIndentedString(compute)).append("\n"); + sb.append(" groupBy: ").append(toIndentedString(groupBy)).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/ProductAnalyticsRetentionGridRequest.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionGridRequest.java new file mode 100644 index 00000000000..72af3650fb4 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionGridRequest.java @@ -0,0 +1,152 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Request body for a retention grid query. */ +@JsonPropertyOrder({ProductAnalyticsRetentionGridRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsRetentionGridRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private ProductAnalyticsRetentionGridRequestData data; + + public ProductAnalyticsRetentionGridRequest() {} + + @JsonCreator + public ProductAnalyticsRetentionGridRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + ProductAnalyticsRetentionGridRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public ProductAnalyticsRetentionGridRequest data(ProductAnalyticsRetentionGridRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * The single JSON:API resource carrying a retention grid query. Its attributes hold the time + * window to query and the cohort and return criteria that define the grid. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsRetentionGridRequestData getData() { + return data; + } + + public void setData(ProductAnalyticsRetentionGridRequestData data) { + this.data = data; + if (data != null) { + this.unparsed |= data.unparsed; + } + } + + /** + * 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 ProductAnalyticsRetentionGridRequest + */ + @JsonAnySetter + public ProductAnalyticsRetentionGridRequest 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 ProductAnalyticsRetentionGridRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsRetentionGridRequest productAnalyticsRetentionGridRequest = + (ProductAnalyticsRetentionGridRequest) o; + return Objects.equals(this.data, productAnalyticsRetentionGridRequest.data) + && Objects.equals( + this.additionalProperties, productAnalyticsRetentionGridRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsRetentionGridRequest {\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/ProductAnalyticsRetentionGridRequestAttributes.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionGridRequestAttributes.java new file mode 100644 index 00000000000..e7051365781 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionGridRequestAttributes.java @@ -0,0 +1,244 @@ +/* + * 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 of a retention grid request. */ +@JsonPropertyOrder({ + ProductAnalyticsRetentionGridRequestAttributes.JSON_PROPERTY_EXCLUDE_ANONYMOUS_TRAFFIC, + ProductAnalyticsRetentionGridRequestAttributes.JSON_PROPERTY_FROM, + ProductAnalyticsRetentionGridRequestAttributes.JSON_PROPERTY_QUERY, + ProductAnalyticsRetentionGridRequestAttributes.JSON_PROPERTY_TO +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsRetentionGridRequestAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_EXCLUDE_ANONYMOUS_TRAFFIC = "exclude_anonymous_traffic"; + private Boolean excludeAnonymousTraffic = false; + + public static final String JSON_PROPERTY_FROM = "from"; + private Long from; + + public static final String JSON_PROPERTY_QUERY = "query"; + private ProductAnalyticsRetentionGridQuery query; + + public static final String JSON_PROPERTY_TO = "to"; + private Long to; + + public ProductAnalyticsRetentionGridRequestAttributes() {} + + @JsonCreator + public ProductAnalyticsRetentionGridRequestAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_FROM) Long from, + @JsonProperty(required = true, value = JSON_PROPERTY_QUERY) + ProductAnalyticsRetentionGridQuery query, + @JsonProperty(required = true, value = JSON_PROPERTY_TO) Long to) { + this.from = from; + this.query = query; + this.unparsed |= query.unparsed; + this.to = to; + } + + public ProductAnalyticsRetentionGridRequestAttributes excludeAnonymousTraffic( + Boolean excludeAnonymousTraffic) { + this.excludeAnonymousTraffic = excludeAnonymousTraffic; + return this; + } + + /** + * Whether to exclude sessions that are not tied to an identified user. + * + * @return excludeAnonymousTraffic + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EXCLUDE_ANONYMOUS_TRAFFIC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getExcludeAnonymousTraffic() { + return excludeAnonymousTraffic; + } + + public void setExcludeAnonymousTraffic(Boolean excludeAnonymousTraffic) { + this.excludeAnonymousTraffic = excludeAnonymousTraffic; + } + + public ProductAnalyticsRetentionGridRequestAttributes from(Long from) { + this.from = from; + return this; + } + + /** + * Start of the query window, in epoch milliseconds. + * + * @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 ProductAnalyticsRetentionGridRequestAttributes query( + ProductAnalyticsRetentionGridQuery query) { + this.query = query; + this.unparsed |= query.unparsed; + return this; + } + + /** + * Query definition for a retention grid or retention metadata request. + * + * @return query + */ + @JsonProperty(JSON_PROPERTY_QUERY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsRetentionGridQuery getQuery() { + return query; + } + + public void setQuery(ProductAnalyticsRetentionGridQuery query) { + this.query = query; + if (query != null) { + this.unparsed |= query.unparsed; + } + } + + public ProductAnalyticsRetentionGridRequestAttributes to(Long to) { + this.to = to; + return this; + } + + /** + * End of the query window, 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 ProductAnalyticsRetentionGridRequestAttributes + */ + @JsonAnySetter + public ProductAnalyticsRetentionGridRequestAttributes 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 ProductAnalyticsRetentionGridRequestAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsRetentionGridRequestAttributes productAnalyticsRetentionGridRequestAttributes = + (ProductAnalyticsRetentionGridRequestAttributes) o; + return Objects.equals( + this.excludeAnonymousTraffic, + productAnalyticsRetentionGridRequestAttributes.excludeAnonymousTraffic) + && Objects.equals(this.from, productAnalyticsRetentionGridRequestAttributes.from) + && Objects.equals(this.query, productAnalyticsRetentionGridRequestAttributes.query) + && Objects.equals(this.to, productAnalyticsRetentionGridRequestAttributes.to) + && Objects.equals( + this.additionalProperties, + productAnalyticsRetentionGridRequestAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(excludeAnonymousTraffic, from, query, to, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsRetentionGridRequestAttributes {\n"); + sb.append(" excludeAnonymousTraffic: ") + .append(toIndentedString(excludeAnonymousTraffic)) + .append("\n"); + sb.append(" from: ").append(toIndentedString(from)).append("\n"); + sb.append(" query: ").append(toIndentedString(query)).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/ProductAnalyticsRetentionGridRequestData.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionGridRequestData.java new file mode 100644 index 00000000000..2aadd3766e7 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionGridRequestData.java @@ -0,0 +1,193 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * The single JSON:API resource carrying a retention grid query. Its attributes hold the time window + * to query and the cohort and return criteria that define the grid. + */ +@JsonPropertyOrder({ + ProductAnalyticsRetentionGridRequestData.JSON_PROPERTY_ATTRIBUTES, + ProductAnalyticsRetentionGridRequestData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsRetentionGridRequestData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private ProductAnalyticsRetentionGridRequestAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ProductAnalyticsRetentionGridRequestType type; + + public ProductAnalyticsRetentionGridRequestData() {} + + @JsonCreator + public ProductAnalyticsRetentionGridRequestData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + ProductAnalyticsRetentionGridRequestAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + ProductAnalyticsRetentionGridRequestType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public ProductAnalyticsRetentionGridRequestData attributes( + ProductAnalyticsRetentionGridRequestAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of a retention grid request. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsRetentionGridRequestAttributes getAttributes() { + return attributes; + } + + public void setAttributes(ProductAnalyticsRetentionGridRequestAttributes attributes) { + this.attributes = attributes; + if (attributes != null) { + this.unparsed |= attributes.unparsed; + } + } + + public ProductAnalyticsRetentionGridRequestData type( + ProductAnalyticsRetentionGridRequestType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The resource type identifier for a retention grid request. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsRetentionGridRequestType getType() { + return type; + } + + public void setType(ProductAnalyticsRetentionGridRequestType 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 ProductAnalyticsRetentionGridRequestData + */ + @JsonAnySetter + public ProductAnalyticsRetentionGridRequestData 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 ProductAnalyticsRetentionGridRequestData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsRetentionGridRequestData productAnalyticsRetentionGridRequestData = + (ProductAnalyticsRetentionGridRequestData) o; + return Objects.equals(this.attributes, productAnalyticsRetentionGridRequestData.attributes) + && Objects.equals(this.type, productAnalyticsRetentionGridRequestData.type) + && Objects.equals( + this.additionalProperties, + productAnalyticsRetentionGridRequestData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsRetentionGridRequestData {\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/ProductAnalyticsRetentionGridRequestType.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionGridRequestType.java new file mode 100644 index 00000000000..6e86456ea5c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionGridRequestType.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 resource type identifier for a retention grid request. */ +@JsonSerialize( + using = + ProductAnalyticsRetentionGridRequestType.ProductAnalyticsRetentionGridRequestTypeSerializer + .class) +public class ProductAnalyticsRetentionGridRequestType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("retention_grid_request")); + + public static final ProductAnalyticsRetentionGridRequestType RETENTION_GRID_REQUEST = + new ProductAnalyticsRetentionGridRequestType("retention_grid_request"); + + ProductAnalyticsRetentionGridRequestType(String value) { + super(value, allowedValues); + } + + public static class ProductAnalyticsRetentionGridRequestTypeSerializer + extends StdSerializer { + public ProductAnalyticsRetentionGridRequestTypeSerializer( + Class t) { + super(t); + } + + public ProductAnalyticsRetentionGridRequestTypeSerializer() { + this(null); + } + + @Override + public void serialize( + ProductAnalyticsRetentionGridRequestType value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ProductAnalyticsRetentionGridRequestType fromValue(String value) { + return new ProductAnalyticsRetentionGridRequestType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionGridResponse.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionGridResponse.java new file mode 100644 index 00000000000..536310cc84b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionGridResponse.java @@ -0,0 +1,153 @@ +/* + * 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; + +/** Response for a retention grid query. */ +@JsonPropertyOrder({ProductAnalyticsRetentionGridResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsRetentionGridResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private ProductAnalyticsRetentionGridResponseData data; + + public ProductAnalyticsRetentionGridResponse() {} + + @JsonCreator + public ProductAnalyticsRetentionGridResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + ProductAnalyticsRetentionGridResponseData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public ProductAnalyticsRetentionGridResponse data( + ProductAnalyticsRetentionGridResponseData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * The single JSON:API resource holding a computed retention grid. Its attributes contain the + * return periods forming the columns and the cohorts forming the rows. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsRetentionGridResponseData getData() { + return data; + } + + public void setData(ProductAnalyticsRetentionGridResponseData data) { + this.data = data; + if (data != null) { + this.unparsed |= data.unparsed; + } + } + + /** + * 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 ProductAnalyticsRetentionGridResponse + */ + @JsonAnySetter + public ProductAnalyticsRetentionGridResponse 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 ProductAnalyticsRetentionGridResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsRetentionGridResponse productAnalyticsRetentionGridResponse = + (ProductAnalyticsRetentionGridResponse) o; + return Objects.equals(this.data, productAnalyticsRetentionGridResponse.data) + && Objects.equals( + this.additionalProperties, productAnalyticsRetentionGridResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsRetentionGridResponse {\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/ProductAnalyticsRetentionGridResponseAttributes.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionGridResponseAttributes.java new file mode 100644 index 00000000000..8e18d623f83 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionGridResponseAttributes.java @@ -0,0 +1,289 @@ +/* + * 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; + +/** Attributes of a retention grid response, containing the cohort rows and the period columns. */ +@JsonPropertyOrder({ + ProductAnalyticsRetentionGridResponseAttributes.JSON_PROPERTY_COHORTS, + ProductAnalyticsRetentionGridResponseAttributes.JSON_PROPERTY_RETENTION_ENTITY, + ProductAnalyticsRetentionGridResponseAttributes.JSON_PROPERTY_RETENTION_PERIODS, + ProductAnalyticsRetentionGridResponseAttributes.JSON_PROPERTY_UNIT +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsRetentionGridResponseAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_COHORTS = "cohorts"; + private List cohorts = null; + + public static final String JSON_PROPERTY_RETENTION_ENTITY = "retention_entity"; + private String retentionEntity; + + public static final String JSON_PROPERTY_RETENTION_PERIODS = "retention_periods"; + private List retentionPeriods = null; + + public static final String JSON_PROPERTY_UNIT = "unit"; + private List unit = null; + + public ProductAnalyticsRetentionGridResponseAttributes cohorts( + List cohorts) { + this.cohorts = cohorts; + if (cohorts != null) { + for (ProductAnalyticsRetentionGridCohort item : cohorts) { + this.unparsed |= item.unparsed; + } + } + return this; + } + + public ProductAnalyticsRetentionGridResponseAttributes addCohortsItem( + ProductAnalyticsRetentionGridCohort cohortsItem) { + if (this.cohorts == null) { + this.cohorts = new ArrayList<>(); + } + this.cohorts.add(cohortsItem); + this.unparsed |= cohortsItem.unparsed; + return this; + } + + /** + * The cohorts forming the rows of the grid. + * + * @return cohorts + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COHORTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getCohorts() { + return cohorts; + } + + public void setCohorts(List cohorts) { + this.cohorts = cohorts; + if (cohorts != null) { + for (ProductAnalyticsRetentionGridCohort item : cohorts) { + this.unparsed |= item.unparsed; + } + } + } + + public ProductAnalyticsRetentionGridResponseAttributes retentionEntity(String retentionEntity) { + this.retentionEntity = retentionEntity; + return this; + } + + /** + * The entity whose retention was measured. + * + * @return retentionEntity + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RETENTION_ENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getRetentionEntity() { + return retentionEntity; + } + + public void setRetentionEntity(String retentionEntity) { + this.retentionEntity = retentionEntity; + } + + public ProductAnalyticsRetentionGridResponseAttributes retentionPeriods( + List retentionPeriods) { + this.retentionPeriods = retentionPeriods; + if (retentionPeriods != null) { + for (ProductAnalyticsRetentionPeriod item : retentionPeriods) { + this.unparsed |= item.unparsed; + } + } + return this; + } + + public ProductAnalyticsRetentionGridResponseAttributes addRetentionPeriodsItem( + ProductAnalyticsRetentionPeriod retentionPeriodsItem) { + if (this.retentionPeriods == null) { + this.retentionPeriods = new ArrayList<>(); + } + this.retentionPeriods.add(retentionPeriodsItem); + this.unparsed |= retentionPeriodsItem.unparsed; + return this; + } + + /** + * The return periods forming the columns of the grid. + * + * @return retentionPeriods + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RETENTION_PERIODS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getRetentionPeriods() { + return retentionPeriods; + } + + public void setRetentionPeriods(List retentionPeriods) { + this.retentionPeriods = retentionPeriods; + if (retentionPeriods != null) { + for (ProductAnalyticsRetentionPeriod item : retentionPeriods) { + this.unparsed |= item.unparsed; + } + } + } + + public ProductAnalyticsRetentionGridResponseAttributes unit(List unit) { + this.unit = unit; + if (unit != null) { + for (ProductAnalyticsUnit item : unit) { + this.unparsed |= item.unparsed; + } + } + return this; + } + + public ProductAnalyticsRetentionGridResponseAttributes addUnitItem( + ProductAnalyticsUnit unitItem) { + if (this.unit == null) { + this.unit = new ArrayList<>(); + } + this.unit.add(unitItem); + this.unparsed |= unitItem.unparsed; + return this; + } + + /** + * Unit definitions for the grid values. + * + * @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; + if (unit != null) { + for (ProductAnalyticsUnit item : unit) { + this.unparsed |= item.unparsed; + } + } + } + + /** + * 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 ProductAnalyticsRetentionGridResponseAttributes + */ + @JsonAnySetter + public ProductAnalyticsRetentionGridResponseAttributes 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 ProductAnalyticsRetentionGridResponseAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsRetentionGridResponseAttributes + productAnalyticsRetentionGridResponseAttributes = + (ProductAnalyticsRetentionGridResponseAttributes) o; + return Objects.equals(this.cohorts, productAnalyticsRetentionGridResponseAttributes.cohorts) + && Objects.equals( + this.retentionEntity, productAnalyticsRetentionGridResponseAttributes.retentionEntity) + && Objects.equals( + this.retentionPeriods, productAnalyticsRetentionGridResponseAttributes.retentionPeriods) + && Objects.equals(this.unit, productAnalyticsRetentionGridResponseAttributes.unit) + && Objects.equals( + this.additionalProperties, + productAnalyticsRetentionGridResponseAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(cohorts, retentionEntity, retentionPeriods, unit, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsRetentionGridResponseAttributes {\n"); + sb.append(" cohorts: ").append(toIndentedString(cohorts)).append("\n"); + sb.append(" retentionEntity: ").append(toIndentedString(retentionEntity)).append("\n"); + sb.append(" retentionPeriods: ").append(toIndentedString(retentionPeriods)).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/ProductAnalyticsRetentionGridResponseData.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionGridResponseData.java new file mode 100644 index 00000000000..af03bd9a425 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionGridResponseData.java @@ -0,0 +1,221 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * The single JSON:API resource holding a computed retention grid. Its attributes contain the return + * periods forming the columns and the cohorts forming the rows. + */ +@JsonPropertyOrder({ + ProductAnalyticsRetentionGridResponseData.JSON_PROPERTY_ATTRIBUTES, + ProductAnalyticsRetentionGridResponseData.JSON_PROPERTY_ID, + ProductAnalyticsRetentionGridResponseData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsRetentionGridResponseData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private ProductAnalyticsRetentionGridResponseAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ProductAnalyticsRetentionGridResponseType type; + + public ProductAnalyticsRetentionGridResponseData() {} + + @JsonCreator + public ProductAnalyticsRetentionGridResponseData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + ProductAnalyticsRetentionGridResponseAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + ProductAnalyticsRetentionGridResponseType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public ProductAnalyticsRetentionGridResponseData attributes( + ProductAnalyticsRetentionGridResponseAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of a retention grid response, containing the cohort rows and the period columns. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsRetentionGridResponseAttributes getAttributes() { + return attributes; + } + + public void setAttributes(ProductAnalyticsRetentionGridResponseAttributes attributes) { + this.attributes = attributes; + if (attributes != null) { + this.unparsed |= attributes.unparsed; + } + } + + public ProductAnalyticsRetentionGridResponseData id(String id) { + this.id = id; + return this; + } + + /** + * Unique identifier for this response data object. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public ProductAnalyticsRetentionGridResponseData type( + ProductAnalyticsRetentionGridResponseType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The resource type identifier for a retention grid response. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsRetentionGridResponseType getType() { + return type; + } + + public void setType(ProductAnalyticsRetentionGridResponseType 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 ProductAnalyticsRetentionGridResponseData + */ + @JsonAnySetter + public ProductAnalyticsRetentionGridResponseData 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 ProductAnalyticsRetentionGridResponseData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsRetentionGridResponseData productAnalyticsRetentionGridResponseData = + (ProductAnalyticsRetentionGridResponseData) o; + return Objects.equals(this.attributes, productAnalyticsRetentionGridResponseData.attributes) + && Objects.equals(this.id, productAnalyticsRetentionGridResponseData.id) + && Objects.equals(this.type, productAnalyticsRetentionGridResponseData.type) + && Objects.equals( + this.additionalProperties, + productAnalyticsRetentionGridResponseData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsRetentionGridResponseData {\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/ProductAnalyticsRetentionGridResponseType.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionGridResponseType.java new file mode 100644 index 00000000000..b85ccfb3d46 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionGridResponseType.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 resource type identifier for a retention grid response. */ +@JsonSerialize( + using = + ProductAnalyticsRetentionGridResponseType + .ProductAnalyticsRetentionGridResponseTypeSerializer.class) +public class ProductAnalyticsRetentionGridResponseType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("retention_grid_response")); + + public static final ProductAnalyticsRetentionGridResponseType RETENTION_GRID_RESPONSE = + new ProductAnalyticsRetentionGridResponseType("retention_grid_response"); + + ProductAnalyticsRetentionGridResponseType(String value) { + super(value, allowedValues); + } + + public static class ProductAnalyticsRetentionGridResponseTypeSerializer + extends StdSerializer { + public ProductAnalyticsRetentionGridResponseTypeSerializer( + Class t) { + super(t); + } + + public ProductAnalyticsRetentionGridResponseTypeSerializer() { + this(null); + } + + @Override + public void serialize( + ProductAnalyticsRetentionGridResponseType value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ProductAnalyticsRetentionGridResponseType fromValue(String value) { + return new ProductAnalyticsRetentionGridResponseType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionGroupBy.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionGroupBy.java new file mode 100644 index 00000000000..ab98c1669c6 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionGroupBy.java @@ -0,0 +1,297 @@ +/* + * 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; + +/** Splits retention results by the values of a facet. */ +@JsonPropertyOrder({ + ProductAnalyticsRetentionGroupBy.JSON_PROPERTY_FACET, + ProductAnalyticsRetentionGroupBy.JSON_PROPERTY_LIMIT, + ProductAnalyticsRetentionGroupBy.JSON_PROPERTY_SHOULD_EXCLUDE_MISSING, + ProductAnalyticsRetentionGroupBy.JSON_PROPERTY_SORT, + ProductAnalyticsRetentionGroupBy.JSON_PROPERTY_SOURCE, + ProductAnalyticsRetentionGroupBy.JSON_PROPERTY_TARGET +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsRetentionGroupBy { + @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 static final String JSON_PROPERTY_TARGET = "target"; + private ProductAnalyticsRetentionGroupByTarget target; + + public ProductAnalyticsRetentionGroupBy() {} + + @JsonCreator + public ProductAnalyticsRetentionGroupBy( + @JsonProperty(required = true, value = JSON_PROPERTY_FACET) String facet, + @JsonProperty(required = true, value = JSON_PROPERTY_TARGET) + ProductAnalyticsRetentionGroupByTarget target) { + this.facet = facet; + this.target = target; + this.unparsed |= !target.isValid(); + } + + public ProductAnalyticsRetentionGroupBy facet(String facet) { + this.facet = facet; + return this; + } + + /** + * The attribute path 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 ProductAnalyticsRetentionGroupBy limit(Long limit) { + this.limit = limit; + return this; + } + + /** + * Maximum number of groups to return. Omit it to let the service choose. minimum: 1 + * + * @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 ProductAnalyticsRetentionGroupBy shouldExcludeMissing(Boolean shouldExcludeMissing) { + this.shouldExcludeMissing = shouldExcludeMissing; + return this; + } + + /** + * Whether to drop entities that have no value for the facet. + * + * @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 ProductAnalyticsRetentionGroupBy 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; + if (sort != null) { + this.unparsed |= sort.unparsed; + } + } + + public ProductAnalyticsRetentionGroupBy source(String source) { + this.source = source; + return this; + } + + /** + * Audience source backing the group-by, when grouping by an audience rather than a facet. + * + * @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; + } + + public ProductAnalyticsRetentionGroupBy target(ProductAnalyticsRetentionGroupByTarget target) { + this.target = target; + this.unparsed |= !target.isValid(); + return this; + } + + /** + * Which axis of the retention grid a group-by applies to. + * + * @return target + */ + @JsonProperty(JSON_PROPERTY_TARGET) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsRetentionGroupByTarget getTarget() { + return target; + } + + public void setTarget(ProductAnalyticsRetentionGroupByTarget target) { + if (!target.isValid()) { + this.unparsed = true; + } + this.target = target; + } + + /** + * 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 ProductAnalyticsRetentionGroupBy + */ + @JsonAnySetter + public ProductAnalyticsRetentionGroupBy 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 ProductAnalyticsRetentionGroupBy object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsRetentionGroupBy productAnalyticsRetentionGroupBy = + (ProductAnalyticsRetentionGroupBy) o; + return Objects.equals(this.facet, productAnalyticsRetentionGroupBy.facet) + && Objects.equals(this.limit, productAnalyticsRetentionGroupBy.limit) + && Objects.equals( + this.shouldExcludeMissing, productAnalyticsRetentionGroupBy.shouldExcludeMissing) + && Objects.equals(this.sort, productAnalyticsRetentionGroupBy.sort) + && Objects.equals(this.source, productAnalyticsRetentionGroupBy.source) + && Objects.equals(this.target, productAnalyticsRetentionGroupBy.target) + && Objects.equals( + this.additionalProperties, productAnalyticsRetentionGroupBy.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + facet, limit, shouldExcludeMissing, sort, source, target, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsRetentionGroupBy {\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(" target: ").append(toIndentedString(target)).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/ProductAnalyticsRetentionGroupByTarget.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionGroupByTarget.java new file mode 100644 index 00000000000..ac56222334e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionGroupByTarget.java @@ -0,0 +1,65 @@ +/* + * 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; + +/** Which axis of the retention grid a group-by applies to. */ +@JsonSerialize( + using = + ProductAnalyticsRetentionGroupByTarget.ProductAnalyticsRetentionGroupByTargetSerializer + .class) +public class ProductAnalyticsRetentionGroupByTarget extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("cohort", "return_period")); + + public static final ProductAnalyticsRetentionGroupByTarget COHORT = + new ProductAnalyticsRetentionGroupByTarget("cohort"); + public static final ProductAnalyticsRetentionGroupByTarget RETURN_PERIOD = + new ProductAnalyticsRetentionGroupByTarget("return_period"); + + ProductAnalyticsRetentionGroupByTarget(String value) { + super(value, allowedValues); + } + + public static class ProductAnalyticsRetentionGroupByTargetSerializer + extends StdSerializer { + public ProductAnalyticsRetentionGroupByTargetSerializer( + Class t) { + super(t); + } + + public ProductAnalyticsRetentionGroupByTargetSerializer() { + this(null); + } + + @Override + public void serialize( + ProductAnalyticsRetentionGroupByTarget value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ProductAnalyticsRetentionGroupByTarget fromValue(String value) { + return new ProductAnalyticsRetentionGroupByTarget(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionIndexTarget.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionIndexTarget.java new file mode 100644 index 00000000000..9fc3d872042 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionIndexTarget.java @@ -0,0 +1,181 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Selects a cohort or return period by its zero-based position in the grid. */ +@JsonPropertyOrder({ + ProductAnalyticsRetentionIndexTarget.JSON_PROPERTY_TYPE, + ProductAnalyticsRetentionIndexTarget.JSON_PROPERTY_VALUE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsRetentionIndexTarget { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_TYPE = "type"; + private ProductAnalyticsRetentionIndexTargetType type; + + public static final String JSON_PROPERTY_VALUE = "value"; + private Long value; + + public ProductAnalyticsRetentionIndexTarget() {} + + @JsonCreator + public ProductAnalyticsRetentionIndexTarget( + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + ProductAnalyticsRetentionIndexTargetType type, + @JsonProperty(required = true, value = JSON_PROPERTY_VALUE) Long value) { + this.type = type; + this.unparsed |= !type.isValid(); + this.value = value; + } + + public ProductAnalyticsRetentionIndexTarget type(ProductAnalyticsRetentionIndexTargetType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The discriminator identifying a target selected by index. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsRetentionIndexTargetType getType() { + return type; + } + + public void setType(ProductAnalyticsRetentionIndexTargetType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + public ProductAnalyticsRetentionIndexTarget value(Long value) { + this.value = value; + return this; + } + + /** + * Zero-based index of the targeted cohort or return period. minimum: 0 + * + * @return value + */ + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getValue() { + return value; + } + + public void setValue(Long 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 ProductAnalyticsRetentionIndexTarget + */ + @JsonAnySetter + public ProductAnalyticsRetentionIndexTarget 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 ProductAnalyticsRetentionIndexTarget object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsRetentionIndexTarget productAnalyticsRetentionIndexTarget = + (ProductAnalyticsRetentionIndexTarget) o; + return Objects.equals(this.type, productAnalyticsRetentionIndexTarget.type) + && Objects.equals(this.value, productAnalyticsRetentionIndexTarget.value) + && Objects.equals( + this.additionalProperties, productAnalyticsRetentionIndexTarget.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(type, value, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsRetentionIndexTarget {\n"); + sb.append(" type: ").append(toIndentedString(type)).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/ProductAnalyticsRetentionIndexTargetType.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionIndexTargetType.java new file mode 100644 index 00000000000..84386da6377 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionIndexTargetType.java @@ -0,0 +1,62 @@ +/* + * 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 discriminator identifying a target selected by index. */ +@JsonSerialize( + using = + ProductAnalyticsRetentionIndexTargetType.ProductAnalyticsRetentionIndexTargetTypeSerializer + .class) +public class ProductAnalyticsRetentionIndexTargetType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("index")); + + public static final ProductAnalyticsRetentionIndexTargetType INDEX = + new ProductAnalyticsRetentionIndexTargetType("index"); + + ProductAnalyticsRetentionIndexTargetType(String value) { + super(value, allowedValues); + } + + public static class ProductAnalyticsRetentionIndexTargetTypeSerializer + extends StdSerializer { + public ProductAnalyticsRetentionIndexTargetTypeSerializer( + Class t) { + super(t); + } + + public ProductAnalyticsRetentionIndexTargetTypeSerializer() { + this(null); + } + + @Override + public void serialize( + ProductAnalyticsRetentionIndexTargetType value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ProductAnalyticsRetentionIndexTargetType fromValue(String value) { + return new ProductAnalyticsRetentionIndexTargetType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionListColumn.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionListColumn.java new file mode 100644 index 00000000000..58f07a405ca --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionListColumn.java @@ -0,0 +1,141 @@ +/* + * 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 column to include in each returned entity row. */ +@JsonPropertyOrder({ProductAnalyticsRetentionListColumn.JSON_PROPERTY_FIELD}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsRetentionListColumn { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_FIELD = "field"; + private ProductAnalyticsRetentionListColumnField field; + + public ProductAnalyticsRetentionListColumn field(ProductAnalyticsRetentionListColumnField field) { + this.field = field; + this.unparsed |= field.unparsed; + return this; + } + + /** + * The attribute selected for a column. + * + * @return field + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FIELD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ProductAnalyticsRetentionListColumnField getField() { + return field; + } + + public void setField(ProductAnalyticsRetentionListColumnField field) { + this.field = field; + if (field != null) { + this.unparsed |= field.unparsed; + } + } + + /** + * 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 ProductAnalyticsRetentionListColumn + */ + @JsonAnySetter + public ProductAnalyticsRetentionListColumn 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 ProductAnalyticsRetentionListColumn object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsRetentionListColumn productAnalyticsRetentionListColumn = + (ProductAnalyticsRetentionListColumn) o; + return Objects.equals(this.field, productAnalyticsRetentionListColumn.field) + && Objects.equals( + this.additionalProperties, productAnalyticsRetentionListColumn.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(field, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsRetentionListColumn {\n"); + sb.append(" field: ").append(toIndentedString(field)).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/ProductAnalyticsRetentionListColumnField.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionListColumnField.java new file mode 100644 index 00000000000..baaf77c4783 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionListColumnField.java @@ -0,0 +1,138 @@ +/* + * 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; + +/** The attribute selected for a column. */ +@JsonPropertyOrder({ProductAnalyticsRetentionListColumnField.JSON_PROPERTY_PATH}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsRetentionListColumnField { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_PATH = "path"; + private String path; + + public ProductAnalyticsRetentionListColumnField path(String path) { + this.path = path; + return this; + } + + /** + * Attribute path of the column. + * + * @return path + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPath() { + return path; + } + + public void setPath(String path) { + this.path = path; + } + + /** + * 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 ProductAnalyticsRetentionListColumnField + */ + @JsonAnySetter + public ProductAnalyticsRetentionListColumnField 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 ProductAnalyticsRetentionListColumnField object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsRetentionListColumnField productAnalyticsRetentionListColumnField = + (ProductAnalyticsRetentionListColumnField) o; + return Objects.equals(this.path, productAnalyticsRetentionListColumnField.path) + && Objects.equals( + this.additionalProperties, + productAnalyticsRetentionListColumnField.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(path, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsRetentionListColumnField {\n"); + sb.append(" path: ").append(toIndentedString(path)).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/ProductAnalyticsRetentionListQuery.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionListQuery.java new file mode 100644 index 00000000000..6747576ee98 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionListQuery.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.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; + +/** Query definition for a retention list request. */ +@JsonPropertyOrder({ + ProductAnalyticsRetentionListQuery.JSON_PROPERTY_COLUMNS, + ProductAnalyticsRetentionListQuery.JSON_PROPERTY_COMPUTATION_SCOPE, + ProductAnalyticsRetentionListQuery.JSON_PROPERTY_LIMIT, + ProductAnalyticsRetentionListQuery.JSON_PROPERTY_SEARCH +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsRetentionListQuery { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_COLUMNS = "columns"; + private List columns = null; + + public static final String JSON_PROPERTY_COMPUTATION_SCOPE = "computation_scope"; + private ProductAnalyticsRetentionCellScope computationScope; + + public static final String JSON_PROPERTY_LIMIT = "limit"; + private Long limit; + + public static final String JSON_PROPERTY_SEARCH = "search"; + private ProductAnalyticsRetentionSearch search; + + public ProductAnalyticsRetentionListQuery() {} + + @JsonCreator + public ProductAnalyticsRetentionListQuery( + @JsonProperty(required = true, value = JSON_PROPERTY_COMPUTATION_SCOPE) + ProductAnalyticsRetentionCellScope computationScope, + @JsonProperty(required = true, value = JSON_PROPERTY_SEARCH) + ProductAnalyticsRetentionSearch search) { + this.computationScope = computationScope; + this.unparsed |= computationScope.unparsed; + this.search = search; + this.unparsed |= search.unparsed; + } + + public ProductAnalyticsRetentionListQuery columns( + List columns) { + this.columns = columns; + if (columns != null) { + for (ProductAnalyticsRetentionListColumn item : columns) { + this.unparsed |= item.unparsed; + } + } + return this; + } + + public ProductAnalyticsRetentionListQuery addColumnsItem( + ProductAnalyticsRetentionListColumn columnsItem) { + if (this.columns == null) { + this.columns = new ArrayList<>(); + } + this.columns.add(columnsItem); + this.unparsed |= columnsItem.unparsed; + return this; + } + + /** + * The attribute columns to include in each returned row. + * + * @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; + if (columns != null) { + for (ProductAnalyticsRetentionListColumn item : columns) { + this.unparsed |= item.unparsed; + } + } + } + + public ProductAnalyticsRetentionListQuery computationScope( + ProductAnalyticsRetentionCellScope computationScope) { + this.computationScope = computationScope; + this.unparsed |= computationScope.unparsed; + return this; + } + + /** + * Narrows a retention query to a single cell, at the intersection of one cohort and one return + * period. + * + * @return computationScope + */ + @JsonProperty(JSON_PROPERTY_COMPUTATION_SCOPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsRetentionCellScope getComputationScope() { + return computationScope; + } + + public void setComputationScope(ProductAnalyticsRetentionCellScope computationScope) { + this.computationScope = computationScope; + if (computationScope != null) { + this.unparsed |= computationScope.unparsed; + } + } + + public ProductAnalyticsRetentionListQuery limit(Long limit) { + this.limit = limit; + return this; + } + + /** + * Maximum number of rows to return. Use 0 for no limit. minimum: 0 + * + * @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 ProductAnalyticsRetentionListQuery search(ProductAnalyticsRetentionSearch search) { + this.search = search; + this.unparsed |= search.unparsed; + return this; + } + + /** + * Defines the cohort and return criteria that make up a retention query. + * + * @return search + */ + @JsonProperty(JSON_PROPERTY_SEARCH) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsRetentionSearch getSearch() { + return search; + } + + public void setSearch(ProductAnalyticsRetentionSearch search) { + this.search = search; + if (search != null) { + this.unparsed |= search.unparsed; + } + } + + /** + * 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 ProductAnalyticsRetentionListQuery + */ + @JsonAnySetter + public ProductAnalyticsRetentionListQuery 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 ProductAnalyticsRetentionListQuery object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsRetentionListQuery productAnalyticsRetentionListQuery = + (ProductAnalyticsRetentionListQuery) o; + return Objects.equals(this.columns, productAnalyticsRetentionListQuery.columns) + && Objects.equals( + this.computationScope, productAnalyticsRetentionListQuery.computationScope) + && Objects.equals(this.limit, productAnalyticsRetentionListQuery.limit) + && Objects.equals(this.search, productAnalyticsRetentionListQuery.search) + && Objects.equals( + this.additionalProperties, productAnalyticsRetentionListQuery.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(columns, computationScope, limit, search, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsRetentionListQuery {\n"); + sb.append(" columns: ").append(toIndentedString(columns)).append("\n"); + sb.append(" computationScope: ").append(toIndentedString(computationScope)).append("\n"); + sb.append(" limit: ").append(toIndentedString(limit)).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/ProductAnalyticsRetentionListRequest.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionListRequest.java new file mode 100644 index 00000000000..e21507249e8 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionListRequest.java @@ -0,0 +1,152 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Request body listing the individual entities behind one cell of the retention grid. */ +@JsonPropertyOrder({ProductAnalyticsRetentionListRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsRetentionListRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private ProductAnalyticsRetentionListRequestData data; + + public ProductAnalyticsRetentionListRequest() {} + + @JsonCreator + public ProductAnalyticsRetentionListRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + ProductAnalyticsRetentionListRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public ProductAnalyticsRetentionListRequest data(ProductAnalyticsRetentionListRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * The single JSON:API resource carrying a retention list query. Its attributes hold the time + * window, the cell to list, and the columns to return for each entity. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsRetentionListRequestData getData() { + return data; + } + + public void setData(ProductAnalyticsRetentionListRequestData data) { + this.data = data; + if (data != null) { + this.unparsed |= data.unparsed; + } + } + + /** + * 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 ProductAnalyticsRetentionListRequest + */ + @JsonAnySetter + public ProductAnalyticsRetentionListRequest 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 ProductAnalyticsRetentionListRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsRetentionListRequest productAnalyticsRetentionListRequest = + (ProductAnalyticsRetentionListRequest) o; + return Objects.equals(this.data, productAnalyticsRetentionListRequest.data) + && Objects.equals( + this.additionalProperties, productAnalyticsRetentionListRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsRetentionListRequest {\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/ProductAnalyticsRetentionListRequestAttributes.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionListRequestAttributes.java new file mode 100644 index 00000000000..52074545d52 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionListRequestAttributes.java @@ -0,0 +1,212 @@ +/* + * 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 of a retention list request. */ +@JsonPropertyOrder({ + ProductAnalyticsRetentionListRequestAttributes.JSON_PROPERTY_FROM, + ProductAnalyticsRetentionListRequestAttributes.JSON_PROPERTY_QUERY, + ProductAnalyticsRetentionListRequestAttributes.JSON_PROPERTY_TO +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsRetentionListRequestAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_FROM = "from"; + private Long from; + + public static final String JSON_PROPERTY_QUERY = "query"; + private ProductAnalyticsRetentionListQuery query; + + public static final String JSON_PROPERTY_TO = "to"; + private Long to; + + public ProductAnalyticsRetentionListRequestAttributes() {} + + @JsonCreator + public ProductAnalyticsRetentionListRequestAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_FROM) Long from, + @JsonProperty(required = true, value = JSON_PROPERTY_QUERY) + ProductAnalyticsRetentionListQuery query, + @JsonProperty(required = true, value = JSON_PROPERTY_TO) Long to) { + this.from = from; + this.query = query; + this.unparsed |= query.unparsed; + this.to = to; + } + + public ProductAnalyticsRetentionListRequestAttributes from(Long from) { + this.from = from; + return this; + } + + /** + * Start of the query window, in epoch milliseconds. + * + * @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 ProductAnalyticsRetentionListRequestAttributes query( + ProductAnalyticsRetentionListQuery query) { + this.query = query; + this.unparsed |= query.unparsed; + return this; + } + + /** + * Query definition for a retention list request. + * + * @return query + */ + @JsonProperty(JSON_PROPERTY_QUERY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsRetentionListQuery getQuery() { + return query; + } + + public void setQuery(ProductAnalyticsRetentionListQuery query) { + this.query = query; + if (query != null) { + this.unparsed |= query.unparsed; + } + } + + public ProductAnalyticsRetentionListRequestAttributes to(Long to) { + this.to = to; + return this; + } + + /** + * End of the query window, 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 ProductAnalyticsRetentionListRequestAttributes + */ + @JsonAnySetter + public ProductAnalyticsRetentionListRequestAttributes 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 ProductAnalyticsRetentionListRequestAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsRetentionListRequestAttributes productAnalyticsRetentionListRequestAttributes = + (ProductAnalyticsRetentionListRequestAttributes) o; + return Objects.equals(this.from, productAnalyticsRetentionListRequestAttributes.from) + && Objects.equals(this.query, productAnalyticsRetentionListRequestAttributes.query) + && Objects.equals(this.to, productAnalyticsRetentionListRequestAttributes.to) + && Objects.equals( + this.additionalProperties, + productAnalyticsRetentionListRequestAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(from, query, to, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsRetentionListRequestAttributes {\n"); + sb.append(" from: ").append(toIndentedString(from)).append("\n"); + sb.append(" query: ").append(toIndentedString(query)).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/ProductAnalyticsRetentionListRequestData.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionListRequestData.java new file mode 100644 index 00000000000..c096382b51d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionListRequestData.java @@ -0,0 +1,193 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * The single JSON:API resource carrying a retention list query. Its attributes hold the time + * window, the cell to list, and the columns to return for each entity. + */ +@JsonPropertyOrder({ + ProductAnalyticsRetentionListRequestData.JSON_PROPERTY_ATTRIBUTES, + ProductAnalyticsRetentionListRequestData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsRetentionListRequestData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private ProductAnalyticsRetentionListRequestAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ProductAnalyticsRetentionListRequestType type; + + public ProductAnalyticsRetentionListRequestData() {} + + @JsonCreator + public ProductAnalyticsRetentionListRequestData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + ProductAnalyticsRetentionListRequestAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + ProductAnalyticsRetentionListRequestType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public ProductAnalyticsRetentionListRequestData attributes( + ProductAnalyticsRetentionListRequestAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of a retention list request. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsRetentionListRequestAttributes getAttributes() { + return attributes; + } + + public void setAttributes(ProductAnalyticsRetentionListRequestAttributes attributes) { + this.attributes = attributes; + if (attributes != null) { + this.unparsed |= attributes.unparsed; + } + } + + public ProductAnalyticsRetentionListRequestData type( + ProductAnalyticsRetentionListRequestType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The resource type identifier for a retention list request. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsRetentionListRequestType getType() { + return type; + } + + public void setType(ProductAnalyticsRetentionListRequestType 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 ProductAnalyticsRetentionListRequestData + */ + @JsonAnySetter + public ProductAnalyticsRetentionListRequestData 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 ProductAnalyticsRetentionListRequestData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsRetentionListRequestData productAnalyticsRetentionListRequestData = + (ProductAnalyticsRetentionListRequestData) o; + return Objects.equals(this.attributes, productAnalyticsRetentionListRequestData.attributes) + && Objects.equals(this.type, productAnalyticsRetentionListRequestData.type) + && Objects.equals( + this.additionalProperties, + productAnalyticsRetentionListRequestData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsRetentionListRequestData {\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/ProductAnalyticsRetentionListRequestType.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionListRequestType.java new file mode 100644 index 00000000000..c6bfc7d976a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionListRequestType.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 resource type identifier for a retention list request. */ +@JsonSerialize( + using = + ProductAnalyticsRetentionListRequestType.ProductAnalyticsRetentionListRequestTypeSerializer + .class) +public class ProductAnalyticsRetentionListRequestType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("retention_list_request")); + + public static final ProductAnalyticsRetentionListRequestType RETENTION_LIST_REQUEST = + new ProductAnalyticsRetentionListRequestType("retention_list_request"); + + ProductAnalyticsRetentionListRequestType(String value) { + super(value, allowedValues); + } + + public static class ProductAnalyticsRetentionListRequestTypeSerializer + extends StdSerializer { + public ProductAnalyticsRetentionListRequestTypeSerializer( + Class t) { + super(t); + } + + public ProductAnalyticsRetentionListRequestTypeSerializer() { + this(null); + } + + @Override + public void serialize( + ProductAnalyticsRetentionListRequestType value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ProductAnalyticsRetentionListRequestType fromValue(String value) { + return new ProductAnalyticsRetentionListRequestType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionListResponse.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionListResponse.java new file mode 100644 index 00000000000..9d932168897 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionListResponse.java @@ -0,0 +1,153 @@ +/* + * 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; + +/** Response for a retention list query. */ +@JsonPropertyOrder({ProductAnalyticsRetentionListResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsRetentionListResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private ProductAnalyticsRetentionListResponseData data; + + public ProductAnalyticsRetentionListResponse() {} + + @JsonCreator + public ProductAnalyticsRetentionListResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + ProductAnalyticsRetentionListResponseData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public ProductAnalyticsRetentionListResponse data( + ProductAnalyticsRetentionListResponseData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * The single JSON:API resource holding the entities behind one retention cell. Its attributes + * contain the entity whose retention was measured and one row per matching entity. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsRetentionListResponseData getData() { + return data; + } + + public void setData(ProductAnalyticsRetentionListResponseData data) { + this.data = data; + if (data != null) { + this.unparsed |= data.unparsed; + } + } + + /** + * 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 ProductAnalyticsRetentionListResponse + */ + @JsonAnySetter + public ProductAnalyticsRetentionListResponse 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 ProductAnalyticsRetentionListResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsRetentionListResponse productAnalyticsRetentionListResponse = + (ProductAnalyticsRetentionListResponse) o; + return Objects.equals(this.data, productAnalyticsRetentionListResponse.data) + && Objects.equals( + this.additionalProperties, productAnalyticsRetentionListResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsRetentionListResponse {\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/ProductAnalyticsRetentionListResponseAttributes.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionListResponseAttributes.java new file mode 100644 index 00000000000..4b5ba6db966 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionListResponseAttributes.java @@ -0,0 +1,182 @@ +/* + * 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; + +/** Attributes of a retention list response, containing the matching entity rows. */ +@JsonPropertyOrder({ + ProductAnalyticsRetentionListResponseAttributes.JSON_PROPERTY_RECORDS, + ProductAnalyticsRetentionListResponseAttributes.JSON_PROPERTY_RETENTION_ENTITY +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsRetentionListResponseAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_RECORDS = "records"; + private List> records = null; + + public static final String JSON_PROPERTY_RETENTION_ENTITY = "retention_entity"; + private String retentionEntity; + + public ProductAnalyticsRetentionListResponseAttributes records( + List> records) { + this.records = records; + return this; + } + + public ProductAnalyticsRetentionListResponseAttributes addRecordsItem( + Map recordsItem) { + if (this.records == null) { + this.records = new ArrayList<>(); + } + this.records.add(recordsItem); + return this; + } + + /** + * The matching entity rows. + * + * @return records + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RECORDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List> getRecords() { + return records; + } + + public void setRecords(List> records) { + this.records = records; + } + + public ProductAnalyticsRetentionListResponseAttributes retentionEntity(String retentionEntity) { + this.retentionEntity = retentionEntity; + return this; + } + + /** + * The entity whose retention was measured. + * + * @return retentionEntity + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RETENTION_ENTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getRetentionEntity() { + return retentionEntity; + } + + public void setRetentionEntity(String retentionEntity) { + this.retentionEntity = retentionEntity; + } + + /** + * 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 ProductAnalyticsRetentionListResponseAttributes + */ + @JsonAnySetter + public ProductAnalyticsRetentionListResponseAttributes 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 ProductAnalyticsRetentionListResponseAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsRetentionListResponseAttributes + productAnalyticsRetentionListResponseAttributes = + (ProductAnalyticsRetentionListResponseAttributes) o; + return Objects.equals(this.records, productAnalyticsRetentionListResponseAttributes.records) + && Objects.equals( + this.retentionEntity, productAnalyticsRetentionListResponseAttributes.retentionEntity) + && Objects.equals( + this.additionalProperties, + productAnalyticsRetentionListResponseAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(records, retentionEntity, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsRetentionListResponseAttributes {\n"); + sb.append(" records: ").append(toIndentedString(records)).append("\n"); + sb.append(" retentionEntity: ").append(toIndentedString(retentionEntity)).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/ProductAnalyticsRetentionListResponseData.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionListResponseData.java new file mode 100644 index 00000000000..558fa10ce98 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionListResponseData.java @@ -0,0 +1,221 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * The single JSON:API resource holding the entities behind one retention cell. Its attributes + * contain the entity whose retention was measured and one row per matching entity. + */ +@JsonPropertyOrder({ + ProductAnalyticsRetentionListResponseData.JSON_PROPERTY_ATTRIBUTES, + ProductAnalyticsRetentionListResponseData.JSON_PROPERTY_ID, + ProductAnalyticsRetentionListResponseData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsRetentionListResponseData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private ProductAnalyticsRetentionListResponseAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ProductAnalyticsRetentionListResponseType type; + + public ProductAnalyticsRetentionListResponseData() {} + + @JsonCreator + public ProductAnalyticsRetentionListResponseData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + ProductAnalyticsRetentionListResponseAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + ProductAnalyticsRetentionListResponseType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public ProductAnalyticsRetentionListResponseData attributes( + ProductAnalyticsRetentionListResponseAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of a retention list response, containing the matching entity rows. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsRetentionListResponseAttributes getAttributes() { + return attributes; + } + + public void setAttributes(ProductAnalyticsRetentionListResponseAttributes attributes) { + this.attributes = attributes; + if (attributes != null) { + this.unparsed |= attributes.unparsed; + } + } + + public ProductAnalyticsRetentionListResponseData id(String id) { + this.id = id; + return this; + } + + /** + * Unique identifier for this response data object. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public ProductAnalyticsRetentionListResponseData type( + ProductAnalyticsRetentionListResponseType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The resource type identifier for a retention list response. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsRetentionListResponseType getType() { + return type; + } + + public void setType(ProductAnalyticsRetentionListResponseType 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 ProductAnalyticsRetentionListResponseData + */ + @JsonAnySetter + public ProductAnalyticsRetentionListResponseData 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 ProductAnalyticsRetentionListResponseData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsRetentionListResponseData productAnalyticsRetentionListResponseData = + (ProductAnalyticsRetentionListResponseData) o; + return Objects.equals(this.attributes, productAnalyticsRetentionListResponseData.attributes) + && Objects.equals(this.id, productAnalyticsRetentionListResponseData.id) + && Objects.equals(this.type, productAnalyticsRetentionListResponseData.type) + && Objects.equals( + this.additionalProperties, + productAnalyticsRetentionListResponseData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsRetentionListResponseData {\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/ProductAnalyticsRetentionListResponseType.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionListResponseType.java new file mode 100644 index 00000000000..edb17490120 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionListResponseType.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 resource type identifier for a retention list response. */ +@JsonSerialize( + using = + ProductAnalyticsRetentionListResponseType + .ProductAnalyticsRetentionListResponseTypeSerializer.class) +public class ProductAnalyticsRetentionListResponseType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("retention_list_response")); + + public static final ProductAnalyticsRetentionListResponseType RETENTION_LIST_RESPONSE = + new ProductAnalyticsRetentionListResponseType("retention_list_response"); + + ProductAnalyticsRetentionListResponseType(String value) { + super(value, allowedValues); + } + + public static class ProductAnalyticsRetentionListResponseTypeSerializer + extends StdSerializer { + public ProductAnalyticsRetentionListResponseTypeSerializer( + Class t) { + super(t); + } + + public ProductAnalyticsRetentionListResponseTypeSerializer() { + this(null); + } + + @Override + public void serialize( + ProductAnalyticsRetentionListResponseType value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ProductAnalyticsRetentionListResponseType fromValue(String value) { + return new ProductAnalyticsRetentionListResponseType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionPeriod.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionPeriod.java new file mode 100644 index 00000000000..11d9dc49b02 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionPeriod.java @@ -0,0 +1,167 @@ +/* + * 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 return period definition, such as "1 week". */ +@JsonPropertyOrder({ + ProductAnalyticsRetentionPeriod.JSON_PROPERTY_UNIT, + ProductAnalyticsRetentionPeriod.JSON_PROPERTY_VALUE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsRetentionPeriod { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_UNIT = "unit"; + private String unit; + + public static final String JSON_PROPERTY_VALUE = "value"; + private Long value; + + public ProductAnalyticsRetentionPeriod unit(String unit) { + this.unit = unit; + return this; + } + + /** + * Time unit of the period, such as day, week, month, or + * year. + * + * @return unit + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UNIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUnit() { + return unit; + } + + public void setUnit(String unit) { + this.unit = unit; + } + + public ProductAnalyticsRetentionPeriod value(Long value) { + this.value = value; + return this; + } + + /** + * Length of the period, expressed in unit. + * + * @return value + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getValue() { + return value; + } + + public void setValue(Long 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 ProductAnalyticsRetentionPeriod + */ + @JsonAnySetter + public ProductAnalyticsRetentionPeriod 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 ProductAnalyticsRetentionPeriod object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsRetentionPeriod productAnalyticsRetentionPeriod = + (ProductAnalyticsRetentionPeriod) o; + return Objects.equals(this.unit, productAnalyticsRetentionPeriod.unit) + && Objects.equals(this.value, productAnalyticsRetentionPeriod.value) + && Objects.equals( + this.additionalProperties, productAnalyticsRetentionPeriod.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(unit, value, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsRetentionPeriod {\n"); + sb.append(" unit: ").append(toIndentedString(unit)).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/ProductAnalyticsRetentionReturnCondition.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionReturnCondition.java new file mode 100644 index 00000000000..3b549cf224b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionReturnCondition.java @@ -0,0 +1,69 @@ +/* + * 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; + +/** + * When an entity counts as having returned. Use conversion_on to count only entities + * that returned during the period itself, or conversion_on_or_after to also count + * later returns. + */ +@JsonSerialize( + using = + ProductAnalyticsRetentionReturnCondition.ProductAnalyticsRetentionReturnConditionSerializer + .class) +public class ProductAnalyticsRetentionReturnCondition extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("conversion_on", "conversion_on_or_after")); + + public static final ProductAnalyticsRetentionReturnCondition CONVERSION_ON = + new ProductAnalyticsRetentionReturnCondition("conversion_on"); + public static final ProductAnalyticsRetentionReturnCondition CONVERSION_ON_OR_AFTER = + new ProductAnalyticsRetentionReturnCondition("conversion_on_or_after"); + + ProductAnalyticsRetentionReturnCondition(String value) { + super(value, allowedValues); + } + + public static class ProductAnalyticsRetentionReturnConditionSerializer + extends StdSerializer { + public ProductAnalyticsRetentionReturnConditionSerializer( + Class t) { + super(t); + } + + public ProductAnalyticsRetentionReturnConditionSerializer() { + this(null); + } + + @Override + public void serialize( + ProductAnalyticsRetentionReturnCondition value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ProductAnalyticsRetentionReturnCondition fromValue(String value) { + return new ProductAnalyticsRetentionReturnCondition(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionReturnCriteria.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionReturnCriteria.java new file mode 100644 index 00000000000..15e275d6cea --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionReturnCriteria.java @@ -0,0 +1,189 @@ +/* + * 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; + +/** Defines the event that counts as a return, and the window in which it must occur. */ +@JsonPropertyOrder({ + ProductAnalyticsRetentionReturnCriteria.JSON_PROPERTY_BASE_QUERY, + ProductAnalyticsRetentionReturnCriteria.JSON_PROPERTY_TIME_INTERVAL +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsRetentionReturnCriteria { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_BASE_QUERY = "base_query"; + private ProductAnalyticsBaseQuery baseQuery; + + public static final String JSON_PROPERTY_TIME_INTERVAL = "time_interval"; + private ProductAnalyticsRetentionTimeInterval timeInterval; + + public ProductAnalyticsRetentionReturnCriteria() {} + + @JsonCreator + public ProductAnalyticsRetentionReturnCriteria( + @JsonProperty(required = true, value = JSON_PROPERTY_BASE_QUERY) + ProductAnalyticsBaseQuery baseQuery) { + this.baseQuery = baseQuery; + this.unparsed |= baseQuery.unparsed; + } + + public ProductAnalyticsRetentionReturnCriteria baseQuery(ProductAnalyticsBaseQuery baseQuery) { + this.baseQuery = baseQuery; + this.unparsed |= baseQuery.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 baseQuery + */ + @JsonProperty(JSON_PROPERTY_BASE_QUERY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsBaseQuery getBaseQuery() { + return baseQuery; + } + + public void setBaseQuery(ProductAnalyticsBaseQuery baseQuery) { + this.baseQuery = baseQuery; + if (baseQuery != null) { + this.unparsed |= baseQuery.unparsed; + } + } + + public ProductAnalyticsRetentionReturnCriteria timeInterval( + ProductAnalyticsRetentionTimeInterval timeInterval) { + this.timeInterval = timeInterval; + this.unparsed |= timeInterval.unparsed; + return this; + } + + /** + * A retention interval, either aligned to calendar boundaries or of a fixed length. Cohort + * criteria use calendar intervals; return criteria use fixed intervals. + * + * @return timeInterval + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TIME_INTERVAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ProductAnalyticsRetentionTimeInterval getTimeInterval() { + return timeInterval; + } + + public void setTimeInterval(ProductAnalyticsRetentionTimeInterval timeInterval) { + this.timeInterval = timeInterval; + if (timeInterval != null) { + this.unparsed |= timeInterval.unparsed; + } + } + + /** + * 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 ProductAnalyticsRetentionReturnCriteria + */ + @JsonAnySetter + public ProductAnalyticsRetentionReturnCriteria 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 ProductAnalyticsRetentionReturnCriteria object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsRetentionReturnCriteria productAnalyticsRetentionReturnCriteria = + (ProductAnalyticsRetentionReturnCriteria) o; + return Objects.equals(this.baseQuery, productAnalyticsRetentionReturnCriteria.baseQuery) + && Objects.equals(this.timeInterval, productAnalyticsRetentionReturnCriteria.timeInterval) + && Objects.equals( + this.additionalProperties, + productAnalyticsRetentionReturnCriteria.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(baseQuery, timeInterval, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsRetentionReturnCriteria {\n"); + sb.append(" baseQuery: ").append(toIndentedString(baseQuery)).append("\n"); + sb.append(" timeInterval: ").append(toIndentedString(timeInterval)).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/ProductAnalyticsRetentionReturnPeriodScope.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionReturnPeriodScope.java new file mode 100644 index 00000000000..653e7696bcd --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionReturnPeriodScope.java @@ -0,0 +1,191 @@ +/* + * 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; + +/** Narrows a retention query to a single return-period column. */ +@JsonPropertyOrder({ + ProductAnalyticsRetentionReturnPeriodScope.JSON_PROPERTY_TARGET, + ProductAnalyticsRetentionReturnPeriodScope.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsRetentionReturnPeriodScope { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_TARGET = "target"; + private ProductAnalyticsRetentionIndexTarget target; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ProductAnalyticsRetentionReturnPeriodScopeType type; + + public ProductAnalyticsRetentionReturnPeriodScope() {} + + @JsonCreator + public ProductAnalyticsRetentionReturnPeriodScope( + @JsonProperty(required = true, value = JSON_PROPERTY_TARGET) + ProductAnalyticsRetentionIndexTarget target, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + ProductAnalyticsRetentionReturnPeriodScopeType type) { + this.target = target; + this.unparsed |= target.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public ProductAnalyticsRetentionReturnPeriodScope target( + ProductAnalyticsRetentionIndexTarget target) { + this.target = target; + this.unparsed |= target.unparsed; + return this; + } + + /** + * Selects a cohort or return period by its zero-based position in the grid. + * + * @return target + */ + @JsonProperty(JSON_PROPERTY_TARGET) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsRetentionIndexTarget getTarget() { + return target; + } + + public void setTarget(ProductAnalyticsRetentionIndexTarget target) { + this.target = target; + if (target != null) { + this.unparsed |= target.unparsed; + } + } + + public ProductAnalyticsRetentionReturnPeriodScope type( + ProductAnalyticsRetentionReturnPeriodScopeType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The discriminator identifying a scope narrowed to one return period. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsRetentionReturnPeriodScopeType getType() { + return type; + } + + public void setType(ProductAnalyticsRetentionReturnPeriodScopeType 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 ProductAnalyticsRetentionReturnPeriodScope + */ + @JsonAnySetter + public ProductAnalyticsRetentionReturnPeriodScope 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 ProductAnalyticsRetentionReturnPeriodScope object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsRetentionReturnPeriodScope productAnalyticsRetentionReturnPeriodScope = + (ProductAnalyticsRetentionReturnPeriodScope) o; + return Objects.equals(this.target, productAnalyticsRetentionReturnPeriodScope.target) + && Objects.equals(this.type, productAnalyticsRetentionReturnPeriodScope.type) + && Objects.equals( + this.additionalProperties, + productAnalyticsRetentionReturnPeriodScope.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(target, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsRetentionReturnPeriodScope {\n"); + sb.append(" target: ").append(toIndentedString(target)).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/ProductAnalyticsRetentionReturnPeriodScopeType.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionReturnPeriodScopeType.java new file mode 100644 index 00000000000..6a9f4948bed --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionReturnPeriodScopeType.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 discriminator identifying a scope narrowed to one return period. */ +@JsonSerialize( + using = + ProductAnalyticsRetentionReturnPeriodScopeType + .ProductAnalyticsRetentionReturnPeriodScopeTypeSerializer.class) +public class ProductAnalyticsRetentionReturnPeriodScopeType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("return_period")); + + public static final ProductAnalyticsRetentionReturnPeriodScopeType RETURN_PERIOD = + new ProductAnalyticsRetentionReturnPeriodScopeType("return_period"); + + ProductAnalyticsRetentionReturnPeriodScopeType(String value) { + super(value, allowedValues); + } + + public static class ProductAnalyticsRetentionReturnPeriodScopeTypeSerializer + extends StdSerializer { + public ProductAnalyticsRetentionReturnPeriodScopeTypeSerializer( + Class t) { + super(t); + } + + public ProductAnalyticsRetentionReturnPeriodScopeTypeSerializer() { + this(null); + } + + @Override + public void serialize( + ProductAnalyticsRetentionReturnPeriodScopeType value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ProductAnalyticsRetentionReturnPeriodScopeType fromValue(String value) { + return new ProductAnalyticsRetentionReturnPeriodScopeType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionScope.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionScope.java new file mode 100644 index 00000000000..26e26aa5a70 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionScope.java @@ -0,0 +1,381 @@ +/* + * 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 = ProductAnalyticsRetentionScope.ProductAnalyticsRetentionScopeDeserializer.class) +@JsonSerialize( + using = ProductAnalyticsRetentionScope.ProductAnalyticsRetentionScopeSerializer.class) +public class ProductAnalyticsRetentionScope extends AbstractOpenApiSchema { + private static final Logger log = + Logger.getLogger(ProductAnalyticsRetentionScope.class.getName()); + + @JsonIgnore public boolean unparsed = false; + + public static class ProductAnalyticsRetentionScopeSerializer + extends StdSerializer { + public ProductAnalyticsRetentionScopeSerializer(Class t) { + super(t); + } + + public ProductAnalyticsRetentionScopeSerializer() { + this(null); + } + + @Override + public void serialize( + ProductAnalyticsRetentionScope value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.getActualInstance()); + } + } + + public static class ProductAnalyticsRetentionScopeDeserializer + extends StdDeserializer { + public ProductAnalyticsRetentionScopeDeserializer() { + this(ProductAnalyticsRetentionScope.class); + } + + public ProductAnalyticsRetentionScopeDeserializer(Class vc) { + super(vc); + } + + @Override + public ProductAnalyticsRetentionScope 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 ProductAnalyticsRetentionCohortScope + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (ProductAnalyticsRetentionCohortScope.class.equals(Integer.class) + || ProductAnalyticsRetentionCohortScope.class.equals(Long.class) + || ProductAnalyticsRetentionCohortScope.class.equals(Float.class) + || ProductAnalyticsRetentionCohortScope.class.equals(Double.class) + || ProductAnalyticsRetentionCohortScope.class.equals(Boolean.class) + || ProductAnalyticsRetentionCohortScope.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((ProductAnalyticsRetentionCohortScope.class.equals(Integer.class) + || ProductAnalyticsRetentionCohortScope.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((ProductAnalyticsRetentionCohortScope.class.equals(Float.class) + || ProductAnalyticsRetentionCohortScope.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (ProductAnalyticsRetentionCohortScope.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (ProductAnalyticsRetentionCohortScope.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = + tree.traverse(jp.getCodec()).readValueAs(ProductAnalyticsRetentionCohortScope.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 (!((ProductAnalyticsRetentionCohortScope) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'ProductAnalyticsRetentionCohortScope'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log( + Level.FINER, + "Input data does not match schema 'ProductAnalyticsRetentionCohortScope'", + e); + } + + // deserialize ProductAnalyticsRetentionReturnPeriodScope + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (ProductAnalyticsRetentionReturnPeriodScope.class.equals(Integer.class) + || ProductAnalyticsRetentionReturnPeriodScope.class.equals(Long.class) + || ProductAnalyticsRetentionReturnPeriodScope.class.equals(Float.class) + || ProductAnalyticsRetentionReturnPeriodScope.class.equals(Double.class) + || ProductAnalyticsRetentionReturnPeriodScope.class.equals(Boolean.class) + || ProductAnalyticsRetentionReturnPeriodScope.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((ProductAnalyticsRetentionReturnPeriodScope.class.equals(Integer.class) + || ProductAnalyticsRetentionReturnPeriodScope.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((ProductAnalyticsRetentionReturnPeriodScope.class.equals(Float.class) + || ProductAnalyticsRetentionReturnPeriodScope.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (ProductAnalyticsRetentionReturnPeriodScope.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (ProductAnalyticsRetentionReturnPeriodScope.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = + tree.traverse(jp.getCodec()) + .readValueAs(ProductAnalyticsRetentionReturnPeriodScope.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 (!((ProductAnalyticsRetentionReturnPeriodScope) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log( + Level.FINER, + "Input data matches schema 'ProductAnalyticsRetentionReturnPeriodScope'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log( + Level.FINER, + "Input data does not match schema 'ProductAnalyticsRetentionReturnPeriodScope'", + e); + } + + // deserialize ProductAnalyticsRetentionCellScope + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (ProductAnalyticsRetentionCellScope.class.equals(Integer.class) + || ProductAnalyticsRetentionCellScope.class.equals(Long.class) + || ProductAnalyticsRetentionCellScope.class.equals(Float.class) + || ProductAnalyticsRetentionCellScope.class.equals(Double.class) + || ProductAnalyticsRetentionCellScope.class.equals(Boolean.class) + || ProductAnalyticsRetentionCellScope.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((ProductAnalyticsRetentionCellScope.class.equals(Integer.class) + || ProductAnalyticsRetentionCellScope.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((ProductAnalyticsRetentionCellScope.class.equals(Float.class) + || ProductAnalyticsRetentionCellScope.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (ProductAnalyticsRetentionCellScope.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (ProductAnalyticsRetentionCellScope.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(ProductAnalyticsRetentionCellScope.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 (!((ProductAnalyticsRetentionCellScope) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'ProductAnalyticsRetentionCellScope'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log( + Level.FINER, + "Input data does not match schema 'ProductAnalyticsRetentionCellScope'", + e); + } + + ProductAnalyticsRetentionScope ret = new ProductAnalyticsRetentionScope(); + 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 ProductAnalyticsRetentionScope getNullValue(DeserializationContext ctxt) + throws JsonMappingException { + throw new JsonMappingException( + ctxt.getParser(), "ProductAnalyticsRetentionScope cannot be null"); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public ProductAnalyticsRetentionScope() { + super("oneOf", Boolean.FALSE); + } + + public ProductAnalyticsRetentionScope(ProductAnalyticsRetentionCohortScope o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public ProductAnalyticsRetentionScope(ProductAnalyticsRetentionReturnPeriodScope o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public ProductAnalyticsRetentionScope(ProductAnalyticsRetentionCellScope o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put( + "ProductAnalyticsRetentionCohortScope", + new GenericType() {}); + schemas.put( + "ProductAnalyticsRetentionReturnPeriodScope", + new GenericType() {}); + schemas.put( + "ProductAnalyticsRetentionCellScope", + new GenericType() {}); + JSON.registerDescendants( + ProductAnalyticsRetentionScope.class, Collections.unmodifiableMap(schemas)); + } + + @Override + public Map getSchemas() { + return ProductAnalyticsRetentionScope.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: ProductAnalyticsRetentionCohortScope, + * ProductAnalyticsRetentionReturnPeriodScope, ProductAnalyticsRetentionCellScope + * + *

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( + ProductAnalyticsRetentionCohortScope.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf( + ProductAnalyticsRetentionReturnPeriodScope.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf( + ProductAnalyticsRetentionCellScope.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 ProductAnalyticsRetentionCohortScope," + + " ProductAnalyticsRetentionReturnPeriodScope, ProductAnalyticsRetentionCellScope"); + } + + /** + * Get the actual instance, which can be the following: ProductAnalyticsRetentionCohortScope, + * ProductAnalyticsRetentionReturnPeriodScope, ProductAnalyticsRetentionCellScope + * + * @return The actual instance (ProductAnalyticsRetentionCohortScope, + * ProductAnalyticsRetentionReturnPeriodScope, ProductAnalyticsRetentionCellScope) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `ProductAnalyticsRetentionCohortScope`. If the actual instance is + * not `ProductAnalyticsRetentionCohortScope`, the ClassCastException will be thrown. + * + * @return The actual instance of `ProductAnalyticsRetentionCohortScope` + * @throws ClassCastException if the instance is not `ProductAnalyticsRetentionCohortScope` + */ + public ProductAnalyticsRetentionCohortScope getProductAnalyticsRetentionCohortScope() + throws ClassCastException { + return (ProductAnalyticsRetentionCohortScope) super.getActualInstance(); + } + + /** + * Get the actual instance of `ProductAnalyticsRetentionReturnPeriodScope`. If the actual instance + * is not `ProductAnalyticsRetentionReturnPeriodScope`, the ClassCastException will be thrown. + * + * @return The actual instance of `ProductAnalyticsRetentionReturnPeriodScope` + * @throws ClassCastException if the instance is not `ProductAnalyticsRetentionReturnPeriodScope` + */ + public ProductAnalyticsRetentionReturnPeriodScope getProductAnalyticsRetentionReturnPeriodScope() + throws ClassCastException { + return (ProductAnalyticsRetentionReturnPeriodScope) super.getActualInstance(); + } + + /** + * Get the actual instance of `ProductAnalyticsRetentionCellScope`. If the actual instance is not + * `ProductAnalyticsRetentionCellScope`, the ClassCastException will be thrown. + * + * @return The actual instance of `ProductAnalyticsRetentionCellScope` + * @throws ClassCastException if the instance is not `ProductAnalyticsRetentionCellScope` + */ + public ProductAnalyticsRetentionCellScope getProductAnalyticsRetentionCellScope() + throws ClassCastException { + return (ProductAnalyticsRetentionCellScope) super.getActualInstance(); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionSearch.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionSearch.java new file mode 100644 index 00000000000..bf493b6c455 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionSearch.java @@ -0,0 +1,295 @@ +/* + * 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; + +/** Defines the cohort and return criteria that make up a retention query. */ +@JsonPropertyOrder({ + ProductAnalyticsRetentionSearch.JSON_PROPERTY_COHORT_CRITERIA, + ProductAnalyticsRetentionSearch.JSON_PROPERTY_FILTERS, + ProductAnalyticsRetentionSearch.JSON_PROPERTY_RETENTION_ENTITY, + ProductAnalyticsRetentionSearch.JSON_PROPERTY_RETURN_CONDITION, + ProductAnalyticsRetentionSearch.JSON_PROPERTY_RETURN_CRITERIA +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsRetentionSearch { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_COHORT_CRITERIA = "cohort_criteria"; + private ProductAnalyticsRetentionCohortCriteria cohortCriteria; + + public static final String JSON_PROPERTY_FILTERS = "filters"; + private ProductAnalyticsRetentionFilters filters; + + public static final String JSON_PROPERTY_RETENTION_ENTITY = "retention_entity"; + private ProductAnalyticsRetentionEntity retentionEntity; + + public static final String JSON_PROPERTY_RETURN_CONDITION = "return_condition"; + private ProductAnalyticsRetentionReturnCondition returnCondition; + + public static final String JSON_PROPERTY_RETURN_CRITERIA = "return_criteria"; + private ProductAnalyticsRetentionReturnCriteria returnCriteria; + + public ProductAnalyticsRetentionSearch() {} + + @JsonCreator + public ProductAnalyticsRetentionSearch( + @JsonProperty(required = true, value = JSON_PROPERTY_COHORT_CRITERIA) + ProductAnalyticsRetentionCohortCriteria cohortCriteria, + @JsonProperty(required = true, value = JSON_PROPERTY_RETENTION_ENTITY) + ProductAnalyticsRetentionEntity retentionEntity, + @JsonProperty(required = true, value = JSON_PROPERTY_RETURN_CONDITION) + ProductAnalyticsRetentionReturnCondition returnCondition) { + this.cohortCriteria = cohortCriteria; + this.unparsed |= cohortCriteria.unparsed; + this.retentionEntity = retentionEntity; + this.unparsed |= !retentionEntity.isValid(); + this.returnCondition = returnCondition; + this.unparsed |= !returnCondition.isValid(); + } + + public ProductAnalyticsRetentionSearch cohortCriteria( + ProductAnalyticsRetentionCohortCriteria cohortCriteria) { + this.cohortCriteria = cohortCriteria; + this.unparsed |= cohortCriteria.unparsed; + return this; + } + + /** + * Defines the event that places an entity into a cohort, and how cohorts are bucketed over time. + * + * @return cohortCriteria + */ + @JsonProperty(JSON_PROPERTY_COHORT_CRITERIA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsRetentionCohortCriteria getCohortCriteria() { + return cohortCriteria; + } + + public void setCohortCriteria(ProductAnalyticsRetentionCohortCriteria cohortCriteria) { + this.cohortCriteria = cohortCriteria; + if (cohortCriteria != null) { + this.unparsed |= cohortCriteria.unparsed; + } + } + + public ProductAnalyticsRetentionSearch filters(ProductAnalyticsRetentionFilters filters) { + this.filters = filters; + this.unparsed |= filters.unparsed; + return this; + } + + /** + * Filters narrowing the events considered by a retention query. + * + * @return filters + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILTERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ProductAnalyticsRetentionFilters getFilters() { + return filters; + } + + public void setFilters(ProductAnalyticsRetentionFilters filters) { + this.filters = filters; + if (filters != null) { + this.unparsed |= filters.unparsed; + } + } + + public ProductAnalyticsRetentionSearch retentionEntity( + ProductAnalyticsRetentionEntity retentionEntity) { + this.retentionEntity = retentionEntity; + this.unparsed |= !retentionEntity.isValid(); + return this; + } + + /** + * The entity whose retention is measured. + * + * @return retentionEntity + */ + @JsonProperty(JSON_PROPERTY_RETENTION_ENTITY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsRetentionEntity getRetentionEntity() { + return retentionEntity; + } + + public void setRetentionEntity(ProductAnalyticsRetentionEntity retentionEntity) { + if (!retentionEntity.isValid()) { + this.unparsed = true; + } + this.retentionEntity = retentionEntity; + } + + public ProductAnalyticsRetentionSearch returnCondition( + ProductAnalyticsRetentionReturnCondition returnCondition) { + this.returnCondition = returnCondition; + this.unparsed |= !returnCondition.isValid(); + return this; + } + + /** + * When an entity counts as having returned. Use conversion_on to count only entities + * that returned during the period itself, or conversion_on_or_after to also count + * later returns. + * + * @return returnCondition + */ + @JsonProperty(JSON_PROPERTY_RETURN_CONDITION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsRetentionReturnCondition getReturnCondition() { + return returnCondition; + } + + public void setReturnCondition(ProductAnalyticsRetentionReturnCondition returnCondition) { + if (!returnCondition.isValid()) { + this.unparsed = true; + } + this.returnCondition = returnCondition; + } + + public ProductAnalyticsRetentionSearch returnCriteria( + ProductAnalyticsRetentionReturnCriteria returnCriteria) { + this.returnCriteria = returnCriteria; + this.unparsed |= returnCriteria.unparsed; + return this; + } + + /** + * Defines the event that counts as a return, and the window in which it must occur. + * + * @return returnCriteria + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RETURN_CRITERIA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ProductAnalyticsRetentionReturnCriteria getReturnCriteria() { + return returnCriteria; + } + + public void setReturnCriteria(ProductAnalyticsRetentionReturnCriteria returnCriteria) { + this.returnCriteria = returnCriteria; + if (returnCriteria != null) { + this.unparsed |= returnCriteria.unparsed; + } + } + + /** + * 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 ProductAnalyticsRetentionSearch + */ + @JsonAnySetter + public ProductAnalyticsRetentionSearch 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 ProductAnalyticsRetentionSearch object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsRetentionSearch productAnalyticsRetentionSearch = + (ProductAnalyticsRetentionSearch) o; + return Objects.equals(this.cohortCriteria, productAnalyticsRetentionSearch.cohortCriteria) + && Objects.equals(this.filters, productAnalyticsRetentionSearch.filters) + && Objects.equals(this.retentionEntity, productAnalyticsRetentionSearch.retentionEntity) + && Objects.equals(this.returnCondition, productAnalyticsRetentionSearch.returnCondition) + && Objects.equals(this.returnCriteria, productAnalyticsRetentionSearch.returnCriteria) + && Objects.equals( + this.additionalProperties, productAnalyticsRetentionSearch.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + cohortCriteria, + filters, + retentionEntity, + returnCondition, + returnCriteria, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsRetentionSearch {\n"); + sb.append(" cohortCriteria: ").append(toIndentedString(cohortCriteria)).append("\n"); + sb.append(" filters: ").append(toIndentedString(filters)).append("\n"); + sb.append(" retentionEntity: ").append(toIndentedString(retentionEntity)).append("\n"); + sb.append(" returnCondition: ").append(toIndentedString(returnCondition)).append("\n"); + sb.append(" returnCriteria: ").append(toIndentedString(returnCriteria)).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/ProductAnalyticsRetentionTimeInterval.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionTimeInterval.java new file mode 100644 index 00000000000..6ad26a7ffbf --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsRetentionTimeInterval.java @@ -0,0 +1,319 @@ +/* + * 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 = + ProductAnalyticsRetentionTimeInterval.ProductAnalyticsRetentionTimeIntervalDeserializer + .class) +@JsonSerialize( + using = + ProductAnalyticsRetentionTimeInterval.ProductAnalyticsRetentionTimeIntervalSerializer.class) +public class ProductAnalyticsRetentionTimeInterval extends AbstractOpenApiSchema { + private static final Logger log = + Logger.getLogger(ProductAnalyticsRetentionTimeInterval.class.getName()); + + @JsonIgnore public boolean unparsed = false; + + public static class ProductAnalyticsRetentionTimeIntervalSerializer + extends StdSerializer { + public ProductAnalyticsRetentionTimeIntervalSerializer( + Class t) { + super(t); + } + + public ProductAnalyticsRetentionTimeIntervalSerializer() { + this(null); + } + + @Override + public void serialize( + ProductAnalyticsRetentionTimeInterval value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.getActualInstance()); + } + } + + public static class ProductAnalyticsRetentionTimeIntervalDeserializer + extends StdDeserializer { + public ProductAnalyticsRetentionTimeIntervalDeserializer() { + this(ProductAnalyticsRetentionTimeInterval.class); + } + + public ProductAnalyticsRetentionTimeIntervalDeserializer(Class vc) { + super(vc); + } + + @Override + public ProductAnalyticsRetentionTimeInterval 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 ProductAnalyticsRetentionCalendarTimeInterval + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (ProductAnalyticsRetentionCalendarTimeInterval.class.equals(Integer.class) + || ProductAnalyticsRetentionCalendarTimeInterval.class.equals(Long.class) + || ProductAnalyticsRetentionCalendarTimeInterval.class.equals(Float.class) + || ProductAnalyticsRetentionCalendarTimeInterval.class.equals(Double.class) + || ProductAnalyticsRetentionCalendarTimeInterval.class.equals(Boolean.class) + || ProductAnalyticsRetentionCalendarTimeInterval.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((ProductAnalyticsRetentionCalendarTimeInterval.class.equals(Integer.class) + || ProductAnalyticsRetentionCalendarTimeInterval.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((ProductAnalyticsRetentionCalendarTimeInterval.class.equals(Float.class) + || ProductAnalyticsRetentionCalendarTimeInterval.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (ProductAnalyticsRetentionCalendarTimeInterval.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (ProductAnalyticsRetentionCalendarTimeInterval.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = + tree.traverse(jp.getCodec()) + .readValueAs(ProductAnalyticsRetentionCalendarTimeInterval.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 (!((ProductAnalyticsRetentionCalendarTimeInterval) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log( + Level.FINER, + "Input data matches schema 'ProductAnalyticsRetentionCalendarTimeInterval'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log( + Level.FINER, + "Input data does not match schema 'ProductAnalyticsRetentionCalendarTimeInterval'", + e); + } + + // deserialize ProductAnalyticsRetentionFixedTimeInterval + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (ProductAnalyticsRetentionFixedTimeInterval.class.equals(Integer.class) + || ProductAnalyticsRetentionFixedTimeInterval.class.equals(Long.class) + || ProductAnalyticsRetentionFixedTimeInterval.class.equals(Float.class) + || ProductAnalyticsRetentionFixedTimeInterval.class.equals(Double.class) + || ProductAnalyticsRetentionFixedTimeInterval.class.equals(Boolean.class) + || ProductAnalyticsRetentionFixedTimeInterval.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((ProductAnalyticsRetentionFixedTimeInterval.class.equals(Integer.class) + || ProductAnalyticsRetentionFixedTimeInterval.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((ProductAnalyticsRetentionFixedTimeInterval.class.equals(Float.class) + || ProductAnalyticsRetentionFixedTimeInterval.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (ProductAnalyticsRetentionFixedTimeInterval.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (ProductAnalyticsRetentionFixedTimeInterval.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = + tree.traverse(jp.getCodec()) + .readValueAs(ProductAnalyticsRetentionFixedTimeInterval.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 (!((ProductAnalyticsRetentionFixedTimeInterval) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log( + Level.FINER, + "Input data matches schema 'ProductAnalyticsRetentionFixedTimeInterval'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log( + Level.FINER, + "Input data does not match schema 'ProductAnalyticsRetentionFixedTimeInterval'", + e); + } + + ProductAnalyticsRetentionTimeInterval ret = new ProductAnalyticsRetentionTimeInterval(); + 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 ProductAnalyticsRetentionTimeInterval getNullValue(DeserializationContext ctxt) + throws JsonMappingException { + throw new JsonMappingException( + ctxt.getParser(), "ProductAnalyticsRetentionTimeInterval cannot be null"); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public ProductAnalyticsRetentionTimeInterval() { + super("oneOf", Boolean.FALSE); + } + + public ProductAnalyticsRetentionTimeInterval(ProductAnalyticsRetentionCalendarTimeInterval o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public ProductAnalyticsRetentionTimeInterval(ProductAnalyticsRetentionFixedTimeInterval o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put( + "ProductAnalyticsRetentionCalendarTimeInterval", + new GenericType() {}); + schemas.put( + "ProductAnalyticsRetentionFixedTimeInterval", + new GenericType() {}); + JSON.registerDescendants( + ProductAnalyticsRetentionTimeInterval.class, Collections.unmodifiableMap(schemas)); + } + + @Override + public Map getSchemas() { + return ProductAnalyticsRetentionTimeInterval.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: ProductAnalyticsRetentionCalendarTimeInterval, + * ProductAnalyticsRetentionFixedTimeInterval + * + *

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( + ProductAnalyticsRetentionCalendarTimeInterval.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf( + ProductAnalyticsRetentionFixedTimeInterval.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 ProductAnalyticsRetentionCalendarTimeInterval," + + " ProductAnalyticsRetentionFixedTimeInterval"); + } + + /** + * Get the actual instance, which can be the following: + * ProductAnalyticsRetentionCalendarTimeInterval, ProductAnalyticsRetentionFixedTimeInterval + * + * @return The actual instance (ProductAnalyticsRetentionCalendarTimeInterval, + * ProductAnalyticsRetentionFixedTimeInterval) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `ProductAnalyticsRetentionCalendarTimeInterval`. If the actual + * instance is not `ProductAnalyticsRetentionCalendarTimeInterval`, the ClassCastException will be + * thrown. + * + * @return The actual instance of `ProductAnalyticsRetentionCalendarTimeInterval` + * @throws ClassCastException if the instance is not + * `ProductAnalyticsRetentionCalendarTimeInterval` + */ + public ProductAnalyticsRetentionCalendarTimeInterval + getProductAnalyticsRetentionCalendarTimeInterval() throws ClassCastException { + return (ProductAnalyticsRetentionCalendarTimeInterval) super.getActualInstance(); + } + + /** + * Get the actual instance of `ProductAnalyticsRetentionFixedTimeInterval`. If the actual instance + * is not `ProductAnalyticsRetentionFixedTimeInterval`, the ClassCastException will be thrown. + * + * @return The actual instance of `ProductAnalyticsRetentionFixedTimeInterval` + * @throws ClassCastException if the instance is not `ProductAnalyticsRetentionFixedTimeInterval` + */ + public ProductAnalyticsRetentionFixedTimeInterval getProductAnalyticsRetentionFixedTimeInterval() + throws ClassCastException { + return (ProductAnalyticsRetentionFixedTimeInterval) super.getActualInstance(); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsSankeyAggregatedNode.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsSankeyAggregatedNode.java new file mode 100644 index 00000000000..3a679459bb1 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsSankeyAggregatedNode.java @@ -0,0 +1,280 @@ +/* + * 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; + +/** + * One of the nodes rolled up into an aggregated node, retained so the roll-up can be broken down. + */ +@JsonPropertyOrder({ + ProductAnalyticsSankeyAggregatedNode.JSON_PROPERTY_ID, + ProductAnalyticsSankeyAggregatedNode.JSON_PROPERTY_INCOMING_VALUE, + ProductAnalyticsSankeyAggregatedNode.JSON_PROPERTY_NAME, + ProductAnalyticsSankeyAggregatedNode.JSON_PROPERTY_OUTGOING_VALUE, + ProductAnalyticsSankeyAggregatedNode.JSON_PROPERTY_TYPE, + ProductAnalyticsSankeyAggregatedNode.JSON_PROPERTY_VALUE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsSankeyAggregatedNode { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_INCOMING_VALUE = "incoming_value"; + private Long incomingValue; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_OUTGOING_VALUE = "outgoing_value"; + private Long outgoingValue; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ProductAnalyticsSankeyAggregatedNodeType type; + + public static final String JSON_PROPERTY_VALUE = "value"; + private Long value; + + public ProductAnalyticsSankeyAggregatedNode id(String id) { + this.id = id; + return this; + } + + /** + * Unique identifier for the node. + * + * @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 ProductAnalyticsSankeyAggregatedNode incomingValue(Long incomingValue) { + this.incomingValue = incomingValue; + return this; + } + + /** + * Number of sessions entering the node. + * + * @return incomingValue + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INCOMING_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getIncomingValue() { + return incomingValue; + } + + public void setIncomingValue(Long incomingValue) { + this.incomingValue = incomingValue; + } + + public ProductAnalyticsSankeyAggregatedNode name(String name) { + this.name = name; + return this; + } + + /** + * The facet value the node represents. + * + * @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 ProductAnalyticsSankeyAggregatedNode outgoingValue(Long outgoingValue) { + this.outgoingValue = outgoingValue; + return this; + } + + /** + * Number of sessions leaving the node. + * + * @return outgoingValue + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_OUTGOING_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getOutgoingValue() { + return outgoingValue; + } + + public void setOutgoingValue(Long outgoingValue) { + this.outgoingValue = outgoingValue; + } + + public ProductAnalyticsSankeyAggregatedNode type(ProductAnalyticsSankeyAggregatedNodeType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The resource type identifier for a node rolled up into an aggregated node. + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ProductAnalyticsSankeyAggregatedNodeType getType() { + return type; + } + + public void setType(ProductAnalyticsSankeyAggregatedNodeType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + public ProductAnalyticsSankeyAggregatedNode value(Long value) { + this.value = value; + return this; + } + + /** + * Number of sessions passing through the node. + * + * @return value + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getValue() { + return value; + } + + public void setValue(Long 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 ProductAnalyticsSankeyAggregatedNode + */ + @JsonAnySetter + public ProductAnalyticsSankeyAggregatedNode 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 ProductAnalyticsSankeyAggregatedNode object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsSankeyAggregatedNode productAnalyticsSankeyAggregatedNode = + (ProductAnalyticsSankeyAggregatedNode) o; + return Objects.equals(this.id, productAnalyticsSankeyAggregatedNode.id) + && Objects.equals(this.incomingValue, productAnalyticsSankeyAggregatedNode.incomingValue) + && Objects.equals(this.name, productAnalyticsSankeyAggregatedNode.name) + && Objects.equals(this.outgoingValue, productAnalyticsSankeyAggregatedNode.outgoingValue) + && Objects.equals(this.type, productAnalyticsSankeyAggregatedNode.type) + && Objects.equals(this.value, productAnalyticsSankeyAggregatedNode.value) + && Objects.equals( + this.additionalProperties, productAnalyticsSankeyAggregatedNode.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, incomingValue, name, outgoingValue, type, value, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsSankeyAggregatedNode {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" incomingValue: ").append(toIndentedString(incomingValue)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" outgoingValue: ").append(toIndentedString(outgoingValue)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).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/ProductAnalyticsSankeyAggregatedNodeType.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsSankeyAggregatedNodeType.java new file mode 100644 index 00000000000..cbad11f04bd --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsSankeyAggregatedNodeType.java @@ -0,0 +1,62 @@ +/* + * 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 identifier for a node rolled up into an aggregated node. */ +@JsonSerialize( + using = + ProductAnalyticsSankeyAggregatedNodeType.ProductAnalyticsSankeyAggregatedNodeTypeSerializer + .class) +public class ProductAnalyticsSankeyAggregatedNodeType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("aggregated")); + + public static final ProductAnalyticsSankeyAggregatedNodeType AGGREGATED = + new ProductAnalyticsSankeyAggregatedNodeType("aggregated"); + + ProductAnalyticsSankeyAggregatedNodeType(String value) { + super(value, allowedValues); + } + + public static class ProductAnalyticsSankeyAggregatedNodeTypeSerializer + extends StdSerializer { + public ProductAnalyticsSankeyAggregatedNodeTypeSerializer( + Class t) { + super(t); + } + + public ProductAnalyticsSankeyAggregatedNodeTypeSerializer() { + this(null); + } + + @Override + public void serialize( + ProductAnalyticsSankeyAggregatedNodeType value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ProductAnalyticsSankeyAggregatedNodeType fromValue(String value) { + return new ProductAnalyticsSankeyAggregatedNodeType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsSankeyDefinition.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsSankeyDefinition.java new file mode 100644 index 00000000000..552643f0957 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsSankeyDefinition.java @@ -0,0 +1,235 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * The shape of the Sankey diagram, expressed as the facets to flow between and how many steps to + * show. + */ +@JsonPropertyOrder({ + ProductAnalyticsSankeyDefinition.JSON_PROPERTY_ENTRIES_PER_STEP, + ProductAnalyticsSankeyDefinition.JSON_PROPERTY_NUMBER_OF_STEPS, + ProductAnalyticsSankeyDefinition.JSON_PROPERTY_SOURCE, + ProductAnalyticsSankeyDefinition.JSON_PROPERTY_TARGET +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsSankeyDefinition { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ENTRIES_PER_STEP = "entries_per_step"; + private Long entriesPerStep; + + public static final String JSON_PROPERTY_NUMBER_OF_STEPS = "number_of_steps"; + private Long numberOfSteps; + + public static final String JSON_PROPERTY_SOURCE = "source"; + private String source; + + public static final String JSON_PROPERTY_TARGET = "target"; + private String target; + + public ProductAnalyticsSankeyDefinition() {} + + @JsonCreator + public ProductAnalyticsSankeyDefinition( + @JsonProperty(required = true, value = JSON_PROPERTY_SOURCE) String source, + @JsonProperty(required = true, value = JSON_PROPERTY_TARGET) String target) { + this.source = source; + this.target = target; + } + + public ProductAnalyticsSankeyDefinition entriesPerStep(Long entriesPerStep) { + this.entriesPerStep = entriesPerStep; + return this; + } + + /** + * Maximum number of nodes to keep in each column. Remaining values are rolled up into an + * aggregated node. Omit it, or send 0, to use the default of 5. + * minimum: 0 maximum: 10 + * + * @return entriesPerStep + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENTRIES_PER_STEP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getEntriesPerStep() { + return entriesPerStep; + } + + public void setEntriesPerStep(Long entriesPerStep) { + this.entriesPerStep = entriesPerStep; + } + + public ProductAnalyticsSankeyDefinition numberOfSteps(Long numberOfSteps) { + this.numberOfSteps = numberOfSteps; + return this; + } + + /** + * Number of intermediate columns between the source and the target. Omit it, or send 0 + * , to use the default of 5. minimum: 0 maximum: 10 + * + * @return numberOfSteps + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NUMBER_OF_STEPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getNumberOfSteps() { + return numberOfSteps; + } + + public void setNumberOfSteps(Long numberOfSteps) { + this.numberOfSteps = numberOfSteps; + } + + public ProductAnalyticsSankeyDefinition source(String source) { + this.source = source; + return this; + } + + /** + * Facet forming the first column of the diagram. + * + * @return source + */ + @JsonProperty(JSON_PROPERTY_SOURCE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getSource() { + return source; + } + + public void setSource(String source) { + this.source = source; + } + + public ProductAnalyticsSankeyDefinition target(String target) { + this.target = target; + return this; + } + + /** + * Facet forming the last column of the diagram. + * + * @return target + */ + @JsonProperty(JSON_PROPERTY_TARGET) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getTarget() { + return target; + } + + public void setTarget(String target) { + this.target = target; + } + + /** + * 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 ProductAnalyticsSankeyDefinition + */ + @JsonAnySetter + public ProductAnalyticsSankeyDefinition 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 ProductAnalyticsSankeyDefinition object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsSankeyDefinition productAnalyticsSankeyDefinition = + (ProductAnalyticsSankeyDefinition) o; + return Objects.equals(this.entriesPerStep, productAnalyticsSankeyDefinition.entriesPerStep) + && Objects.equals(this.numberOfSteps, productAnalyticsSankeyDefinition.numberOfSteps) + && Objects.equals(this.source, productAnalyticsSankeyDefinition.source) + && Objects.equals(this.target, productAnalyticsSankeyDefinition.target) + && Objects.equals( + this.additionalProperties, productAnalyticsSankeyDefinition.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(entriesPerStep, numberOfSteps, source, target, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsSankeyDefinition {\n"); + sb.append(" entriesPerStep: ").append(toIndentedString(entriesPerStep)).append("\n"); + sb.append(" numberOfSteps: ").append(toIndentedString(numberOfSteps)).append("\n"); + sb.append(" source: ").append(toIndentedString(source)).append("\n"); + sb.append(" target: ").append(toIndentedString(target)).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/ProductAnalyticsSankeyLink.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsSankeyLink.java new file mode 100644 index 00000000000..bde09711509 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsSankeyLink.java @@ -0,0 +1,246 @@ +/* + * 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 link of the Sankey diagram, representing the sessions flowing between two nodes. */ +@JsonPropertyOrder({ + ProductAnalyticsSankeyLink.JSON_PROPERTY_COLUMN, + ProductAnalyticsSankeyLink.JSON_PROPERTY_ID, + ProductAnalyticsSankeyLink.JSON_PROPERTY_SOURCE, + ProductAnalyticsSankeyLink.JSON_PROPERTY_TARGET, + ProductAnalyticsSankeyLink.JSON_PROPERTY_VALUE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsSankeyLink { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_COLUMN = "column"; + private Long column; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_SOURCE = "source"; + private String source; + + public static final String JSON_PROPERTY_TARGET = "target"; + private String target; + + public static final String JSON_PROPERTY_VALUE = "value"; + private Long value; + + public ProductAnalyticsSankeyLink column(Long column) { + this.column = column; + return this; + } + + /** + * Zero-based index of the column the link starts from. + * + * @return column + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COLUMN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getColumn() { + return column; + } + + public void setColumn(Long column) { + this.column = column; + } + + public ProductAnalyticsSankeyLink id(String id) { + this.id = id; + return this; + } + + /** + * Unique identifier for the link. + * + * @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 ProductAnalyticsSankeyLink source(String source) { + this.source = source; + return this; + } + + /** + * Identifier of the node the link starts at. + * + * @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; + } + + public ProductAnalyticsSankeyLink target(String target) { + this.target = target; + return this; + } + + /** + * Identifier of the node the link ends at. + * + * @return target + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TARGET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTarget() { + return target; + } + + public void setTarget(String target) { + this.target = target; + } + + public ProductAnalyticsSankeyLink value(Long value) { + this.value = value; + return this; + } + + /** + * Number of sessions flowing along the link. + * + * @return value + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getValue() { + return value; + } + + public void setValue(Long 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 ProductAnalyticsSankeyLink + */ + @JsonAnySetter + public ProductAnalyticsSankeyLink 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 ProductAnalyticsSankeyLink object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsSankeyLink productAnalyticsSankeyLink = (ProductAnalyticsSankeyLink) o; + return Objects.equals(this.column, productAnalyticsSankeyLink.column) + && Objects.equals(this.id, productAnalyticsSankeyLink.id) + && Objects.equals(this.source, productAnalyticsSankeyLink.source) + && Objects.equals(this.target, productAnalyticsSankeyLink.target) + && Objects.equals(this.value, productAnalyticsSankeyLink.value) + && Objects.equals( + this.additionalProperties, productAnalyticsSankeyLink.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(column, id, source, target, value, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsSankeyLink {\n"); + sb.append(" column: ").append(toIndentedString(column)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" source: ").append(toIndentedString(source)).append("\n"); + sb.append(" target: ").append(toIndentedString(target)).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/ProductAnalyticsSankeyNode.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsSankeyNode.java new file mode 100644 index 00000000000..b30d8bfc6cf --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsSankeyNode.java @@ -0,0 +1,393 @@ +/* + * 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 node of the Sankey diagram, representing one facet value in one column. */ +@JsonPropertyOrder({ + ProductAnalyticsSankeyNode.JSON_PROPERTY_AGGREGATED_NODES, + ProductAnalyticsSankeyNode.JSON_PROPERTY_COLUMN, + ProductAnalyticsSankeyNode.JSON_PROPERTY_DROPOFF_VALUE, + ProductAnalyticsSankeyNode.JSON_PROPERTY_ID, + ProductAnalyticsSankeyNode.JSON_PROPERTY_INCOMING_VALUE, + ProductAnalyticsSankeyNode.JSON_PROPERTY_NAME, + ProductAnalyticsSankeyNode.JSON_PROPERTY_OUTGOING_VALUE, + ProductAnalyticsSankeyNode.JSON_PROPERTY_TYPE, + ProductAnalyticsSankeyNode.JSON_PROPERTY_VALUE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsSankeyNode { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_AGGREGATED_NODES = "aggregated_nodes"; + private List aggregatedNodes = null; + + public static final String JSON_PROPERTY_COLUMN = "column"; + private Long column; + + public static final String JSON_PROPERTY_DROPOFF_VALUE = "dropoff_value"; + private Long dropoffValue; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_INCOMING_VALUE = "incoming_value"; + private Long incomingValue; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_OUTGOING_VALUE = "outgoing_value"; + private Long outgoingValue; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ProductAnalyticsSankeyNodeType type; + + public static final String JSON_PROPERTY_VALUE = "value"; + private Long value; + + public ProductAnalyticsSankeyNode aggregatedNodes( + List aggregatedNodes) { + this.aggregatedNodes = aggregatedNodes; + if (aggregatedNodes != null) { + for (ProductAnalyticsSankeyAggregatedNode item : aggregatedNodes) { + this.unparsed |= item.unparsed; + } + } + return this; + } + + public ProductAnalyticsSankeyNode addAggregatedNodesItem( + ProductAnalyticsSankeyAggregatedNode aggregatedNodesItem) { + if (this.aggregatedNodes == null) { + this.aggregatedNodes = new ArrayList<>(); + } + this.aggregatedNodes.add(aggregatedNodesItem); + this.unparsed |= aggregatedNodesItem.unparsed; + return this; + } + + /** + * The nodes rolled up into this one, when the node is an aggregate. + * + * @return aggregatedNodes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AGGREGATED_NODES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getAggregatedNodes() { + return aggregatedNodes; + } + + public void setAggregatedNodes(List aggregatedNodes) { + this.aggregatedNodes = aggregatedNodes; + if (aggregatedNodes != null) { + for (ProductAnalyticsSankeyAggregatedNode item : aggregatedNodes) { + this.unparsed |= item.unparsed; + } + } + } + + public ProductAnalyticsSankeyNode column(Long column) { + this.column = column; + return this; + } + + /** + * Zero-based index of the column the node sits in. + * + * @return column + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COLUMN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getColumn() { + return column; + } + + public void setColumn(Long column) { + this.column = column; + } + + public ProductAnalyticsSankeyNode dropoffValue(Long dropoffValue) { + this.dropoffValue = dropoffValue; + return this; + } + + /** + * Number of sessions that ended at the node. + * + * @return dropoffValue + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DROPOFF_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getDropoffValue() { + return dropoffValue; + } + + public void setDropoffValue(Long dropoffValue) { + this.dropoffValue = dropoffValue; + } + + public ProductAnalyticsSankeyNode id(String id) { + this.id = id; + return this; + } + + /** + * Unique identifier for the node. + * + * @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 ProductAnalyticsSankeyNode incomingValue(Long incomingValue) { + this.incomingValue = incomingValue; + return this; + } + + /** + * Number of sessions entering the node. + * + * @return incomingValue + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INCOMING_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getIncomingValue() { + return incomingValue; + } + + public void setIncomingValue(Long incomingValue) { + this.incomingValue = incomingValue; + } + + public ProductAnalyticsSankeyNode name(String name) { + this.name = name; + return this; + } + + /** + * The facet value the node represents. + * + * @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 ProductAnalyticsSankeyNode outgoingValue(Long outgoingValue) { + this.outgoingValue = outgoingValue; + return this; + } + + /** + * Number of sessions leaving the node. + * + * @return outgoingValue + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_OUTGOING_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getOutgoingValue() { + return outgoingValue; + } + + public void setOutgoingValue(Long outgoingValue) { + this.outgoingValue = outgoingValue; + } + + public ProductAnalyticsSankeyNode type(ProductAnalyticsSankeyNodeType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The kind of node. regular is a single facet value, other rolls up the + * values that did not fit within entries_per_step, and dropoff collects + * the sessions that ended at this column. + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ProductAnalyticsSankeyNodeType getType() { + return type; + } + + public void setType(ProductAnalyticsSankeyNodeType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + public ProductAnalyticsSankeyNode value(Long value) { + this.value = value; + return this; + } + + /** + * Number of sessions passing through the node. + * + * @return value + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getValue() { + return value; + } + + public void setValue(Long 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 ProductAnalyticsSankeyNode + */ + @JsonAnySetter + public ProductAnalyticsSankeyNode 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 ProductAnalyticsSankeyNode object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsSankeyNode productAnalyticsSankeyNode = (ProductAnalyticsSankeyNode) o; + return Objects.equals(this.aggregatedNodes, productAnalyticsSankeyNode.aggregatedNodes) + && Objects.equals(this.column, productAnalyticsSankeyNode.column) + && Objects.equals(this.dropoffValue, productAnalyticsSankeyNode.dropoffValue) + && Objects.equals(this.id, productAnalyticsSankeyNode.id) + && Objects.equals(this.incomingValue, productAnalyticsSankeyNode.incomingValue) + && Objects.equals(this.name, productAnalyticsSankeyNode.name) + && Objects.equals(this.outgoingValue, productAnalyticsSankeyNode.outgoingValue) + && Objects.equals(this.type, productAnalyticsSankeyNode.type) + && Objects.equals(this.value, productAnalyticsSankeyNode.value) + && Objects.equals( + this.additionalProperties, productAnalyticsSankeyNode.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + aggregatedNodes, + column, + dropoffValue, + id, + incomingValue, + name, + outgoingValue, + type, + value, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsSankeyNode {\n"); + sb.append(" aggregatedNodes: ").append(toIndentedString(aggregatedNodes)).append("\n"); + sb.append(" column: ").append(toIndentedString(column)).append("\n"); + sb.append(" dropoffValue: ").append(toIndentedString(dropoffValue)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" incomingValue: ").append(toIndentedString(incomingValue)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" outgoingValue: ").append(toIndentedString(outgoingValue)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).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/ProductAnalyticsSankeyNodeType.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsSankeyNodeType.java new file mode 100644 index 00000000000..44ec13deaff --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsSankeyNodeType.java @@ -0,0 +1,66 @@ +/* + * 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 kind of node. regular is a single facet value, other rolls up the + * values that did not fit within entries_per_step, and dropoff collects + * the sessions that ended at this column. + */ +@JsonSerialize( + using = ProductAnalyticsSankeyNodeType.ProductAnalyticsSankeyNodeTypeSerializer.class) +public class ProductAnalyticsSankeyNodeType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("regular", "other", "dropoff")); + + public static final ProductAnalyticsSankeyNodeType REGULAR = + new ProductAnalyticsSankeyNodeType("regular"); + public static final ProductAnalyticsSankeyNodeType OTHER = + new ProductAnalyticsSankeyNodeType("other"); + public static final ProductAnalyticsSankeyNodeType DROPOFF = + new ProductAnalyticsSankeyNodeType("dropoff"); + + ProductAnalyticsSankeyNodeType(String value) { + super(value, allowedValues); + } + + public static class ProductAnalyticsSankeyNodeTypeSerializer + extends StdSerializer { + public ProductAnalyticsSankeyNodeTypeSerializer(Class t) { + super(t); + } + + public ProductAnalyticsSankeyNodeTypeSerializer() { + this(null); + } + + @Override + public void serialize( + ProductAnalyticsSankeyNodeType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ProductAnalyticsSankeyNodeType fromValue(String value) { + return new ProductAnalyticsSankeyNodeType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsSankeyRequest.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsSankeyRequest.java new file mode 100644 index 00000000000..8088f0d6f7c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsSankeyRequest.java @@ -0,0 +1,151 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Request body for a Sankey diagram query. */ +@JsonPropertyOrder({ProductAnalyticsSankeyRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsSankeyRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private ProductAnalyticsSankeyRequestData data; + + public ProductAnalyticsSankeyRequest() {} + + @JsonCreator + public ProductAnalyticsSankeyRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + ProductAnalyticsSankeyRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public ProductAnalyticsSankeyRequest data(ProductAnalyticsSankeyRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * The single JSON:API resource carrying a Sankey query. Its attributes hold the time window to + * query, the search that selects the sessions, and the definition of the diagram to build. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsSankeyRequestData getData() { + return data; + } + + public void setData(ProductAnalyticsSankeyRequestData data) { + this.data = data; + if (data != null) { + this.unparsed |= data.unparsed; + } + } + + /** + * 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 ProductAnalyticsSankeyRequest + */ + @JsonAnySetter + public ProductAnalyticsSankeyRequest 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 ProductAnalyticsSankeyRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsSankeyRequest productAnalyticsSankeyRequest = (ProductAnalyticsSankeyRequest) o; + return Objects.equals(this.data, productAnalyticsSankeyRequest.data) + && Objects.equals( + this.additionalProperties, productAnalyticsSankeyRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsSankeyRequest {\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/ProductAnalyticsSankeyRequestAttributes.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsSankeyRequestAttributes.java new file mode 100644 index 00000000000..30e08c67262 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsSankeyRequestAttributes.java @@ -0,0 +1,223 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Attributes of a Sankey request. */ +@JsonPropertyOrder({ + ProductAnalyticsSankeyRequestAttributes.JSON_PROPERTY_DEFINITION, + ProductAnalyticsSankeyRequestAttributes.JSON_PROPERTY_SEARCH, + ProductAnalyticsSankeyRequestAttributes.JSON_PROPERTY_TIME +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsSankeyRequestAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DEFINITION = "definition"; + private ProductAnalyticsSankeyDefinition definition; + + public static final String JSON_PROPERTY_SEARCH = "search"; + private ProductAnalyticsSankeySearch search; + + public static final String JSON_PROPERTY_TIME = "time"; + private ProductAnalyticsSankeyTime time; + + public ProductAnalyticsSankeyRequestAttributes() {} + + @JsonCreator + public ProductAnalyticsSankeyRequestAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_DEFINITION) + ProductAnalyticsSankeyDefinition definition, + @JsonProperty(required = true, value = JSON_PROPERTY_SEARCH) + ProductAnalyticsSankeySearch search, + @JsonProperty(required = true, value = JSON_PROPERTY_TIME) ProductAnalyticsSankeyTime time) { + this.definition = definition; + this.unparsed |= definition.unparsed; + this.search = search; + this.unparsed |= search.unparsed; + this.time = time; + this.unparsed |= time.unparsed; + } + + public ProductAnalyticsSankeyRequestAttributes definition( + ProductAnalyticsSankeyDefinition definition) { + this.definition = definition; + this.unparsed |= definition.unparsed; + return this; + } + + /** + * The shape of the Sankey diagram, expressed as the facets to flow between and how many steps to + * show. + * + * @return definition + */ + @JsonProperty(JSON_PROPERTY_DEFINITION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsSankeyDefinition getDefinition() { + return definition; + } + + public void setDefinition(ProductAnalyticsSankeyDefinition definition) { + this.definition = definition; + if (definition != null) { + this.unparsed |= definition.unparsed; + } + } + + public ProductAnalyticsSankeyRequestAttributes search(ProductAnalyticsSankeySearch search) { + this.search = search; + this.unparsed |= search.unparsed; + return this; + } + + /** + * Selects the sessions a Sankey diagram is built from. + * + * @return search + */ + @JsonProperty(JSON_PROPERTY_SEARCH) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsSankeySearch getSearch() { + return search; + } + + public void setSearch(ProductAnalyticsSankeySearch search) { + this.search = search; + if (search != null) { + this.unparsed |= search.unparsed; + } + } + + public ProductAnalyticsSankeyRequestAttributes time(ProductAnalyticsSankeyTime time) { + this.time = time; + this.unparsed |= time.unparsed; + return this; + } + + /** + * The time window a Sankey query covers. + * + * @return time + */ + @JsonProperty(JSON_PROPERTY_TIME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsSankeyTime getTime() { + return time; + } + + public void setTime(ProductAnalyticsSankeyTime time) { + this.time = time; + if (time != null) { + this.unparsed |= time.unparsed; + } + } + + /** + * 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 ProductAnalyticsSankeyRequestAttributes + */ + @JsonAnySetter + public ProductAnalyticsSankeyRequestAttributes 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 ProductAnalyticsSankeyRequestAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsSankeyRequestAttributes productAnalyticsSankeyRequestAttributes = + (ProductAnalyticsSankeyRequestAttributes) o; + return Objects.equals(this.definition, productAnalyticsSankeyRequestAttributes.definition) + && Objects.equals(this.search, productAnalyticsSankeyRequestAttributes.search) + && Objects.equals(this.time, productAnalyticsSankeyRequestAttributes.time) + && Objects.equals( + this.additionalProperties, + productAnalyticsSankeyRequestAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(definition, search, time, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsSankeyRequestAttributes {\n"); + sb.append(" definition: ").append(toIndentedString(definition)).append("\n"); + sb.append(" search: ").append(toIndentedString(search)).append("\n"); + sb.append(" time: ").append(toIndentedString(time)).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/ProductAnalyticsSankeyRequestData.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsSankeyRequestData.java new file mode 100644 index 00000000000..f7057613592 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsSankeyRequestData.java @@ -0,0 +1,191 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * The single JSON:API resource carrying a Sankey query. Its attributes hold the time window to + * query, the search that selects the sessions, and the definition of the diagram to build. + */ +@JsonPropertyOrder({ + ProductAnalyticsSankeyRequestData.JSON_PROPERTY_ATTRIBUTES, + ProductAnalyticsSankeyRequestData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsSankeyRequestData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private ProductAnalyticsSankeyRequestAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ProductAnalyticsSankeyRequestType type; + + public ProductAnalyticsSankeyRequestData() {} + + @JsonCreator + public ProductAnalyticsSankeyRequestData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + ProductAnalyticsSankeyRequestAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + ProductAnalyticsSankeyRequestType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public ProductAnalyticsSankeyRequestData attributes( + ProductAnalyticsSankeyRequestAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of a Sankey request. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsSankeyRequestAttributes getAttributes() { + return attributes; + } + + public void setAttributes(ProductAnalyticsSankeyRequestAttributes attributes) { + this.attributes = attributes; + if (attributes != null) { + this.unparsed |= attributes.unparsed; + } + } + + public ProductAnalyticsSankeyRequestData type(ProductAnalyticsSankeyRequestType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The resource type identifier for a Sankey request. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsSankeyRequestType getType() { + return type; + } + + public void setType(ProductAnalyticsSankeyRequestType 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 ProductAnalyticsSankeyRequestData + */ + @JsonAnySetter + public ProductAnalyticsSankeyRequestData 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 ProductAnalyticsSankeyRequestData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsSankeyRequestData productAnalyticsSankeyRequestData = + (ProductAnalyticsSankeyRequestData) o; + return Objects.equals(this.attributes, productAnalyticsSankeyRequestData.attributes) + && Objects.equals(this.type, productAnalyticsSankeyRequestData.type) + && Objects.equals( + this.additionalProperties, productAnalyticsSankeyRequestData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsSankeyRequestData {\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/ProductAnalyticsSankeyRequestType.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsSankeyRequestType.java new file mode 100644 index 00000000000..45f0343ba0e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsSankeyRequestType.java @@ -0,0 +1,58 @@ +/* + * 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 identifier for a Sankey request. */ +@JsonSerialize( + using = ProductAnalyticsSankeyRequestType.ProductAnalyticsSankeyRequestTypeSerializer.class) +public class ProductAnalyticsSankeyRequestType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("sankey_request")); + + public static final ProductAnalyticsSankeyRequestType SANKEY_REQUEST = + new ProductAnalyticsSankeyRequestType("sankey_request"); + + ProductAnalyticsSankeyRequestType(String value) { + super(value, allowedValues); + } + + public static class ProductAnalyticsSankeyRequestTypeSerializer + extends StdSerializer { + public ProductAnalyticsSankeyRequestTypeSerializer(Class t) { + super(t); + } + + public ProductAnalyticsSankeyRequestTypeSerializer() { + this(null); + } + + @Override + public void serialize( + ProductAnalyticsSankeyRequestType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ProductAnalyticsSankeyRequestType fromValue(String value) { + return new ProductAnalyticsSankeyRequestType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsSankeyResponse.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsSankeyResponse.java new file mode 100644 index 00000000000..f3ccd01be90 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsSankeyResponse.java @@ -0,0 +1,152 @@ +/* + * 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; + +/** Response for a Sankey diagram query. */ +@JsonPropertyOrder({ProductAnalyticsSankeyResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsSankeyResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private ProductAnalyticsSankeyResponseData data; + + public ProductAnalyticsSankeyResponse() {} + + @JsonCreator + public ProductAnalyticsSankeyResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + ProductAnalyticsSankeyResponseData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public ProductAnalyticsSankeyResponse data(ProductAnalyticsSankeyResponseData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * The single JSON:API resource holding a computed Sankey diagram. Its attributes contain the + * nodes of every column and the links that carry sessions between them. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsSankeyResponseData getData() { + return data; + } + + public void setData(ProductAnalyticsSankeyResponseData data) { + this.data = data; + if (data != null) { + this.unparsed |= data.unparsed; + } + } + + /** + * 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 ProductAnalyticsSankeyResponse + */ + @JsonAnySetter + public ProductAnalyticsSankeyResponse 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 ProductAnalyticsSankeyResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsSankeyResponse productAnalyticsSankeyResponse = + (ProductAnalyticsSankeyResponse) o; + return Objects.equals(this.data, productAnalyticsSankeyResponse.data) + && Objects.equals( + this.additionalProperties, productAnalyticsSankeyResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsSankeyResponse {\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/ProductAnalyticsSankeyResponseAttributes.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsSankeyResponseAttributes.java new file mode 100644 index 00000000000..2ad5a887104 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsSankeyResponseAttributes.java @@ -0,0 +1,209 @@ +/* + * 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; + +/** Attributes of a Sankey response, containing the nodes and the links between them. */ +@JsonPropertyOrder({ + ProductAnalyticsSankeyResponseAttributes.JSON_PROPERTY_LINKS, + ProductAnalyticsSankeyResponseAttributes.JSON_PROPERTY_NODES +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsSankeyResponseAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_LINKS = "links"; + private List links = null; + + public static final String JSON_PROPERTY_NODES = "nodes"; + private List nodes = null; + + public ProductAnalyticsSankeyResponseAttributes links(List links) { + this.links = links; + if (links != null) { + for (ProductAnalyticsSankeyLink item : links) { + this.unparsed |= item.unparsed; + } + } + return this; + } + + public ProductAnalyticsSankeyResponseAttributes addLinksItem( + ProductAnalyticsSankeyLink linksItem) { + if (this.links == null) { + this.links = new ArrayList<>(); + } + this.links.add(linksItem); + this.unparsed |= linksItem.unparsed; + return this; + } + + /** + * The links of the diagram, one per pair of connected nodes. + * + * @return links + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LINKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getLinks() { + return links; + } + + public void setLinks(List links) { + this.links = links; + if (links != null) { + for (ProductAnalyticsSankeyLink item : links) { + this.unparsed |= item.unparsed; + } + } + } + + public ProductAnalyticsSankeyResponseAttributes nodes(List nodes) { + this.nodes = nodes; + if (nodes != null) { + for (ProductAnalyticsSankeyNode item : nodes) { + this.unparsed |= item.unparsed; + } + } + return this; + } + + public ProductAnalyticsSankeyResponseAttributes addNodesItem( + ProductAnalyticsSankeyNode nodesItem) { + if (this.nodes == null) { + this.nodes = new ArrayList<>(); + } + this.nodes.add(nodesItem); + this.unparsed |= nodesItem.unparsed; + return this; + } + + /** + * The nodes of the diagram, one per facet value and column. + * + * @return nodes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NODES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNodes() { + return nodes; + } + + public void setNodes(List nodes) { + this.nodes = nodes; + if (nodes != null) { + for (ProductAnalyticsSankeyNode item : nodes) { + this.unparsed |= item.unparsed; + } + } + } + + /** + * 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 ProductAnalyticsSankeyResponseAttributes + */ + @JsonAnySetter + public ProductAnalyticsSankeyResponseAttributes 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 ProductAnalyticsSankeyResponseAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsSankeyResponseAttributes productAnalyticsSankeyResponseAttributes = + (ProductAnalyticsSankeyResponseAttributes) o; + return Objects.equals(this.links, productAnalyticsSankeyResponseAttributes.links) + && Objects.equals(this.nodes, productAnalyticsSankeyResponseAttributes.nodes) + && Objects.equals( + this.additionalProperties, + productAnalyticsSankeyResponseAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(links, nodes, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsSankeyResponseAttributes {\n"); + sb.append(" links: ").append(toIndentedString(links)).append("\n"); + sb.append(" nodes: ").append(toIndentedString(nodes)).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/ProductAnalyticsSankeyResponseData.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsSankeyResponseData.java new file mode 100644 index 00000000000..42681a57f9c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsSankeyResponseData.java @@ -0,0 +1,219 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * The single JSON:API resource holding a computed Sankey diagram. Its attributes contain the nodes + * of every column and the links that carry sessions between them. + */ +@JsonPropertyOrder({ + ProductAnalyticsSankeyResponseData.JSON_PROPERTY_ATTRIBUTES, + ProductAnalyticsSankeyResponseData.JSON_PROPERTY_ID, + ProductAnalyticsSankeyResponseData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsSankeyResponseData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private ProductAnalyticsSankeyResponseAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ProductAnalyticsSankeyResponseType type; + + public ProductAnalyticsSankeyResponseData() {} + + @JsonCreator + public ProductAnalyticsSankeyResponseData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + ProductAnalyticsSankeyResponseAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + ProductAnalyticsSankeyResponseType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public ProductAnalyticsSankeyResponseData attributes( + ProductAnalyticsSankeyResponseAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of a Sankey response, containing the nodes and the links between them. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsSankeyResponseAttributes getAttributes() { + return attributes; + } + + public void setAttributes(ProductAnalyticsSankeyResponseAttributes attributes) { + this.attributes = attributes; + if (attributes != null) { + this.unparsed |= attributes.unparsed; + } + } + + public ProductAnalyticsSankeyResponseData id(String id) { + this.id = id; + return this; + } + + /** + * Unique identifier for this response data object. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public ProductAnalyticsSankeyResponseData type(ProductAnalyticsSankeyResponseType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The resource type identifier for a Sankey response. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProductAnalyticsSankeyResponseType getType() { + return type; + } + + public void setType(ProductAnalyticsSankeyResponseType 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 ProductAnalyticsSankeyResponseData + */ + @JsonAnySetter + public ProductAnalyticsSankeyResponseData 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 ProductAnalyticsSankeyResponseData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsSankeyResponseData productAnalyticsSankeyResponseData = + (ProductAnalyticsSankeyResponseData) o; + return Objects.equals(this.attributes, productAnalyticsSankeyResponseData.attributes) + && Objects.equals(this.id, productAnalyticsSankeyResponseData.id) + && Objects.equals(this.type, productAnalyticsSankeyResponseData.type) + && Objects.equals( + this.additionalProperties, productAnalyticsSankeyResponseData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsSankeyResponseData {\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/ProductAnalyticsSankeyResponseType.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsSankeyResponseType.java new file mode 100644 index 00000000000..88fe01fe298 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsSankeyResponseType.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; + +/** The resource type identifier for a Sankey response. */ +@JsonSerialize( + using = ProductAnalyticsSankeyResponseType.ProductAnalyticsSankeyResponseTypeSerializer.class) +public class ProductAnalyticsSankeyResponseType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("sankey_response")); + + public static final ProductAnalyticsSankeyResponseType SANKEY_RESPONSE = + new ProductAnalyticsSankeyResponseType("sankey_response"); + + ProductAnalyticsSankeyResponseType(String value) { + super(value, allowedValues); + } + + public static class ProductAnalyticsSankeyResponseTypeSerializer + extends StdSerializer { + public ProductAnalyticsSankeyResponseTypeSerializer( + Class t) { + super(t); + } + + public ProductAnalyticsSankeyResponseTypeSerializer() { + this(null); + } + + @Override + public void serialize( + ProductAnalyticsSankeyResponseType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ProductAnalyticsSankeyResponseType fromValue(String value) { + return new ProductAnalyticsSankeyResponseType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsSankeySearch.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsSankeySearch.java new file mode 100644 index 00000000000..760d9dac672 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsSankeySearch.java @@ -0,0 +1,201 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.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; + +/** Selects the sessions a Sankey diagram is built from. */ +@JsonPropertyOrder({ + ProductAnalyticsSankeySearch.JSON_PROPERTY_AUDIENCE_FILTERS, + ProductAnalyticsSankeySearch.JSON_PROPERTY_JOIN_KEYS, + ProductAnalyticsSankeySearch.JSON_PROPERTY_QUERY +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsSankeySearch { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_AUDIENCE_FILTERS = "audience_filters"; + private ProductAnalyticsAudienceFilters audienceFilters; + + public static final String JSON_PROPERTY_JOIN_KEYS = "join_keys"; + private ProductAnalyticsJoinKeys joinKeys; + + public static final String JSON_PROPERTY_QUERY = "query"; + private String query; + + public ProductAnalyticsSankeySearch 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; + if (audienceFilters != null) { + this.unparsed |= audienceFilters.unparsed; + } + } + + public ProductAnalyticsSankeySearch joinKeys(ProductAnalyticsJoinKeys joinKeys) { + this.joinKeys = joinKeys; + this.unparsed |= joinKeys.unparsed; + return this; + } + + /** + * Identity join keys used to stitch events belonging to the same user or session. + * + * @return joinKeys + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_JOIN_KEYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ProductAnalyticsJoinKeys getJoinKeys() { + return joinKeys; + } + + public void setJoinKeys(ProductAnalyticsJoinKeys joinKeys) { + this.joinKeys = joinKeys; + if (joinKeys != null) { + this.unparsed |= joinKeys.unparsed; + } + } + + public ProductAnalyticsSankeySearch query(String query) { + this.query = query; + return this; + } + + /** + * Datadog search query restricting the events considered. + * + * @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 ProductAnalyticsSankeySearch + */ + @JsonAnySetter + public ProductAnalyticsSankeySearch 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 ProductAnalyticsSankeySearch object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsSankeySearch productAnalyticsSankeySearch = (ProductAnalyticsSankeySearch) o; + return Objects.equals(this.audienceFilters, productAnalyticsSankeySearch.audienceFilters) + && Objects.equals(this.joinKeys, productAnalyticsSankeySearch.joinKeys) + && Objects.equals(this.query, productAnalyticsSankeySearch.query) + && Objects.equals( + this.additionalProperties, productAnalyticsSankeySearch.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(audienceFilters, joinKeys, query, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsSankeySearch {\n"); + sb.append(" audienceFilters: ").append(toIndentedString(audienceFilters)).append("\n"); + sb.append(" joinKeys: ").append(toIndentedString(joinKeys)).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/ProductAnalyticsSankeyTime.java b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsSankeyTime.java new file mode 100644 index 00000000000..3351d31b5dc --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProductAnalyticsSankeyTime.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; + +/** The time window a Sankey query covers. */ +@JsonPropertyOrder({ + ProductAnalyticsSankeyTime.JSON_PROPERTY_FROM, + ProductAnalyticsSankeyTime.JSON_PROPERTY_TO +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProductAnalyticsSankeyTime { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_FROM = "from"; + private Long from; + + public static final String JSON_PROPERTY_TO = "to"; + private Long to; + + public ProductAnalyticsSankeyTime() {} + + @JsonCreator + public ProductAnalyticsSankeyTime( + @JsonProperty(required = true, value = JSON_PROPERTY_FROM) Long from, + @JsonProperty(required = true, value = JSON_PROPERTY_TO) Long to) { + this.from = from; + this.to = to; + } + + public ProductAnalyticsSankeyTime from(Long from) { + this.from = from; + return this; + } + + /** + * Start of the query window, in epoch milliseconds. + * + * @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 ProductAnalyticsSankeyTime to(Long to) { + this.to = to; + return this; + } + + /** + * End of the query window, 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 ProductAnalyticsSankeyTime + */ + @JsonAnySetter + public ProductAnalyticsSankeyTime 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 ProductAnalyticsSankeyTime object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductAnalyticsSankeyTime productAnalyticsSankeyTime = (ProductAnalyticsSankeyTime) o; + return Objects.equals(this.from, productAnalyticsSankeyTime.from) + && Objects.equals(this.to, productAnalyticsSankeyTime.to) + && Objects.equals( + this.additionalProperties, productAnalyticsSankeyTime.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(from, to, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProductAnalyticsSankeyTime {\n"); + sb.append(" from: ").append(toIndentedString(from)).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/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 cee2e815db7..2e5c7873074 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 @@ -14,6 +14,132 @@ Feature: Product Analytics Given a valid "apiKeyAuth" key in the system And an instance of "ProductAnalytics" API + @generated @skip @team:DataDog/product-analytics-backend + Scenario: Compute a Sankey diagram returns "Bad Request" response + Given a valid "appKeyAuth" key in the system + And operation "QueryProductAnalyticsSankey" enabled + And new "QueryProductAnalyticsSankey" request + And body with value {"data": {"attributes": {"definition": {"entries_per_step": 10, "number_of_steps": 3, "source": "@view.name", "target": "@view.name"}, "search": {"audience_filters": {"accounts": [{"name": ""}], "formula": "u", "segments": [{"name": "", "segment_id": "00000000-0000-0000-0000-000000000000"}], "users": [{"name": "u", "query": "*"}]}, "join_keys": {"primary": "@session.id", "secondary": []}, "query": "@type:view"}, "time": {"from": 1756425600000, "to": 1756857600000}}, "type": "sankey_request"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/product-analytics-backend + Scenario: Compute a Sankey diagram returns "OK" response + Given a valid "appKeyAuth" key in the system + And operation "QueryProductAnalyticsSankey" enabled + And new "QueryProductAnalyticsSankey" request + And body with value {"data": {"attributes": {"definition": {"entries_per_step": 10, "number_of_steps": 3, "source": "@view.name", "target": "@view.name"}, "search": {"audience_filters": {"accounts": [{"name": ""}], "formula": "u", "segments": [{"name": "", "segment_id": "00000000-0000-0000-0000-000000000000"}], "users": [{"name": "u", "query": "*"}]}, "join_keys": {"primary": "@session.id", "secondary": []}, "query": "@type:view"}, "time": {"from": 1756425600000, "to": 1756857600000}}, "type": "sankey_request"}} + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/product-analytics-backend + Scenario: Compute a retention grid returns "Bad Request" response + Given a valid "appKeyAuth" key in the system + And operation "QueryProductAnalyticsRetentionGrid" enabled + And new "QueryProductAnalyticsRetentionGrid" request + And body with value {"data": {"attributes": {"exclude_anonymous_traffic": false, "from": 1756425600000, "query": {"computation_scope": {"target": {"type": "index", "value": 0}, "type": "cohort"}, "compute": {"aggregation": "count", "metric": "__dd.retention_rate"}, "group_by": [{"facet": "@geo.country", "limit": 10, "should_exclude_missing": false, "sort": {"aggregation": "count", "order": "desc"}, "target": "cohort"}], "search": {"cohort_criteria": {"base_query": {"data_source": "product_analytics", "search": {"query": "@type:view"}}, "time_interval": {"type": "calendar", "value": {"alignment": "monday", "quantity": 1, "timezone": "UTC", "type": "week"}}}, "filters": {"audience_filters": {"accounts": [{"name": ""}], "formula": "u", "segments": [{"name": "", "segment_id": "00000000-0000-0000-0000-000000000000"}], "users": [{"name": "u", "query": "*"}]}}, "retention_entity": "@usr.id", "return_condition": "conversion_on_or_after", "return_criteria": {"base_query": {"data_source": "product_analytics", "search": {"query": "@type:view"}}, "time_interval": {"type": "calendar", "value": {"alignment": "monday", "quantity": 1, "timezone": "UTC", "type": "week"}}}}}, "to": 1756857600000}, "type": "retention_grid_request"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/product-analytics-backend + Scenario: Compute a retention grid returns "OK" response + Given a valid "appKeyAuth" key in the system + And operation "QueryProductAnalyticsRetentionGrid" enabled + And new "QueryProductAnalyticsRetentionGrid" request + And body with value {"data": {"attributes": {"exclude_anonymous_traffic": false, "from": 1756425600000, "query": {"computation_scope": {"target": {"type": "index", "value": 0}, "type": "cohort"}, "compute": {"aggregation": "count", "metric": "__dd.retention_rate"}, "group_by": [{"facet": "@geo.country", "limit": 10, "should_exclude_missing": false, "sort": {"aggregation": "count", "order": "desc"}, "target": "cohort"}], "search": {"cohort_criteria": {"base_query": {"data_source": "product_analytics", "search": {"query": "@type:view"}}, "time_interval": {"type": "calendar", "value": {"alignment": "monday", "quantity": 1, "timezone": "UTC", "type": "week"}}}, "filters": {"audience_filters": {"accounts": [{"name": ""}], "formula": "u", "segments": [{"name": "", "segment_id": "00000000-0000-0000-0000-000000000000"}], "users": [{"name": "u", "query": "*"}]}}, "retention_entity": "@usr.id", "return_condition": "conversion_on_or_after", "return_criteria": {"base_query": {"data_source": "product_analytics", "search": {"query": "@type:view"}}, "time_interval": {"type": "calendar", "value": {"alignment": "monday", "quantity": 1, "timezone": "UTC", "type": "week"}}}}}, "to": 1756857600000}, "type": "retention_grid_request"}} + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/product-analytics-backend + Scenario: Compute journey funnel analysis returns "Bad Request" response + Given a valid "appKeyAuth" key in the system + And operation "QueryProductAnalyticsJourneyFunnel" enabled + And new "QueryProductAnalyticsJourneyFunnel" request + And body with value {"data": {"attributes": {"exclude_anonymous_traffic": false, "from": 1756425600000, "query": {"compute": {}, "group_by": [{"facet": "@geo.country", "should_exclude_missing": false, "sort": {"aggregation": "count", "order": "desc"}, "source": "product_analytics_audience_filters.users", "target": {"type": "node", "value": "A"}, "value_filters": []}], "search": {"expression": "A -> B", "filters": {"audience_filters": {"accounts": [{"name": "enterprise_accounts"}], "formula": "power_users AND NOT trial_segment", "segments": [{"name": "trial_segment", "segment_id": "00000000-0000-0000-0000-000000000000"}], "users": [{"name": "power_users"}]}, "graph_filters": [{"name": "__dd.time_to_convert", "operator": "<=", "target": {"type": "node", "value": "A"}, "value": 60000}]}, "join_keys": {"primary": "@session.id", "secondary": []}, "node_objects": {"A": {"data_source": "product_analytics", "search": {"query": "@type:view @view.name:Login"}}, "B": {"data_source": "product_analytics", "search": {"query": "@type:action @action.target.name:Submit"}}}}}, "to": 1756857600000}, "type": "journey_request"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/product-analytics-backend + Scenario: Compute journey funnel analysis returns "OK" response + Given a valid "appKeyAuth" key in the system + And operation "QueryProductAnalyticsJourneyFunnel" enabled + And new "QueryProductAnalyticsJourneyFunnel" request + And body with value {"data": {"attributes": {"exclude_anonymous_traffic": false, "from": 1756425600000, "query": {"compute": {}, "group_by": [{"facet": "@geo.country", "should_exclude_missing": false, "sort": {"aggregation": "count", "order": "desc"}, "source": "product_analytics_audience_filters.users", "target": {"type": "node", "value": "A"}, "value_filters": []}], "search": {"expression": "A -> B", "filters": {"audience_filters": {"accounts": [{"name": "enterprise_accounts"}], "formula": "power_users AND NOT trial_segment", "segments": [{"name": "trial_segment", "segment_id": "00000000-0000-0000-0000-000000000000"}], "users": [{"name": "power_users"}]}, "graph_filters": [{"name": "__dd.time_to_convert", "operator": "<=", "target": {"type": "node", "value": "A"}, "value": 60000}]}, "join_keys": {"primary": "@session.id", "secondary": []}, "node_objects": {"A": {"data_source": "product_analytics", "search": {"query": "@type:view @view.name:Login"}}, "B": {"data_source": "product_analytics", "search": {"query": "@type:action @action.target.name:Submit"}}}}}, "to": 1756857600000}, "type": "journey_request"}} + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/product-analytics-backend + Scenario: Compute journey scalar analytics returns "Bad Request" response + Given a valid "appKeyAuth" key in the system + And operation "QueryProductAnalyticsJourneyScalar" enabled + And new "QueryProductAnalyticsJourneyScalar" request + And body with value {"data": {"attributes": {"from": 1756425600000, "query": {"compute": {"aggregation": "count", "target": {"type": "node", "value": "A"}}, "group_by": [{"facet": "@geo.country", "should_exclude_missing": false, "sort": {"aggregation": "count", "order": "desc"}, "source": "product_analytics_audience_filters.users", "target": {"type": "node", "value": "A"}, "value_filters": []}], "search": {"expression": "A -> B", "filters": {"audience_filters": {"accounts": [{"name": "enterprise_accounts"}], "formula": "power_users AND NOT trial_segment", "segments": [{"name": "trial_segment", "segment_id": "00000000-0000-0000-0000-000000000000"}], "users": [{"name": "power_users"}]}, "graph_filters": [{"name": "__dd.time_to_convert", "operator": "<=", "target": {"type": "node", "value": "A"}, "value": 60000}]}, "join_keys": {"primary": "@session.id", "secondary": []}, "node_objects": {"A": {"data_source": "product_analytics", "search": {"query": "@type:view @view.name:Login"}}, "B": {"data_source": "product_analytics", "search": {"query": "@type:action @action.target.name:Submit"}}}}}, "to": 1756857600000}, "type": "formula_journey_request"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/product-analytics-backend + Scenario: Compute journey scalar analytics returns "OK" response + Given a valid "appKeyAuth" key in the system + And operation "QueryProductAnalyticsJourneyScalar" enabled + And new "QueryProductAnalyticsJourneyScalar" request + And body with value {"data": {"attributes": {"from": 1756425600000, "query": {"compute": {"aggregation": "count", "target": {"type": "node", "value": "A"}}, "group_by": [{"facet": "@geo.country", "should_exclude_missing": false, "sort": {"aggregation": "count", "order": "desc"}, "source": "product_analytics_audience_filters.users", "target": {"type": "node", "value": "A"}, "value_filters": []}], "search": {"expression": "A -> B", "filters": {"audience_filters": {"accounts": [{"name": "enterprise_accounts"}], "formula": "power_users AND NOT trial_segment", "segments": [{"name": "trial_segment", "segment_id": "00000000-0000-0000-0000-000000000000"}], "users": [{"name": "power_users"}]}, "graph_filters": [{"name": "__dd.time_to_convert", "operator": "<=", "target": {"type": "node", "value": "A"}, "value": 60000}]}, "join_keys": {"primary": "@session.id", "secondary": []}, "node_objects": {"A": {"data_source": "product_analytics", "search": {"query": "@type:view @view.name:Login"}}, "B": {"data_source": "product_analytics", "search": {"query": "@type:action @action.target.name:Submit"}}}}}, "to": 1756857600000}, "type": "formula_journey_request"}} + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/product-analytics-backend + Scenario: Compute journey timeseries analytics returns "Bad Request" response + Given a valid "appKeyAuth" key in the system + And operation "QueryProductAnalyticsJourneyTimeseries" enabled + And new "QueryProductAnalyticsJourneyTimeseries" request + And body with value {"data": {"attributes": {"from": 1756425600000, "query": {"compute": {"aggregation": "count", "target": {"type": "node", "value": "A"}}, "group_by": [{"facet": "@geo.country", "should_exclude_missing": false, "sort": {"aggregation": "count", "order": "desc"}, "source": "product_analytics_audience_filters.users", "target": {"type": "node", "value": "A"}, "value_filters": []}], "search": {"expression": "A -> B", "filters": {"audience_filters": {"accounts": [{"name": "enterprise_accounts"}], "formula": "power_users AND NOT trial_segment", "segments": [{"name": "trial_segment", "segment_id": "00000000-0000-0000-0000-000000000000"}], "users": [{"name": "power_users"}]}, "graph_filters": [{"name": "__dd.time_to_convert", "operator": "<=", "target": {"type": "node", "value": "A"}, "value": 60000}]}, "join_keys": {"primary": "@session.id", "secondary": []}, "node_objects": {"A": {"data_source": "product_analytics", "search": {"query": "@type:view @view.name:Login"}}, "B": {"data_source": "product_analytics", "search": {"query": "@type:action @action.target.name:Submit"}}}}}, "to": 1756857600000}, "type": "formula_journey_request"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/product-analytics-backend + Scenario: Compute journey timeseries analytics returns "OK" response + Given a valid "appKeyAuth" key in the system + And operation "QueryProductAnalyticsJourneyTimeseries" enabled + And new "QueryProductAnalyticsJourneyTimeseries" request + And body with value {"data": {"attributes": {"from": 1756425600000, "query": {"compute": {"aggregation": "count", "target": {"type": "node", "value": "A"}}, "group_by": [{"facet": "@geo.country", "should_exclude_missing": false, "sort": {"aggregation": "count", "order": "desc"}, "source": "product_analytics_audience_filters.users", "target": {"type": "node", "value": "A"}, "value_filters": []}], "search": {"expression": "A -> B", "filters": {"audience_filters": {"accounts": [{"name": "enterprise_accounts"}], "formula": "power_users AND NOT trial_segment", "segments": [{"name": "trial_segment", "segment_id": "00000000-0000-0000-0000-000000000000"}], "users": [{"name": "power_users"}]}, "graph_filters": [{"name": "__dd.time_to_convert", "operator": "<=", "target": {"type": "node", "value": "A"}, "value": 60000}]}, "join_keys": {"primary": "@session.id", "secondary": []}, "node_objects": {"A": {"data_source": "product_analytics", "search": {"query": "@type:view @view.name:Login"}}, "B": {"data_source": "product_analytics", "search": {"query": "@type:action @action.target.name:Submit"}}}}}, "to": 1756857600000}, "type": "formula_journey_request"}} + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/product-analytics-backend + Scenario: Compute retention scalar values returns "Bad Request" response + Given a valid "appKeyAuth" key in the system + And operation "QueryProductAnalyticsRetentionScalar" enabled + And new "QueryProductAnalyticsRetentionScalar" request + And body with value {"data": {"attributes": {"exclude_anonymous_traffic": false, "from": 1756425600000, "query": {"computation_scope": {"target": {"type": "index", "value": 0}, "type": "cohort"}, "compute": {"aggregation": "count", "metric": "__dd.retention_rate"}, "group_by": [{"facet": "@geo.country", "limit": 10, "should_exclude_missing": false, "sort": {"aggregation": "count", "order": "desc"}, "target": "cohort"}], "search": {"cohort_criteria": {"base_query": {"data_source": "product_analytics", "search": {"query": "@type:view"}}, "time_interval": {"type": "calendar", "value": {"alignment": "monday", "quantity": 1, "timezone": "UTC", "type": "week"}}}, "filters": {"audience_filters": {"accounts": [{"name": ""}], "formula": "u", "segments": [{"name": "", "segment_id": "00000000-0000-0000-0000-000000000000"}], "users": [{"name": "u", "query": "*"}]}}, "retention_entity": "@usr.id", "return_condition": "conversion_on_or_after", "return_criteria": {"base_query": {"data_source": "product_analytics", "search": {"query": "@type:view"}}, "time_interval": {"type": "calendar", "value": {"alignment": "monday", "quantity": 1, "timezone": "UTC", "type": "week"}}}}}, "to": 1756857600000}, "type": "formula_retention_request"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/product-analytics-backend + Scenario: Compute retention scalar values returns "OK" response + Given a valid "appKeyAuth" key in the system + And operation "QueryProductAnalyticsRetentionScalar" enabled + And new "QueryProductAnalyticsRetentionScalar" request + And body with value {"data": {"attributes": {"exclude_anonymous_traffic": false, "from": 1756425600000, "query": {"computation_scope": {"target": {"type": "index", "value": 0}, "type": "cohort"}, "compute": {"aggregation": "count", "metric": "__dd.retention_rate"}, "group_by": [{"facet": "@geo.country", "limit": 10, "should_exclude_missing": false, "sort": {"aggregation": "count", "order": "desc"}, "target": "cohort"}], "search": {"cohort_criteria": {"base_query": {"data_source": "product_analytics", "search": {"query": "@type:view"}}, "time_interval": {"type": "calendar", "value": {"alignment": "monday", "quantity": 1, "timezone": "UTC", "type": "week"}}}, "filters": {"audience_filters": {"accounts": [{"name": ""}], "formula": "u", "segments": [{"name": "", "segment_id": "00000000-0000-0000-0000-000000000000"}], "users": [{"name": "u", "query": "*"}]}}, "retention_entity": "@usr.id", "return_condition": "conversion_on_or_after", "return_criteria": {"base_query": {"data_source": "product_analytics", "search": {"query": "@type:view"}}, "time_interval": {"type": "calendar", "value": {"alignment": "monday", "quantity": 1, "timezone": "UTC", "type": "week"}}}}}, "to": 1756857600000}, "type": "formula_retention_request"}} + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/product-analytics-backend + Scenario: Compute retention timeseries returns "Bad Request" response + Given a valid "appKeyAuth" key in the system + And operation "QueryProductAnalyticsRetentionTimeseries" enabled + And new "QueryProductAnalyticsRetentionTimeseries" request + And body with value {"data": {"attributes": {"exclude_anonymous_traffic": false, "from": 1756425600000, "query": {"computation_scope": {"target": {"type": "index", "value": 0}, "type": "cohort"}, "compute": {"aggregation": "count", "metric": "__dd.retention_rate"}, "group_by": [{"facet": "@geo.country", "limit": 10, "should_exclude_missing": false, "sort": {"aggregation": "count", "order": "desc"}, "target": "cohort"}], "search": {"cohort_criteria": {"base_query": {"data_source": "product_analytics", "search": {"query": "@type:view"}}, "time_interval": {"type": "calendar", "value": {"alignment": "monday", "quantity": 1, "timezone": "UTC", "type": "week"}}}, "filters": {"audience_filters": {"accounts": [{"name": ""}], "formula": "u", "segments": [{"name": "", "segment_id": "00000000-0000-0000-0000-000000000000"}], "users": [{"name": "u", "query": "*"}]}}, "retention_entity": "@usr.id", "return_condition": "conversion_on_or_after", "return_criteria": {"base_query": {"data_source": "product_analytics", "search": {"query": "@type:view"}}, "time_interval": {"type": "calendar", "value": {"alignment": "monday", "quantity": 1, "timezone": "UTC", "type": "week"}}}}}, "to": 1756857600000}, "type": "formula_retention_request"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/product-analytics-backend + Scenario: Compute retention timeseries returns "OK" response + Given a valid "appKeyAuth" key in the system + And operation "QueryProductAnalyticsRetentionTimeseries" enabled + And new "QueryProductAnalyticsRetentionTimeseries" request + And body with value {"data": {"attributes": {"exclude_anonymous_traffic": false, "from": 1756425600000, "query": {"computation_scope": {"target": {"type": "index", "value": 0}, "type": "cohort"}, "compute": {"aggregation": "count", "metric": "__dd.retention_rate"}, "group_by": [{"facet": "@geo.country", "limit": 10, "should_exclude_missing": false, "sort": {"aggregation": "count", "order": "desc"}, "target": "cohort"}], "search": {"cohort_criteria": {"base_query": {"data_source": "product_analytics", "search": {"query": "@type:view"}}, "time_interval": {"type": "calendar", "value": {"alignment": "monday", "quantity": 1, "timezone": "UTC", "type": "week"}}}, "filters": {"audience_filters": {"accounts": [{"name": ""}], "formula": "u", "segments": [{"name": "", "segment_id": "00000000-0000-0000-0000-000000000000"}], "users": [{"name": "u", "query": "*"}]}}, "retention_entity": "@usr.id", "return_condition": "conversion_on_or_after", "return_criteria": {"base_query": {"data_source": "product_analytics", "search": {"query": "@type:view"}}, "time_interval": {"type": "calendar", "value": {"alignment": "monday", "quantity": 1, "timezone": "UTC", "type": "week"}}}}}, "to": 1756857600000}, "type": "formula_retention_request"}} + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/product-analytics-backend Scenario: Compute scalar analytics returns "Bad Request" response Given a valid "appKeyAuth" key in the system @@ -46,6 +172,60 @@ Feature: Product Analytics When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/product-analytics-backend + Scenario: List analytics events returns "Bad Request" response + Given a valid "appKeyAuth" key in the system + And operation "QueryProductAnalyticsList" enabled + And new "QueryProductAnalyticsList" request + And body with value {"data": {"attributes": {"from": 1771232048460, "query": {"columns": ["@view.name"], "limit": 100, "query": {"data_source": "product_analytics", "search": {"query": "@type:view"}}}, "to": 1771836848262}, "type": "formula_analytics_extended_list_request"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/product-analytics-backend + Scenario: List analytics events returns "OK" response + Given a valid "appKeyAuth" key in the system + And operation "QueryProductAnalyticsList" enabled + And new "QueryProductAnalyticsList" request + And body with value {"data": {"attributes": {"from": 1771232048460, "query": {"columns": ["@view.name"], "limit": 100, "query": {"data_source": "product_analytics", "search": {"query": "@type:view"}}}, "to": 1771836848262}, "type": "formula_analytics_extended_list_request"}} + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/product-analytics-backend + Scenario: List journey entities returns "Bad Request" response + Given a valid "appKeyAuth" key in the system + And operation "QueryProductAnalyticsJourneyList" enabled + And new "QueryProductAnalyticsJourneyList" request + And body with value {"data": {"attributes": {"from": 1756425600000, "query": {"computed_columns": [{"name": "first_conversion_timestamps"}], "conversion_type": "conversion", "entity_columns": [], "group_by": [{"facet": "@geo.country", "should_exclude_missing": false, "sort": {"aggregation": "count", "order": "desc"}, "source": "product_analytics_audience_filters.users", "target": {"type": "node", "value": "A"}, "value_filters": []}], "search": {"expression": "A -> B", "filters": {"audience_filters": {"accounts": [{"name": "enterprise_accounts"}], "formula": "power_users AND NOT trial_segment", "segments": [{"name": "trial_segment", "segment_id": "00000000-0000-0000-0000-000000000000"}], "users": [{"name": "power_users"}]}, "graph_filters": [{"name": "__dd.time_to_convert", "operator": "<=", "target": {"type": "node", "value": "A"}, "value": 60000}]}, "join_keys": {"primary": "@session.id", "secondary": []}, "node_objects": {"A": {"data_source": "product_analytics", "search": {"query": "@type:view @view.name:Login"}}, "B": {"data_source": "product_analytics", "search": {"query": "@type:action @action.target.name:Submit"}}}}, "sort": {"order": "desc"}, "target": {"type": "node", "value": "A"}}, "to": 1756857600000}, "type": "journey_list_request"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/product-analytics-backend + Scenario: List journey entities returns "OK" response + Given a valid "appKeyAuth" key in the system + And operation "QueryProductAnalyticsJourneyList" enabled + And new "QueryProductAnalyticsJourneyList" request + And body with value {"data": {"attributes": {"from": 1756425600000, "query": {"computed_columns": [{"name": "first_conversion_timestamps"}], "conversion_type": "conversion", "entity_columns": [], "group_by": [{"facet": "@geo.country", "should_exclude_missing": false, "sort": {"aggregation": "count", "order": "desc"}, "source": "product_analytics_audience_filters.users", "target": {"type": "node", "value": "A"}, "value_filters": []}], "search": {"expression": "A -> B", "filters": {"audience_filters": {"accounts": [{"name": "enterprise_accounts"}], "formula": "power_users AND NOT trial_segment", "segments": [{"name": "trial_segment", "segment_id": "00000000-0000-0000-0000-000000000000"}], "users": [{"name": "power_users"}]}, "graph_filters": [{"name": "__dd.time_to_convert", "operator": "<=", "target": {"type": "node", "value": "A"}, "value": 60000}]}, "join_keys": {"primary": "@session.id", "secondary": []}, "node_objects": {"A": {"data_source": "product_analytics", "search": {"query": "@type:view @view.name:Login"}}, "B": {"data_source": "product_analytics", "search": {"query": "@type:action @action.target.name:Submit"}}}}, "sort": {"order": "desc"}, "target": {"type": "node", "value": "A"}}, "to": 1756857600000}, "type": "journey_list_request"}} + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/product-analytics-backend + Scenario: List the entities behind a retention cell returns "Bad Request" response + Given a valid "appKeyAuth" key in the system + And operation "QueryProductAnalyticsRetentionList" enabled + And new "QueryProductAnalyticsRetentionList" request + And body with value {"data": {"attributes": {"from": 1756425600000, "query": {"columns": [{"field": {"path": "@usr.email"}}], "computation_scope": {"cohort_target": {"type": "index", "value": 0}, "return_period_target": {"type": "index", "value": 0}, "type": "cell"}, "limit": 100, "search": {"cohort_criteria": {"base_query": {"data_source": "product_analytics", "search": {"query": "@type:view"}}, "time_interval": {"type": "calendar", "value": {"alignment": "monday", "quantity": 1, "timezone": "UTC", "type": "week"}}}, "filters": {"audience_filters": {"accounts": [{"name": ""}], "formula": "u", "segments": [{"name": "", "segment_id": "00000000-0000-0000-0000-000000000000"}], "users": [{"name": "u", "query": "*"}]}}, "retention_entity": "@usr.id", "return_condition": "conversion_on_or_after", "return_criteria": {"base_query": {"data_source": "product_analytics", "search": {"query": "@type:view"}}, "time_interval": {"type": "calendar", "value": {"alignment": "monday", "quantity": 1, "timezone": "UTC", "type": "week"}}}}}, "to": 1756857600000}, "type": "retention_list_request"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/product-analytics-backend + Scenario: List the entities behind a retention cell returns "OK" response + Given a valid "appKeyAuth" key in the system + And operation "QueryProductAnalyticsRetentionList" enabled + And new "QueryProductAnalyticsRetentionList" request + And body with value {"data": {"attributes": {"from": 1756425600000, "query": {"columns": [{"field": {"path": "@usr.email"}}], "computation_scope": {"cohort_target": {"type": "index", "value": 0}, "return_period_target": {"type": "index", "value": 0}, "type": "cell"}, "limit": 100, "search": {"cohort_criteria": {"base_query": {"data_source": "product_analytics", "search": {"query": "@type:view"}}, "time_interval": {"type": "calendar", "value": {"alignment": "monday", "quantity": 1, "timezone": "UTC", "type": "week"}}}, "filters": {"audience_filters": {"accounts": [{"name": ""}], "formula": "u", "segments": [{"name": "", "segment_id": "00000000-0000-0000-0000-000000000000"}], "users": [{"name": "u", "query": "*"}]}}, "retention_entity": "@usr.id", "return_condition": "conversion_on_or_after", "return_criteria": {"base_query": {"data_source": "product_analytics", "search": {"query": "@type:view"}}, "time_interval": {"type": "calendar", "value": {"alignment": "monday", "quantity": 1, "timezone": "UTC", "type": "week"}}}}}, "to": 1756857600000}, "type": "retention_list_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 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 b0bc955911d..b10abaebef6 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 @@ -6357,6 +6357,12 @@ "type": "unsafe" } }, + "QueryProductAnalyticsList": { + "tag": "Product Analytics", + "undo": { + "type": "safe" + } + }, "QueryProductAnalyticsScalar": { "tag": "Product Analytics", "undo": { @@ -6369,6 +6375,60 @@ "type": "safe" } }, + "QueryProductAnalyticsJourneyFunnel": { + "tag": "Product Analytics", + "undo": { + "type": "safe" + } + }, + "QueryProductAnalyticsJourneyList": { + "tag": "Product Analytics", + "undo": { + "type": "safe" + } + }, + "QueryProductAnalyticsJourneyScalar": { + "tag": "Product Analytics", + "undo": { + "type": "safe" + } + }, + "QueryProductAnalyticsJourneyTimeseries": { + "tag": "Product Analytics", + "undo": { + "type": "safe" + } + }, + "QueryProductAnalyticsRetentionGrid": { + "tag": "Product Analytics", + "undo": { + "type": "safe" + } + }, + "QueryProductAnalyticsRetentionList": { + "tag": "Product Analytics", + "undo": { + "type": "safe" + } + }, + "QueryProductAnalyticsRetentionScalar": { + "tag": "Product Analytics", + "undo": { + "type": "safe" + } + }, + "QueryProductAnalyticsRetentionTimeseries": { + "tag": "Product Analytics", + "undo": { + "type": "safe" + } + }, + "QueryProductAnalyticsSankey": { + "tag": "Product Analytics", + "undo": { + "type": "safe" + } + }, "QueryEventFilteredUsers": { "tag": "Rum Audience Management", "undo": {