diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 4857ca25ab3d..e2256f32bd5a 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -48138,6 +48138,430 @@ components: type: string x-enum-varnames: - PROCESS + ProductAnalyticsAnalyticsQuery: + description: The analytics query definition containing a base query, compute + rule, and optional grouping. + properties: + audience_filters: + $ref: '#/components/schemas/ProductAnalyticsAudienceFilters' + compute: + $ref: '#/components/schemas/ProductAnalyticsCompute' + group_by: + description: Group-by rules for segmenting results. + items: + $ref: '#/components/schemas/ProductAnalyticsGroupBy' + type: array + indexes: + description: Restrict the query to specific indexes. Max 1 entry. + items: + type: string + maxItems: 1 + type: array + query: + $ref: '#/components/schemas/ProductAnalyticsBaseQuery' + required: + - query + - compute + type: object + ProductAnalyticsAnalyticsRequest: + description: Request for computing analytics results (scalar or timeseries). + example: + data: + attributes: + from: 1771232048460 + query: + compute: + aggregation: count + query: + data_source: product_analytics + search: + query: '@type:view' + to: 1771836848262 + type: formula_analytics_extended_request + properties: + data: + $ref: '#/components/schemas/ProductAnalyticsAnalyticsRequestData' + required: + - data + type: object + ProductAnalyticsAnalyticsRequestAttributes: + description: Attributes for an analytics request. + properties: + enforced_execution_type: + $ref: '#/components/schemas/ProductAnalyticsExecutionType' + from: + description: Start time in epoch milliseconds. Must be less than `to`. + example: 1771232048460 + format: int64 + type: integer + query: + $ref: '#/components/schemas/ProductAnalyticsAnalyticsQuery' + request_id: + description: Optional request ID for multi-step query continuation. + type: string + to: + description: End time in epoch milliseconds. + example: 1771836848262 + format: int64 + type: integer + required: + - from + - to + - query + type: object + ProductAnalyticsAnalyticsRequestData: + description: Data object for an analytics request. + properties: + attributes: + $ref: '#/components/schemas/ProductAnalyticsAnalyticsRequestAttributes' + type: + $ref: '#/components/schemas/ProductAnalyticsAnalyticsRequestType' + required: + - type + - attributes + type: object + ProductAnalyticsAnalyticsRequestType: + description: The resource type for analytics requests. + enum: + - formula_analytics_extended_request + example: formula_analytics_extended_request + type: string + x-enum-varnames: + - FORMULA_ANALYTICS_EXTENDED_REQUEST + ProductAnalyticsAudienceAccountSubquery: + description: An account-based audience query. + properties: + name: + description: Name of this query, referenced in the formula. + example: '' + type: string + query: + description: Search query for filtering accounts. + type: string + required: + - name + type: object + ProductAnalyticsAudienceFilters: + description: Audience filter definitions for targeting specific user segments. + properties: + accounts: + description: Account audience queries. + items: + $ref: '#/components/schemas/ProductAnalyticsAudienceAccountSubquery' + type: array + formula: + description: Boolean formula combining audience queries by name. + example: u + type: string + segments: + description: Segment audience queries. + items: + $ref: '#/components/schemas/ProductAnalyticsAudienceSegmentSubquery' + type: array + users: + description: User audience queries. + items: + $ref: '#/components/schemas/ProductAnalyticsAudienceUserSubquery' + type: array + type: object + ProductAnalyticsAudienceSegmentSubquery: + description: A segment-based audience query. + properties: + name: + description: Name of this query, referenced in the formula. + example: '' + type: string + segment_id: + description: UUID of the segment to filter by. + example: '' + format: uuid + type: string + required: + - name + - segment_id + type: object + ProductAnalyticsAudienceUserSubquery: + description: A user-based audience query. + properties: + name: + description: Name of this query, referenced in the formula. + example: u + type: string + query: + description: Search query for filtering users. + example: '*' + type: string + required: + - name + type: object + ProductAnalyticsBaseQuery: + description: 'A query definition discriminated by the `data_source` field. + + Use `product_analytics` for standard event queries, or + + `product_analytics_occurrence` for occurrence-filtered queries.' + oneOf: + - $ref: '#/components/schemas/ProductAnalyticsEventQuery' + - $ref: '#/components/schemas/ProductAnalyticsOccurrenceQuery' + ProductAnalyticsCompute: + description: A compute rule for aggregating data. + properties: + aggregation: + description: The aggregation function (count, cardinality, avg, sum, min, + max, etc.). + example: count + type: string + interval: + description: Time bucket size in milliseconds. Required for timeseries queries. + example: 3600000 + format: int64 + type: integer + metric: + description: The metric to aggregate on. Required for non-count aggregations. + example: '@session.time_spent' + type: string + required: + - aggregation + type: object + ProductAnalyticsEventQuery: + description: A standard Product Analytics event query. + properties: + data_source: + $ref: '#/components/schemas/ProductAnalyticsEventQueryDataSource' + search: + $ref: '#/components/schemas/ProductAnalyticsEventSearch' + required: + - data_source + - search + type: object + ProductAnalyticsEventQueryDataSource: + description: The data source identifier. + enum: + - product_analytics + example: product_analytics + type: string + x-enum-varnames: + - PRODUCT_ANALYTICS + ProductAnalyticsEventSearch: + description: Search parameters for an event query. + properties: + query: + description: The search query using Datadog search syntax. + example: '@type:view' + type: string + type: object + ProductAnalyticsExecutionType: + description: Override the query execution strategy. + enum: + - simple + - background + - trino-multistep + - materialized-view + type: string + x-enum-varnames: + - SIMPLE + - BACKGROUND + - TRINO_MULTISTEP + - MATERIALIZED_VIEW + ProductAnalyticsGroupBy: + description: A group-by rule for segmenting results by facet values. + properties: + facet: + description: The facet to group by. + example: '@view.name' + type: string + limit: + description: Maximum number of groups to return. + example: 10 + format: int64 + type: integer + should_exclude_missing: + default: false + description: Exclude results with missing facet values. + type: boolean + sort: + $ref: '#/components/schemas/ProductAnalyticsGroupBySort' + source: + description: The source for audience-filter-based group-by. + type: string + required: + - facet + type: object + ProductAnalyticsGroupBySort: + description: Sort configuration for group-by results. + properties: + aggregation: + description: The aggregation function to sort by. + example: count + type: string + metric: + description: The metric to sort by. + type: string + order: + $ref: '#/components/schemas/QuerySortOrder' + type: object + ProductAnalyticsInterval: + description: An interval definition in a timeseries response. + properties: + milliseconds: + format: int64 + type: integer + start_time: + format: int64 + type: integer + times: + items: + format: int64 + type: integer + type: array + type: + type: string + type: object + ProductAnalyticsOccurrenceFilter: + description: Filter for occurrence-based queries. + properties: + meta: + additionalProperties: + type: string + description: Additional metadata. + type: object + operator: + description: Comparison operator (=, >=, <=, >, <). + example: '>=' + type: string + value: + description: The occurrence count threshold as a string. + example: '1' + type: string + required: + - operator + - value + type: object + ProductAnalyticsOccurrenceQuery: + description: A Product Analytics occurrence-filtered query. + properties: + data_source: + $ref: '#/components/schemas/ProductAnalyticsOccurrenceQueryDataSource' + search: + $ref: '#/components/schemas/ProductAnalyticsOccurrenceSearch' + required: + - data_source + - search + type: object + ProductAnalyticsOccurrenceQueryDataSource: + description: The data source identifier for occurrence queries. + enum: + - product_analytics_occurrence + example: product_analytics_occurrence + type: string + x-enum-varnames: + - PRODUCT_ANALYTICS_OCCURRENCE + ProductAnalyticsOccurrenceSearch: + description: Search parameters for an occurrence query. + properties: + occurrences: + $ref: '#/components/schemas/ProductAnalyticsOccurrenceFilter' + query: + description: The search query using Datadog search syntax. + example: '@type:action' + type: string + type: object + ProductAnalyticsResponseMeta: + description: Metadata for a Product Analytics query response. + properties: + request_id: + type: string + status: + $ref: '#/components/schemas/ProductAnalyticsResponseMetaStatus' + type: object + ProductAnalyticsResponseMetaStatus: + enum: + - done + - running + - timeout + type: string + x-enum-varnames: + - DONE + - RUNNING + - TIMEOUT + ProductAnalyticsScalarColumn: + description: A column in a scalar response. + properties: + meta: + $ref: '#/components/schemas/ProductAnalyticsScalarColumnMeta' + name: + description: Column name (facet name for group-by, or "query"). + type: string + type: + $ref: '#/components/schemas/ProductAnalyticsScalarColumnType' + values: + description: Column values. + items: {} + type: array + type: object + ProductAnalyticsScalarColumnMeta: + properties: + unit: + items: + $ref: '#/components/schemas/ProductAnalyticsUnit' + nullable: true + type: array + type: object + ProductAnalyticsScalarColumnType: + description: Column type. + enum: + - number + - group + type: string + x-enum-varnames: + - NUMBER + - GROUP + ProductAnalyticsScalarResponse: + description: Response for a scalar analytics query. + properties: + data: + $ref: '#/components/schemas/ProductAnalyticsScalarResponseData' + meta: + $ref: '#/components/schemas/ProductAnalyticsResponseMeta' + type: object + ProductAnalyticsScalarResponseAttributes: + properties: + columns: + items: + $ref: '#/components/schemas/ProductAnalyticsScalarColumn' + type: array + type: object + ProductAnalyticsScalarResponseData: + description: Data object for a scalar response. + properties: + attributes: + $ref: '#/components/schemas/ProductAnalyticsScalarResponseAttributes' + id: + type: string + type: + $ref: '#/components/schemas/ProductAnalyticsScalarResponseType' + type: object + ProductAnalyticsScalarResponseType: + enum: + - scalar_response + type: string + x-enum-varnames: + - SCALAR_RESPONSE + ProductAnalyticsSerie: + description: A series in a timeseries response. + properties: + group_tags: + items: + type: string + type: array + query_index: + format: int64 + type: integer + unit: + items: + $ref: '#/components/schemas/ProductAnalyticsUnit' + type: array + type: object ProductAnalyticsServerSideEventError: description: Error details. properties: @@ -48246,6 +48670,75 @@ components: required: - id type: object + ProductAnalyticsTimeseriesResponse: + description: Response for a timeseries analytics query. + properties: + data: + $ref: '#/components/schemas/ProductAnalyticsTimeseriesResponseData' + meta: + $ref: '#/components/schemas/ProductAnalyticsResponseMeta' + type: object + ProductAnalyticsTimeseriesResponseAttributes: + properties: + intervals: + items: + $ref: '#/components/schemas/ProductAnalyticsInterval' + type: array + series: + items: + $ref: '#/components/schemas/ProductAnalyticsSerie' + type: array + times: + description: Timestamps for each data point (epoch milliseconds). + items: + format: int64 + type: integer + type: array + values: + description: Values for each series at each time point. + items: + items: + format: double + nullable: true + type: number + type: array + type: array + type: object + ProductAnalyticsTimeseriesResponseData: + properties: + attributes: + $ref: '#/components/schemas/ProductAnalyticsTimeseriesResponseAttributes' + id: + type: string + type: + $ref: '#/components/schemas/ProductAnalyticsTimeseriesResponseType' + type: object + ProductAnalyticsTimeseriesResponseType: + enum: + - timeseries_response + type: string + x-enum-varnames: + - TIMESERIES_RESPONSE + ProductAnalyticsUnit: + description: A unit definition for metric values. + properties: + family: + example: time + type: string + id: + format: int64 + type: integer + name: + example: nanosecond + type: string + plural: + type: string + scale_factor: + format: double + type: number + short_name: + type: string + type: object Project: description: A Project properties: @@ -92643,6 +93136,75 @@ paths: tags: - Rum Audience Management x-unstable: '**Note**: This endpoint may be subject to changes.' + /api/v2/product-analytics/analytics/scalar: + post: + description: 'Compute scalar analytics results for Product Analytics data. + + Returns aggregated values (counts, averages, percentiles) optionally grouped + by facets.' + operationId: QueryProductAnalyticsScalar + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ProductAnalyticsAnalyticsRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ProductAnalyticsScalarResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/NotAuthorizedResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Compute scalar analytics + tags: + - Product Analytics + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - rum_apps_read + /api/v2/product-analytics/analytics/timeseries: + post: + description: 'Compute timeseries analytics results for Product Analytics data. + + Returns time-bucketed values for charts and trend analysis. + + The `compute.interval` field (milliseconds) is required for time bucketing.' + operationId: QueryProductAnalyticsTimeseries + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ProductAnalyticsAnalyticsRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ProductAnalyticsTimeseriesResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/NotAuthorizedResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Compute timeseries analytics + tags: + - Product Analytics + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - rum_apps_read /api/v2/product-analytics/users/event_filtered_query: post: description: Query users filtered by both user properties and event platform diff --git a/examples/v2/product-analytics/QueryProductAnalyticsScalar.rb b/examples/v2/product-analytics/QueryProductAnalyticsScalar.rb new file mode 100644 index 000000000000..02d79d1bc8f7 --- /dev/null +++ b/examples/v2/product-analytics/QueryProductAnalyticsScalar.rb @@ -0,0 +1,26 @@ +# Compute scalar analytics returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::ProductAnalyticsAPI.new + +body = DatadogAPIClient::V2::ProductAnalyticsAnalyticsRequest.new({ + data: DatadogAPIClient::V2::ProductAnalyticsAnalyticsRequestData.new({ + attributes: DatadogAPIClient::V2::ProductAnalyticsAnalyticsRequestAttributes.new({ + from: 1771232048460, + query: DatadogAPIClient::V2::ProductAnalyticsAnalyticsQuery.new({ + compute: DatadogAPIClient::V2::ProductAnalyticsCompute.new({ + aggregation: "count", + }), + query: DatadogAPIClient::V2::ProductAnalyticsEventQuery.new({ + data_source: DatadogAPIClient::V2::ProductAnalyticsEventQueryDataSource::PRODUCT_ANALYTICS, + search: DatadogAPIClient::V2::ProductAnalyticsEventSearch.new({ + query: "@type:view", + }), + }), + }), + to: 1771836848262, + }), + type: DatadogAPIClient::V2::ProductAnalyticsAnalyticsRequestType::FORMULA_ANALYTICS_EXTENDED_REQUEST, + }), +}) +p api_instance.query_product_analytics_scalar(body) diff --git a/examples/v2/product-analytics/QueryProductAnalyticsTimeseries.rb b/examples/v2/product-analytics/QueryProductAnalyticsTimeseries.rb new file mode 100644 index 000000000000..fc731272938e --- /dev/null +++ b/examples/v2/product-analytics/QueryProductAnalyticsTimeseries.rb @@ -0,0 +1,26 @@ +# Compute timeseries analytics returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::ProductAnalyticsAPI.new + +body = DatadogAPIClient::V2::ProductAnalyticsAnalyticsRequest.new({ + data: DatadogAPIClient::V2::ProductAnalyticsAnalyticsRequestData.new({ + attributes: DatadogAPIClient::V2::ProductAnalyticsAnalyticsRequestAttributes.new({ + from: 1771232048460, + query: DatadogAPIClient::V2::ProductAnalyticsAnalyticsQuery.new({ + compute: DatadogAPIClient::V2::ProductAnalyticsCompute.new({ + aggregation: "count", + }), + query: DatadogAPIClient::V2::ProductAnalyticsEventQuery.new({ + data_source: DatadogAPIClient::V2::ProductAnalyticsEventQueryDataSource::PRODUCT_ANALYTICS, + search: DatadogAPIClient::V2::ProductAnalyticsEventSearch.new({ + query: "@type:view", + }), + }), + }), + to: 1771836848262, + }), + type: DatadogAPIClient::V2::ProductAnalyticsAnalyticsRequestType::FORMULA_ANALYTICS_EXTENDED_REQUEST, + }), +}) +p api_instance.query_product_analytics_timeseries(body) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index a3adeb7f1492..b60fc7641ee8 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -3114,6 +3114,12 @@ "v2.SubmitProductAnalyticsEvent" => { "body" => "ProductAnalyticsServerSideEventItem", }, + "v2.QueryProductAnalyticsScalar" => { + "body" => "ProductAnalyticsAnalyticsRequest", + }, + "v2.QueryProductAnalyticsTimeseries" => { + "body" => "ProductAnalyticsAnalyticsRequest", + }, "v2.GetAccountFacetInfo" => { "body" => "FacetInfoRequest", }, diff --git a/features/v2/product_analytics.feature b/features/v2/product_analytics.feature index a915c2130412..3b59a3a0f644 100644 --- a/features/v2/product_analytics.feature +++ b/features/v2/product_analytics.feature @@ -11,25 +11,63 @@ Feature: Product Analytics Background: Given a valid "apiKeyAuth" key in the system And an instance of "ProductAnalytics" API - And new "SubmitProductAnalyticsEvent" request - And body with value {"account": {"id": "account-67890"}, "application": {"id": "123abcde-123a-123b-1234-123456789abc"}, "event": {"name": "payment.processed"}, "session": {"id": "session-abcdef"}, "type": "server", "usr": {"id": "user-12345"}} + + @generated @skip @team:DataDog/product-analytics-backend + Scenario: Compute scalar analytics returns "Bad Request" response + Given a valid "appKeyAuth" key in the system + And new "QueryProductAnalyticsScalar" request + And body with value {"data": {"attributes": {"from": 1771232048460, "query": {"compute": {"aggregation": "count"}, "query": {"data_source": "product_analytics", "search": {"query": "@type:view"}}}, "to": 1771836848262}, "type": "formula_analytics_extended_request"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/product-analytics-backend + Scenario: Compute scalar analytics returns "OK" response + Given a valid "appKeyAuth" key in the system + And new "QueryProductAnalyticsScalar" request + And body with value {"data": {"attributes": {"from": 1771232048460, "query": {"compute": {"aggregation": "count"}, "query": {"data_source": "product_analytics", "search": {"query": "@type:view"}}}, "to": 1771836848262}, "type": "formula_analytics_extended_request"}} + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/product-analytics-backend + Scenario: Compute timeseries analytics returns "Bad Request" response + Given a valid "appKeyAuth" key in the system + And new "QueryProductAnalyticsTimeseries" request + And body with value {"data": {"attributes": {"from": 1771232048460, "query": {"compute": {"aggregation": "count"}, "query": {"data_source": "product_analytics", "search": {"query": "@type:view"}}}, "to": 1771836848262}, "type": "formula_analytics_extended_request"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/product-analytics-backend + Scenario: Compute timeseries analytics returns "OK" response + Given a valid "appKeyAuth" key in the system + And new "QueryProductAnalyticsTimeseries" request + And body with value {"data": {"attributes": {"from": 1771232048460, "query": {"compute": {"aggregation": "count"}, "query": {"data_source": "product_analytics", "search": {"query": "@type:view"}}}, "to": 1771836848262}, "type": "formula_analytics_extended_request"}} + When the request is sent + Then the response status is 200 OK @generated @skip @team:DataDog/product-analytics-backend Scenario: Send server-side events returns "Bad Request" response + Given new "SubmitProductAnalyticsEvent" request + And body with value {"account": {"id": "account-67890"}, "application": {"id": "123abcde-123a-123b-1234-123456789abc"}, "event": {"name": "payment.processed"}, "session": {"id": "session-abcdef"}, "type": "server", "usr": {"id": "user-12345"}} When the request is sent Then the response status is 400 Bad Request @generated @skip @team:DataDog/product-analytics-backend Scenario: Send server-side events returns "Payload Too Large" response + Given new "SubmitProductAnalyticsEvent" request + And body with value {"account": {"id": "account-67890"}, "application": {"id": "123abcde-123a-123b-1234-123456789abc"}, "event": {"name": "payment.processed"}, "session": {"id": "session-abcdef"}, "type": "server", "usr": {"id": "user-12345"}} When the request is sent Then the response status is 413 Payload Too Large @generated @skip @team:DataDog/product-analytics-backend Scenario: Send server-side events returns "Request Timeout" response + Given new "SubmitProductAnalyticsEvent" request + And body with value {"account": {"id": "account-67890"}, "application": {"id": "123abcde-123a-123b-1234-123456789abc"}, "event": {"name": "payment.processed"}, "session": {"id": "session-abcdef"}, "type": "server", "usr": {"id": "user-12345"}} When the request is sent Then the response status is 408 Request Timeout @generated @skip @team:DataDog/product-analytics-backend Scenario: Send server-side events returns "Request accepted for processing (always 202 empty JSON)." response + Given new "SubmitProductAnalyticsEvent" request + And body with value {"account": {"id": "account-67890"}, "application": {"id": "123abcde-123a-123b-1234-123456789abc"}, "event": {"name": "payment.processed"}, "session": {"id": "session-abcdef"}, "type": "server", "usr": {"id": "user-12345"}} When the request is sent Then the response status is 202 Request accepted for processing (always 202 empty JSON). diff --git a/features/v2/undo.json b/features/v2/undo.json index 3b052977c20b..09186eef673c 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -3719,6 +3719,18 @@ "type": "unsafe" } }, + "QueryProductAnalyticsScalar": { + "tag": "Product Analytics", + "undo": { + "type": "safe" + } + }, + "QueryProductAnalyticsTimeseries": { + "tag": "Product Analytics", + "undo": { + "type": "safe" + } + }, "QueryEventFilteredUsers": { "tag": "Rum Audience Management", "undo": { diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index ce85a5f7467f..2b6e5fc02eed 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -3940,6 +3940,38 @@ def overrides "v2.process_summary" => "ProcessSummary", "v2.process_summary_attributes" => "ProcessSummaryAttributes", "v2.process_summary_type" => "ProcessSummaryType", + "v2.product_analytics_analytics_query" => "ProductAnalyticsAnalyticsQuery", + "v2.product_analytics_analytics_request" => "ProductAnalyticsAnalyticsRequest", + "v2.product_analytics_analytics_request_attributes" => "ProductAnalyticsAnalyticsRequestAttributes", + "v2.product_analytics_analytics_request_data" => "ProductAnalyticsAnalyticsRequestData", + "v2.product_analytics_analytics_request_type" => "ProductAnalyticsAnalyticsRequestType", + "v2.product_analytics_audience_account_subquery" => "ProductAnalyticsAudienceAccountSubquery", + "v2.product_analytics_audience_filters" => "ProductAnalyticsAudienceFilters", + "v2.product_analytics_audience_segment_subquery" => "ProductAnalyticsAudienceSegmentSubquery", + "v2.product_analytics_audience_user_subquery" => "ProductAnalyticsAudienceUserSubquery", + "v2.product_analytics_base_query" => "ProductAnalyticsBaseQuery", + "v2.product_analytics_compute" => "ProductAnalyticsCompute", + "v2.product_analytics_event_query" => "ProductAnalyticsEventQuery", + "v2.product_analytics_event_query_data_source" => "ProductAnalyticsEventQueryDataSource", + "v2.product_analytics_event_search" => "ProductAnalyticsEventSearch", + "v2.product_analytics_execution_type" => "ProductAnalyticsExecutionType", + "v2.product_analytics_group_by" => "ProductAnalyticsGroupBy", + "v2.product_analytics_group_by_sort" => "ProductAnalyticsGroupBySort", + "v2.product_analytics_interval" => "ProductAnalyticsInterval", + "v2.product_analytics_occurrence_filter" => "ProductAnalyticsOccurrenceFilter", + "v2.product_analytics_occurrence_query" => "ProductAnalyticsOccurrenceQuery", + "v2.product_analytics_occurrence_query_data_source" => "ProductAnalyticsOccurrenceQueryDataSource", + "v2.product_analytics_occurrence_search" => "ProductAnalyticsOccurrenceSearch", + "v2.product_analytics_response_meta" => "ProductAnalyticsResponseMeta", + "v2.product_analytics_response_meta_status" => "ProductAnalyticsResponseMetaStatus", + "v2.product_analytics_scalar_column" => "ProductAnalyticsScalarColumn", + "v2.product_analytics_scalar_column_meta" => "ProductAnalyticsScalarColumnMeta", + "v2.product_analytics_scalar_column_type" => "ProductAnalyticsScalarColumnType", + "v2.product_analytics_scalar_response" => "ProductAnalyticsScalarResponse", + "v2.product_analytics_scalar_response_attributes" => "ProductAnalyticsScalarResponseAttributes", + "v2.product_analytics_scalar_response_data" => "ProductAnalyticsScalarResponseData", + "v2.product_analytics_scalar_response_type" => "ProductAnalyticsScalarResponseType", + "v2.product_analytics_serie" => "ProductAnalyticsSerie", "v2.product_analytics_server_side_event_error" => "ProductAnalyticsServerSideEventError", "v2.product_analytics_server_side_event_errors" => "ProductAnalyticsServerSideEventErrors", "v2.product_analytics_server_side_event_item" => "ProductAnalyticsServerSideEventItem", @@ -3949,6 +3981,11 @@ def overrides "v2.product_analytics_server_side_event_item_session" => "ProductAnalyticsServerSideEventItemSession", "v2.product_analytics_server_side_event_item_type" => "ProductAnalyticsServerSideEventItemType", "v2.product_analytics_server_side_event_item_usr" => "ProductAnalyticsServerSideEventItemUsr", + "v2.product_analytics_timeseries_response" => "ProductAnalyticsTimeseriesResponse", + "v2.product_analytics_timeseries_response_attributes" => "ProductAnalyticsTimeseriesResponseAttributes", + "v2.product_analytics_timeseries_response_data" => "ProductAnalyticsTimeseriesResponseData", + "v2.product_analytics_timeseries_response_type" => "ProductAnalyticsTimeseriesResponseType", + "v2.product_analytics_unit" => "ProductAnalyticsUnit", "v2.project" => "Project", "v2.project_attributes" => "ProjectAttributes", "v2.project_columns_config" => "ProjectColumnsConfig", diff --git a/lib/datadog_api_client/v2/api/product_analytics_api.rb b/lib/datadog_api_client/v2/api/product_analytics_api.rb index 1c2ba60db287..c0f5f81beecd 100644 --- a/lib/datadog_api_client/v2/api/product_analytics_api.rb +++ b/lib/datadog_api_client/v2/api/product_analytics_api.rb @@ -23,6 +23,143 @@ def initialize(api_client = DatadogAPIClient::APIClient.default) @api_client = api_client end + # Compute scalar analytics. + # + # @see #query_product_analytics_scalar_with_http_info + def query_product_analytics_scalar(body, opts = {}) + data, _status_code, _headers = query_product_analytics_scalar_with_http_info(body, opts) + data + end + + # Compute scalar analytics. + # + # Compute scalar analytics results for Product Analytics data. + # Returns aggregated values (counts, averages, percentiles) optionally grouped by facets. + # + # @param body [ProductAnalyticsAnalyticsRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(ProductAnalyticsScalarResponse, Integer, Hash)>] ProductAnalyticsScalarResponse data, response status code and response headers + def query_product_analytics_scalar_with_http_info(body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ProductAnalyticsAPI.query_product_analytics_scalar ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling ProductAnalyticsAPI.query_product_analytics_scalar" + end + # resource path + local_var_path = '/api/v2/product-analytics/analytics/scalar' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'ProductAnalyticsScalarResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :query_product_analytics_scalar, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ProductAnalyticsAPI#query_product_analytics_scalar\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Compute timeseries analytics. + # + # @see #query_product_analytics_timeseries_with_http_info + def query_product_analytics_timeseries(body, opts = {}) + data, _status_code, _headers = query_product_analytics_timeseries_with_http_info(body, opts) + data + end + + # Compute timeseries analytics. + # + # Compute timeseries analytics results for Product Analytics data. + # Returns time-bucketed values for charts and trend analysis. + # The `compute.interval` field (milliseconds) is required for time bucketing. + # + # @param body [ProductAnalyticsAnalyticsRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(ProductAnalyticsTimeseriesResponse, Integer, Hash)>] ProductAnalyticsTimeseriesResponse data, response status code and response headers + def query_product_analytics_timeseries_with_http_info(body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ProductAnalyticsAPI.query_product_analytics_timeseries ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling ProductAnalyticsAPI.query_product_analytics_timeseries" + end + # resource path + local_var_path = '/api/v2/product-analytics/analytics/timeseries' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'ProductAnalyticsTimeseriesResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :query_product_analytics_timeseries, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ProductAnalyticsAPI#query_product_analytics_timeseries\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Send server-side events. # # @see #submit_product_analytics_event_with_http_info diff --git a/lib/datadog_api_client/v2/models/product_analytics_analytics_query.rb b/lib/datadog_api_client/v2/models/product_analytics_analytics_query.rb new file mode 100644 index 000000000000..4dbd1a5bc755 --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_analytics_query.rb @@ -0,0 +1,191 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The analytics query definition containing a base query, compute rule, and optional grouping. + class ProductAnalyticsAnalyticsQuery + include BaseGenericModel + + # Audience filter definitions for targeting specific user segments. + attr_accessor :audience_filters + + # A compute rule for aggregating data. + attr_reader :compute + + # Group-by rules for segmenting results. + attr_accessor :group_by + + # Restrict the query to specific indexes. Max 1 entry. + attr_reader :indexes + + # A query definition discriminated by the `data_source` field. + # Use `product_analytics` for standard event queries, or + # `product_analytics_occurrence` for occurrence-filtered queries. + attr_reader :query + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'audience_filters' => :'audience_filters', + :'compute' => :'compute', + :'group_by' => :'group_by', + :'indexes' => :'indexes', + :'query' => :'query' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'audience_filters' => :'ProductAnalyticsAudienceFilters', + :'compute' => :'ProductAnalyticsCompute', + :'group_by' => :'Array', + :'indexes' => :'Array', + :'query' => :'ProductAnalyticsBaseQuery' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProductAnalyticsAnalyticsQuery` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'audience_filters') + self.audience_filters = attributes[:'audience_filters'] + end + + if attributes.key?(:'compute') + self.compute = attributes[:'compute'] + end + + if attributes.key?(:'group_by') + if (value = attributes[:'group_by']).is_a?(Array) + self.group_by = value + end + end + + if attributes.key?(:'indexes') + if (value = attributes[:'indexes']).is_a?(Array) + self.indexes = value + end + end + + if attributes.key?(:'query') + self.query = attributes[:'query'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @compute.nil? + return false if !@indexes.nil? && @indexes.length > 1 + return false if @query.nil? + true + end + + # Custom attribute writer method with validation + # @param compute [Object] Object to be assigned + # @!visibility private + def compute=(compute) + if compute.nil? + fail ArgumentError, 'invalid value for "compute", compute cannot be nil.' + end + @compute = compute + end + + # Custom attribute writer method with validation + # @param indexes [Object] Object to be assigned + # @!visibility private + def indexes=(indexes) + if !indexes.nil? && indexes.length > 1 + fail ArgumentError, 'invalid value for "indexes", number of items must be less than or equal to 1.' + end + @indexes = indexes + end + + # Custom attribute writer method with validation + # @param query [Object] Object to be assigned + # @!visibility private + def query=(query) + if query.nil? + fail ArgumentError, 'invalid value for "query", query cannot be nil.' + end + @query = query + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + audience_filters == o.audience_filters && + compute == o.compute && + group_by == o.group_by && + indexes == o.indexes && + query == o.query && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [audience_filters, compute, group_by, indexes, query, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_analytics_request.rb b/lib/datadog_api_client/v2/models/product_analytics_analytics_request.rb new file mode 100644 index 000000000000..167df85f8401 --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_analytics_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request for computing analytics results (scalar or timeseries). + class ProductAnalyticsAnalyticsRequest + include BaseGenericModel + + # Data object for an analytics request. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'ProductAnalyticsAnalyticsRequestData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProductAnalyticsAnalyticsRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_analytics_request_attributes.rb b/lib/datadog_api_client/v2/models/product_analytics_analytics_request_attributes.rb new file mode 100644 index 000000000000..7e3d8bb6fbf6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_analytics_request_attributes.rb @@ -0,0 +1,185 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes for an analytics request. + class ProductAnalyticsAnalyticsRequestAttributes + include BaseGenericModel + + # Override the query execution strategy. + attr_accessor :enforced_execution_type + + # Start time in epoch milliseconds. Must be less than `to`. + attr_reader :from + + # The analytics query definition containing a base query, compute rule, and optional grouping. + attr_reader :query + + # Optional request ID for multi-step query continuation. + attr_accessor :request_id + + # End time in epoch milliseconds. + attr_reader :to + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'enforced_execution_type' => :'enforced_execution_type', + :'from' => :'from', + :'query' => :'query', + :'request_id' => :'request_id', + :'to' => :'to' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'enforced_execution_type' => :'ProductAnalyticsExecutionType', + :'from' => :'Integer', + :'query' => :'ProductAnalyticsAnalyticsQuery', + :'request_id' => :'String', + :'to' => :'Integer' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProductAnalyticsAnalyticsRequestAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'enforced_execution_type') + self.enforced_execution_type = attributes[:'enforced_execution_type'] + end + + if attributes.key?(:'from') + self.from = attributes[:'from'] + end + + if attributes.key?(:'query') + self.query = attributes[:'query'] + end + + if attributes.key?(:'request_id') + self.request_id = attributes[:'request_id'] + end + + if attributes.key?(:'to') + self.to = attributes[:'to'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @from.nil? + return false if @query.nil? + return false if @to.nil? + true + end + + # Custom attribute writer method with validation + # @param from [Object] Object to be assigned + # @!visibility private + def from=(from) + if from.nil? + fail ArgumentError, 'invalid value for "from", from cannot be nil.' + end + @from = from + end + + # Custom attribute writer method with validation + # @param query [Object] Object to be assigned + # @!visibility private + def query=(query) + if query.nil? + fail ArgumentError, 'invalid value for "query", query cannot be nil.' + end + @query = query + end + + # Custom attribute writer method with validation + # @param to [Object] Object to be assigned + # @!visibility private + def to=(to) + if to.nil? + fail ArgumentError, 'invalid value for "to", to cannot be nil.' + end + @to = to + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + enforced_execution_type == o.enforced_execution_type && + from == o.from && + query == o.query && + request_id == o.request_id && + to == o.to && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [enforced_execution_type, from, query, request_id, to, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_analytics_request_data.rb b/lib/datadog_api_client/v2/models/product_analytics_analytics_request_data.rb new file mode 100644 index 000000000000..43a9e1dbf238 --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_analytics_request_data.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data object for an analytics request. + class ProductAnalyticsAnalyticsRequestData + include BaseGenericModel + + # Attributes for an analytics request. + attr_reader :attributes + + # The resource type for analytics requests. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'ProductAnalyticsAnalyticsRequestAttributes', + :'type' => :'ProductAnalyticsAnalyticsRequestType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProductAnalyticsAnalyticsRequestData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_analytics_request_type.rb b/lib/datadog_api_client/v2/models/product_analytics_analytics_request_type.rb new file mode 100644 index 000000000000..ad3eed8c5bfa --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_analytics_request_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The resource type for analytics requests. + class ProductAnalyticsAnalyticsRequestType + include BaseEnumModel + + FORMULA_ANALYTICS_EXTENDED_REQUEST = "formula_analytics_extended_request".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_audience_account_subquery.rb b/lib/datadog_api_client/v2/models/product_analytics_audience_account_subquery.rb new file mode 100644 index 000000000000..a4981717c27a --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_audience_account_subquery.rb @@ -0,0 +1,133 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # An account-based audience query. + class ProductAnalyticsAudienceAccountSubquery + include BaseGenericModel + + # Name of this query, referenced in the formula. + attr_reader :name + + # Search query for filtering accounts. + attr_accessor :query + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'name' => :'name', + :'query' => :'query' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'name' => :'String', + :'query' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProductAnalyticsAudienceAccountSubquery` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'query') + self.query = attributes[:'query'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @name.nil? + true + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + name == o.name && + query == o.query && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [name, query, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_audience_filters.rb b/lib/datadog_api_client/v2/models/product_analytics_audience_filters.rb new file mode 100644 index 000000000000..b587f6443fe2 --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_audience_filters.rb @@ -0,0 +1,141 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Audience filter definitions for targeting specific user segments. + class ProductAnalyticsAudienceFilters + include BaseGenericModel + + # Account audience queries. + attr_accessor :accounts + + # Boolean formula combining audience queries by name. + attr_accessor :formula + + # Segment audience queries. + attr_accessor :segments + + # User audience queries. + attr_accessor :users + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'accounts' => :'accounts', + :'formula' => :'formula', + :'segments' => :'segments', + :'users' => :'users' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'accounts' => :'Array', + :'formula' => :'String', + :'segments' => :'Array', + :'users' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProductAnalyticsAudienceFilters` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'accounts') + if (value = attributes[:'accounts']).is_a?(Array) + self.accounts = value + end + end + + if attributes.key?(:'formula') + self.formula = attributes[:'formula'] + end + + if attributes.key?(:'segments') + if (value = attributes[:'segments']).is_a?(Array) + self.segments = value + end + end + + if attributes.key?(:'users') + if (value = attributes[:'users']).is_a?(Array) + self.users = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + accounts == o.accounts && + formula == o.formula && + segments == o.segments && + users == o.users && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [accounts, formula, segments, users, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_audience_segment_subquery.rb b/lib/datadog_api_client/v2/models/product_analytics_audience_segment_subquery.rb new file mode 100644 index 000000000000..4598d63f666b --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_audience_segment_subquery.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A segment-based audience query. + class ProductAnalyticsAudienceSegmentSubquery + include BaseGenericModel + + # Name of this query, referenced in the formula. + attr_reader :name + + # UUID of the segment to filter by. + attr_reader :segment_id + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'name' => :'name', + :'segment_id' => :'segment_id' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'name' => :'String', + :'segment_id' => :'UUID' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProductAnalyticsAudienceSegmentSubquery` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'segment_id') + self.segment_id = attributes[:'segment_id'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @name.nil? + return false if @segment_id.nil? + true + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Custom attribute writer method with validation + # @param segment_id [Object] Object to be assigned + # @!visibility private + def segment_id=(segment_id) + if segment_id.nil? + fail ArgumentError, 'invalid value for "segment_id", segment_id cannot be nil.' + end + @segment_id = segment_id + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + name == o.name && + segment_id == o.segment_id && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [name, segment_id, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_audience_user_subquery.rb b/lib/datadog_api_client/v2/models/product_analytics_audience_user_subquery.rb new file mode 100644 index 000000000000..a88bc7fcb458 --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_audience_user_subquery.rb @@ -0,0 +1,133 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A user-based audience query. + class ProductAnalyticsAudienceUserSubquery + include BaseGenericModel + + # Name of this query, referenced in the formula. + attr_reader :name + + # Search query for filtering users. + attr_accessor :query + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'name' => :'name', + :'query' => :'query' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'name' => :'String', + :'query' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProductAnalyticsAudienceUserSubquery` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'query') + self.query = attributes[:'query'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @name.nil? + true + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + name == o.name && + query == o.query && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [name, query, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_base_query.rb b/lib/datadog_api_client/v2/models/product_analytics_base_query.rb new file mode 100644 index 000000000000..55f7ef28cfbe --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_base_query.rb @@ -0,0 +1,65 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A query definition discriminated by the `data_source` field. + # Use `product_analytics` for standard event queries, or + # `product_analytics_occurrence` for occurrence-filtered queries. + module ProductAnalyticsBaseQuery + class << self + include BaseOneOfModel + include BaseOneOfModelNoDiscriminator + + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'ProductAnalyticsEventQuery', + :'ProductAnalyticsOccurrenceQuery' + ] + end + # Builds the object + # @param data [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass| + begin + next if klass == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass, data) + next if typed_data.respond_to?(:_unparsed) && typed_data._unparsed + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + if openapi_one_of.include?(:AnyType) + data + else + self._unparsed = true + DatadogAPIClient::UnparsedObject.new(data) + end + end + end + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_compute.rb b/lib/datadog_api_client/v2/models/product_analytics_compute.rb new file mode 100644 index 000000000000..64f694fa17a3 --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_compute.rb @@ -0,0 +1,143 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A compute rule for aggregating data. + class ProductAnalyticsCompute + include BaseGenericModel + + # The aggregation function (count, cardinality, avg, sum, min, max, etc.). + attr_reader :aggregation + + # Time bucket size in milliseconds. Required for timeseries queries. + attr_accessor :interval + + # The metric to aggregate on. Required for non-count aggregations. + attr_accessor :metric + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'aggregation' => :'aggregation', + :'interval' => :'interval', + :'metric' => :'metric' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'aggregation' => :'String', + :'interval' => :'Integer', + :'metric' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProductAnalyticsCompute` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'aggregation') + self.aggregation = attributes[:'aggregation'] + end + + if attributes.key?(:'interval') + self.interval = attributes[:'interval'] + end + + if attributes.key?(:'metric') + self.metric = attributes[:'metric'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @aggregation.nil? + true + end + + # Custom attribute writer method with validation + # @param aggregation [Object] Object to be assigned + # @!visibility private + def aggregation=(aggregation) + if aggregation.nil? + fail ArgumentError, 'invalid value for "aggregation", aggregation cannot be nil.' + end + @aggregation = aggregation + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + aggregation == o.aggregation && + interval == o.interval && + metric == o.metric && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [aggregation, interval, metric, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_event_query.rb b/lib/datadog_api_client/v2/models/product_analytics_event_query.rb new file mode 100644 index 000000000000..dda55d7506f9 --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_event_query.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A standard Product Analytics event query. + class ProductAnalyticsEventQuery + include BaseGenericModel + + # The data source identifier. + attr_reader :data_source + + # Search parameters for an event query. + attr_reader :search + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data_source' => :'data_source', + :'search' => :'search' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data_source' => :'ProductAnalyticsEventQueryDataSource', + :'search' => :'ProductAnalyticsEventSearch' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProductAnalyticsEventQuery` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data_source') + self.data_source = attributes[:'data_source'] + end + + if attributes.key?(:'search') + self.search = attributes[:'search'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data_source.nil? + return false if @search.nil? + true + end + + # Custom attribute writer method with validation + # @param data_source [Object] Object to be assigned + # @!visibility private + def data_source=(data_source) + if data_source.nil? + fail ArgumentError, 'invalid value for "data_source", data_source cannot be nil.' + end + @data_source = data_source + end + + # Custom attribute writer method with validation + # @param search [Object] Object to be assigned + # @!visibility private + def search=(search) + if search.nil? + fail ArgumentError, 'invalid value for "search", search cannot be nil.' + end + @search = search + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data_source == o.data_source && + search == o.search && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data_source, search, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_event_query_data_source.rb b/lib/datadog_api_client/v2/models/product_analytics_event_query_data_source.rb new file mode 100644 index 000000000000..8dfdeb0ed31b --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_event_query_data_source.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The data source identifier. + class ProductAnalyticsEventQueryDataSource + include BaseEnumModel + + PRODUCT_ANALYTICS = "product_analytics".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_event_search.rb b/lib/datadog_api_client/v2/models/product_analytics_event_search.rb new file mode 100644 index 000000000000..574204d1117b --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_event_search.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Search parameters for an event query. + class ProductAnalyticsEventSearch + include BaseGenericModel + + # The search query using Datadog search syntax. + attr_accessor :query + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'query' => :'query' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'query' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProductAnalyticsEventSearch` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'query') + self.query = attributes[:'query'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + query == o.query && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [query, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_execution_type.rb b/lib/datadog_api_client/v2/models/product_analytics_execution_type.rb new file mode 100644 index 000000000000..96d055383ca4 --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_execution_type.rb @@ -0,0 +1,29 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Override the query execution strategy. + class ProductAnalyticsExecutionType + include BaseEnumModel + + SIMPLE = "simple".freeze + BACKGROUND = "background".freeze + TRINO_MULTISTEP = "trino-multistep".freeze + MATERIALIZED_VIEW = "materialized-view".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_group_by.rb b/lib/datadog_api_client/v2/models/product_analytics_group_by.rb new file mode 100644 index 000000000000..d5b687756e3f --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_group_by.rb @@ -0,0 +1,163 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A group-by rule for segmenting results by facet values. + class ProductAnalyticsGroupBy + include BaseGenericModel + + # The facet to group by. + attr_reader :facet + + # Maximum number of groups to return. + attr_accessor :limit + + # Exclude results with missing facet values. + attr_accessor :should_exclude_missing + + # Sort configuration for group-by results. + attr_accessor :sort + + # The source for audience-filter-based group-by. + attr_accessor :source + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'facet' => :'facet', + :'limit' => :'limit', + :'should_exclude_missing' => :'should_exclude_missing', + :'sort' => :'sort', + :'source' => :'source' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'facet' => :'String', + :'limit' => :'Integer', + :'should_exclude_missing' => :'Boolean', + :'sort' => :'ProductAnalyticsGroupBySort', + :'source' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProductAnalyticsGroupBy` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'facet') + self.facet = attributes[:'facet'] + end + + if attributes.key?(:'limit') + self.limit = attributes[:'limit'] + end + + if attributes.key?(:'should_exclude_missing') + self.should_exclude_missing = attributes[:'should_exclude_missing'] + end + + if attributes.key?(:'sort') + self.sort = attributes[:'sort'] + end + + if attributes.key?(:'source') + self.source = attributes[:'source'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @facet.nil? + true + end + + # Custom attribute writer method with validation + # @param facet [Object] Object to be assigned + # @!visibility private + def facet=(facet) + if facet.nil? + fail ArgumentError, 'invalid value for "facet", facet cannot be nil.' + end + @facet = facet + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + facet == o.facet && + limit == o.limit && + should_exclude_missing == o.should_exclude_missing && + sort == o.sort && + source == o.source && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [facet, limit, should_exclude_missing, sort, source, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_group_by_sort.rb b/lib/datadog_api_client/v2/models/product_analytics_group_by_sort.rb new file mode 100644 index 000000000000..7a0a950e5db4 --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_group_by_sort.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Sort configuration for group-by results. + class ProductAnalyticsGroupBySort + include BaseGenericModel + + # The aggregation function to sort by. + attr_accessor :aggregation + + # The metric to sort by. + attr_accessor :metric + + # Direction of sort. + attr_accessor :order + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'aggregation' => :'aggregation', + :'metric' => :'metric', + :'order' => :'order' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'aggregation' => :'String', + :'metric' => :'String', + :'order' => :'QuerySortOrder' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProductAnalyticsGroupBySort` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'aggregation') + self.aggregation = attributes[:'aggregation'] + end + + if attributes.key?(:'metric') + self.metric = attributes[:'metric'] + end + + if attributes.key?(:'order') + self.order = attributes[:'order'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + aggregation == o.aggregation && + metric == o.metric && + order == o.order && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [aggregation, metric, order, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_interval.rb b/lib/datadog_api_client/v2/models/product_analytics_interval.rb new file mode 100644 index 000000000000..66062e6c6a9a --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_interval.rb @@ -0,0 +1,137 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # An interval definition in a timeseries response. + class ProductAnalyticsInterval + include BaseGenericModel + + # + attr_accessor :milliseconds + + # + attr_accessor :start_time + + # + attr_accessor :times + + # + attr_accessor :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'milliseconds' => :'milliseconds', + :'start_time' => :'start_time', + :'times' => :'times', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'milliseconds' => :'Integer', + :'start_time' => :'Integer', + :'times' => :'Array', + :'type' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProductAnalyticsInterval` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'milliseconds') + self.milliseconds = attributes[:'milliseconds'] + end + + if attributes.key?(:'start_time') + self.start_time = attributes[:'start_time'] + end + + if attributes.key?(:'times') + if (value = attributes[:'times']).is_a?(Array) + self.times = value + end + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + milliseconds == o.milliseconds && + start_time == o.start_time && + times == o.times && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [milliseconds, start_time, times, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_occurrence_filter.rb b/lib/datadog_api_client/v2/models/product_analytics_occurrence_filter.rb new file mode 100644 index 000000000000..31b6f511f6e2 --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_occurrence_filter.rb @@ -0,0 +1,154 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Filter for occurrence-based queries. + class ProductAnalyticsOccurrenceFilter + include BaseGenericModel + + # Additional metadata. + attr_accessor :meta + + # Comparison operator (=, >=, <=, >, <). + attr_reader :operator + + # The occurrence count threshold as a string. + attr_reader :value + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'meta' => :'meta', + :'operator' => :'operator', + :'value' => :'value' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'meta' => :'Hash', + :'operator' => :'String', + :'value' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProductAnalyticsOccurrenceFilter` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'meta') + self.meta = attributes[:'meta'] + end + + if attributes.key?(:'operator') + self.operator = attributes[:'operator'] + end + + if attributes.key?(:'value') + self.value = attributes[:'value'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @operator.nil? + return false if @value.nil? + true + end + + # Custom attribute writer method with validation + # @param operator [Object] Object to be assigned + # @!visibility private + def operator=(operator) + if operator.nil? + fail ArgumentError, 'invalid value for "operator", operator cannot be nil.' + end + @operator = operator + end + + # Custom attribute writer method with validation + # @param value [Object] Object to be assigned + # @!visibility private + def value=(value) + if value.nil? + fail ArgumentError, 'invalid value for "value", value cannot be nil.' + end + @value = value + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + meta == o.meta && + operator == o.operator && + value == o.value && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [meta, operator, value, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_occurrence_query.rb b/lib/datadog_api_client/v2/models/product_analytics_occurrence_query.rb new file mode 100644 index 000000000000..84629292aa46 --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_occurrence_query.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A Product Analytics occurrence-filtered query. + class ProductAnalyticsOccurrenceQuery + include BaseGenericModel + + # The data source identifier for occurrence queries. + attr_reader :data_source + + # Search parameters for an occurrence query. + attr_reader :search + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data_source' => :'data_source', + :'search' => :'search' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data_source' => :'ProductAnalyticsOccurrenceQueryDataSource', + :'search' => :'ProductAnalyticsOccurrenceSearch' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProductAnalyticsOccurrenceQuery` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data_source') + self.data_source = attributes[:'data_source'] + end + + if attributes.key?(:'search') + self.search = attributes[:'search'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data_source.nil? + return false if @search.nil? + true + end + + # Custom attribute writer method with validation + # @param data_source [Object] Object to be assigned + # @!visibility private + def data_source=(data_source) + if data_source.nil? + fail ArgumentError, 'invalid value for "data_source", data_source cannot be nil.' + end + @data_source = data_source + end + + # Custom attribute writer method with validation + # @param search [Object] Object to be assigned + # @!visibility private + def search=(search) + if search.nil? + fail ArgumentError, 'invalid value for "search", search cannot be nil.' + end + @search = search + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data_source == o.data_source && + search == o.search && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data_source, search, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_occurrence_query_data_source.rb b/lib/datadog_api_client/v2/models/product_analytics_occurrence_query_data_source.rb new file mode 100644 index 000000000000..89d17ef23ffe --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_occurrence_query_data_source.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The data source identifier for occurrence queries. + class ProductAnalyticsOccurrenceQueryDataSource + include BaseEnumModel + + PRODUCT_ANALYTICS_OCCURRENCE = "product_analytics_occurrence".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_occurrence_search.rb b/lib/datadog_api_client/v2/models/product_analytics_occurrence_search.rb new file mode 100644 index 000000000000..ccb833f0a527 --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_occurrence_search.rb @@ -0,0 +1,115 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Search parameters for an occurrence query. + class ProductAnalyticsOccurrenceSearch + include BaseGenericModel + + # Filter for occurrence-based queries. + attr_accessor :occurrences + + # The search query using Datadog search syntax. + attr_accessor :query + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'occurrences' => :'occurrences', + :'query' => :'query' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'occurrences' => :'ProductAnalyticsOccurrenceFilter', + :'query' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProductAnalyticsOccurrenceSearch` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'occurrences') + self.occurrences = attributes[:'occurrences'] + end + + if attributes.key?(:'query') + self.query = attributes[:'query'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + occurrences == o.occurrences && + query == o.query && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [occurrences, query, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_response_meta.rb b/lib/datadog_api_client/v2/models/product_analytics_response_meta.rb new file mode 100644 index 000000000000..46153afde939 --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_response_meta.rb @@ -0,0 +1,115 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Metadata for a Product Analytics query response. + class ProductAnalyticsResponseMeta + include BaseGenericModel + + # + attr_accessor :request_id + + # + attr_accessor :status + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'request_id' => :'request_id', + :'status' => :'status' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'request_id' => :'String', + :'status' => :'ProductAnalyticsResponseMetaStatus' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProductAnalyticsResponseMeta` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'request_id') + self.request_id = attributes[:'request_id'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + request_id == o.request_id && + status == o.status && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [request_id, status, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_response_meta_status.rb b/lib/datadog_api_client/v2/models/product_analytics_response_meta_status.rb new file mode 100644 index 000000000000..878a3eeb4673 --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_response_meta_status.rb @@ -0,0 +1,28 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # + class ProductAnalyticsResponseMetaStatus + include BaseEnumModel + + DONE = "done".freeze + RUNNING = "running".freeze + TIMEOUT = "timeout".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_scalar_column.rb b/lib/datadog_api_client/v2/models/product_analytics_scalar_column.rb new file mode 100644 index 000000000000..3e919ac637db --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_scalar_column.rb @@ -0,0 +1,137 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A column in a scalar response. + class ProductAnalyticsScalarColumn + include BaseGenericModel + + # + attr_accessor :meta + + # Column name (facet name for group-by, or "query"). + attr_accessor :name + + # Column type. + attr_accessor :type + + # Column values. + attr_accessor :values + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'meta' => :'meta', + :'name' => :'name', + :'type' => :'type', + :'values' => :'values' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'meta' => :'ProductAnalyticsScalarColumnMeta', + :'name' => :'String', + :'type' => :'ProductAnalyticsScalarColumnType', + :'values' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProductAnalyticsScalarColumn` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'meta') + self.meta = attributes[:'meta'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'values') + if (value = attributes[:'values']).is_a?(Array) + self.values = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + meta == o.meta && + name == o.name && + type == o.type && + values == o.values && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [meta, name, type, values, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_scalar_column_meta.rb b/lib/datadog_api_client/v2/models/product_analytics_scalar_column_meta.rb new file mode 100644 index 000000000000..9839c8a8fa10 --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_scalar_column_meta.rb @@ -0,0 +1,115 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # + class ProductAnalyticsScalarColumnMeta + include BaseGenericModel + + # + attr_accessor :unit + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'unit' => :'unit' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'unit' => :'Array' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'unit', + ]) + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProductAnalyticsScalarColumnMeta` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'unit') + if (value = attributes[:'unit']).is_a?(Array) + self.unit = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + unit == o.unit && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [unit, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_scalar_column_type.rb b/lib/datadog_api_client/v2/models/product_analytics_scalar_column_type.rb new file mode 100644 index 000000000000..9a5e173da4a7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_scalar_column_type.rb @@ -0,0 +1,27 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Column type. + class ProductAnalyticsScalarColumnType + include BaseEnumModel + + NUMBER = "number".freeze + GROUP = "group".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_scalar_response.rb b/lib/datadog_api_client/v2/models/product_analytics_scalar_response.rb new file mode 100644 index 000000000000..18ddd6266de7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_scalar_response.rb @@ -0,0 +1,115 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response for a scalar analytics query. + class ProductAnalyticsScalarResponse + include BaseGenericModel + + # Data object for a scalar response. + attr_accessor :data + + # Metadata for a Product Analytics query response. + attr_accessor :meta + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data', + :'meta' => :'meta' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'ProductAnalyticsScalarResponseData', + :'meta' => :'ProductAnalyticsResponseMeta' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProductAnalyticsScalarResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + + if attributes.key?(:'meta') + self.meta = attributes[:'meta'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + meta == o.meta && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, meta, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_scalar_response_attributes.rb b/lib/datadog_api_client/v2/models/product_analytics_scalar_response_attributes.rb new file mode 100644 index 000000000000..d9b524fc56a4 --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_scalar_response_attributes.rb @@ -0,0 +1,107 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # + class ProductAnalyticsScalarResponseAttributes + include BaseGenericModel + + # + attr_accessor :columns + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'columns' => :'columns' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'columns' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProductAnalyticsScalarResponseAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'columns') + if (value = attributes[:'columns']).is_a?(Array) + self.columns = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + columns == o.columns && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [columns, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_scalar_response_data.rb b/lib/datadog_api_client/v2/models/product_analytics_scalar_response_data.rb new file mode 100644 index 000000000000..ab7cc4e621f1 --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_scalar_response_data.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data object for a scalar response. + class ProductAnalyticsScalarResponseData + include BaseGenericModel + + # + attr_accessor :attributes + + # + attr_accessor :id + + # + attr_accessor :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'ProductAnalyticsScalarResponseAttributes', + :'id' => :'String', + :'type' => :'ProductAnalyticsScalarResponseType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProductAnalyticsScalarResponseData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_scalar_response_type.rb b/lib/datadog_api_client/v2/models/product_analytics_scalar_response_type.rb new file mode 100644 index 000000000000..107d3487f6c8 --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_scalar_response_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # + class ProductAnalyticsScalarResponseType + include BaseEnumModel + + SCALAR_RESPONSE = "scalar_response".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_serie.rb b/lib/datadog_api_client/v2/models/product_analytics_serie.rb new file mode 100644 index 000000000000..e4e374aeece2 --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_serie.rb @@ -0,0 +1,129 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A series in a timeseries response. + class ProductAnalyticsSerie + include BaseGenericModel + + # + attr_accessor :group_tags + + # + attr_accessor :query_index + + # + attr_accessor :unit + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'group_tags' => :'group_tags', + :'query_index' => :'query_index', + :'unit' => :'unit' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'group_tags' => :'Array', + :'query_index' => :'Integer', + :'unit' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProductAnalyticsSerie` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'group_tags') + if (value = attributes[:'group_tags']).is_a?(Array) + self.group_tags = value + end + end + + if attributes.key?(:'query_index') + self.query_index = attributes[:'query_index'] + end + + if attributes.key?(:'unit') + if (value = attributes[:'unit']).is_a?(Array) + self.unit = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + group_tags == o.group_tags && + query_index == o.query_index && + unit == o.unit && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [group_tags, query_index, unit, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_timeseries_response.rb b/lib/datadog_api_client/v2/models/product_analytics_timeseries_response.rb new file mode 100644 index 000000000000..28f5961cafca --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_timeseries_response.rb @@ -0,0 +1,115 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response for a timeseries analytics query. + class ProductAnalyticsTimeseriesResponse + include BaseGenericModel + + # + attr_accessor :data + + # Metadata for a Product Analytics query response. + attr_accessor :meta + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data', + :'meta' => :'meta' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'ProductAnalyticsTimeseriesResponseData', + :'meta' => :'ProductAnalyticsResponseMeta' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProductAnalyticsTimeseriesResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + + if attributes.key?(:'meta') + self.meta = attributes[:'meta'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + meta == o.meta && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, meta, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_timeseries_response_attributes.rb b/lib/datadog_api_client/v2/models/product_analytics_timeseries_response_attributes.rb new file mode 100644 index 000000000000..9daff362e7b8 --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_timeseries_response_attributes.rb @@ -0,0 +1,143 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # + class ProductAnalyticsTimeseriesResponseAttributes + include BaseGenericModel + + # + attr_accessor :intervals + + # + attr_accessor :series + + # Timestamps for each data point (epoch milliseconds). + attr_accessor :times + + # Values for each series at each time point. + attr_accessor :values + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'intervals' => :'intervals', + :'series' => :'series', + :'times' => :'times', + :'values' => :'values' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'intervals' => :'Array', + :'series' => :'Array', + :'times' => :'Array', + :'values' => :'Array>' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProductAnalyticsTimeseriesResponseAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'intervals') + if (value = attributes[:'intervals']).is_a?(Array) + self.intervals = value + end + end + + if attributes.key?(:'series') + if (value = attributes[:'series']).is_a?(Array) + self.series = value + end + end + + if attributes.key?(:'times') + if (value = attributes[:'times']).is_a?(Array) + self.times = value + end + end + + if attributes.key?(:'values') + if (value = attributes[:'values']).is_a?(Array) + self.values = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + intervals == o.intervals && + series == o.series && + times == o.times && + values == o.values && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [intervals, series, times, values, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_timeseries_response_data.rb b/lib/datadog_api_client/v2/models/product_analytics_timeseries_response_data.rb new file mode 100644 index 000000000000..60fdd2efb41f --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_timeseries_response_data.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # + class ProductAnalyticsTimeseriesResponseData + include BaseGenericModel + + # + attr_accessor :attributes + + # + attr_accessor :id + + # + attr_accessor :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'ProductAnalyticsTimeseriesResponseAttributes', + :'id' => :'String', + :'type' => :'ProductAnalyticsTimeseriesResponseType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProductAnalyticsTimeseriesResponseData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_timeseries_response_type.rb b/lib/datadog_api_client/v2/models/product_analytics_timeseries_response_type.rb new file mode 100644 index 000000000000..fbad1f153056 --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_timeseries_response_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # + class ProductAnalyticsTimeseriesResponseType + include BaseEnumModel + + TIMESERIES_RESPONSE = "timeseries_response".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_unit.rb b/lib/datadog_api_client/v2/models/product_analytics_unit.rb new file mode 100644 index 000000000000..5a97567a288a --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_unit.rb @@ -0,0 +1,155 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A unit definition for metric values. + class ProductAnalyticsUnit + include BaseGenericModel + + # + attr_accessor :family + + # + attr_accessor :id + + # + attr_accessor :name + + # + attr_accessor :plural + + # + attr_accessor :scale_factor + + # + attr_accessor :short_name + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'family' => :'family', + :'id' => :'id', + :'name' => :'name', + :'plural' => :'plural', + :'scale_factor' => :'scale_factor', + :'short_name' => :'short_name' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'family' => :'String', + :'id' => :'Integer', + :'name' => :'String', + :'plural' => :'String', + :'scale_factor' => :'Float', + :'short_name' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProductAnalyticsUnit` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'family') + self.family = attributes[:'family'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'plural') + self.plural = attributes[:'plural'] + end + + if attributes.key?(:'scale_factor') + self.scale_factor = attributes[:'scale_factor'] + end + + if attributes.key?(:'short_name') + self.short_name = attributes[:'short_name'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + family == o.family && + id == o.id && + name == o.name && + plural == o.plural && + scale_factor == o.scale_factor && + short_name == o.short_name && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [family, id, name, plural, scale_factor, short_name, additional_properties].hash + end + end +end