From f2c0e6dc56b0c107d36717055e80d0fa3e2070a4 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Wed, 29 Oct 2025 13:32:42 +0000 Subject: [PATCH] Regenerate client from commit aab7a0d of spec repo --- .generator/schemas/v2/openapi.yaml | 1378 +++++++++++++++++ features/v2/cohort.feature | 24 + features/v2/funnel.feature | 24 + features/v2/segments.feature | 30 + features/v2/undo.json | 48 + features/v2/user_flow.feature | 14 + packages/datadog-api-client/README.md | 4 + .../src/support/scenarios_model_mapping.ts | 48 + services/cohort/.yarnrc.yml | 1 + services/cohort/README.md | 44 + services/cohort/package.json | 43 + services/cohort/src/index.ts | 3 + services/cohort/src/v2/CohortApi.ts | 329 ++++ services/cohort/src/v2/index.ts | 38 + .../cohort/src/v2/models/APIErrorResponse.ts | 45 + .../cohort/src/v2/models/GetCohortRequest.ts | 40 + .../src/v2/models/GetCohortRequestData.ts | 52 + .../models/GetCohortRequestDataAttributes.ts | 66 + ...etCohortRequestDataAttributesDefinition.ts | 55 + ...DataAttributesDefinitionAudienceFilters.ts | 57 + ...sDefinitionAudienceFiltersAccountsItems.ts | 44 + ...sDefinitionAudienceFiltersSegmentsItems.ts | 45 + ...utesDefinitionAudienceFiltersUsersItems.ts | 44 + .../GetCohortRequestDataAttributesTime.ts | 45 + .../src/v2/models/GetCohortRequestDataType.ts | 3 + .../cohort/src/v2/models/GetCohortResponse.ts | 40 + .../src/v2/models/GetCohortResponseData.ts | 52 + .../models/GetCohortResponseDataAttributes.ts | 40 + ...ohortResponseDataAttributesCohortsItems.ts | 57 + ...seDataAttributesCohortsItemsValuesItems.ts | 63 + .../v2/models/GetCohortResponseDataType.ts | 3 + .../src/v2/models/GetCohortUsersRequest.ts | 40 + .../v2/models/GetCohortUsersRequestData.ts | 52 + .../GetCohortUsersRequestDataAttributes.ts | 67 + ...ortUsersRequestDataAttributesDefinition.ts | 66 + ...DataAttributesDefinitionAudienceFilters.ts | 57 + ...sDefinitionAudienceFiltersAccountsItems.ts | 44 + ...sDefinitionAudienceFiltersSegmentsItems.ts | 45 + ...utesDefinitionAudienceFiltersUsersItems.ts | 44 + ...GetCohortUsersRequestDataAttributesTime.ts | 45 + .../models/GetCohortUsersRequestDataType.ts | 5 + .../src/v2/models/GetCohortUsersResponse.ts | 40 + .../v2/models/GetCohortUsersResponseData.ts | 52 + .../GetCohortUsersResponseDataAttributes.ts | 40 + ...rtUsersResponseDataAttributesUsersItems.ts | 48 + .../models/GetCohortUsersResponseDataType.ts | 5 + services/cohort/src/v2/models/TypingInfo.ts | 84 + services/cohort/tsconfig.json | 28 + services/funnel/.yarnrc.yml | 1 + services/funnel/README.md | 44 + services/funnel/package.json | 43 + services/funnel/src/index.ts | 3 + services/funnel/src/v2/FunnelApi.ts | 331 ++++ services/funnel/src/v2/index.ts | 34 + .../funnel/src/v2/models/APIErrorResponse.ts | 45 + .../funnel/src/v2/models/FunnelRequest.ts | 40 + .../funnel/src/v2/models/FunnelRequestData.ts | 52 + .../v2/models/FunnelRequestDataAttributes.ts | 61 + .../FunnelRequestDataAttributesSearch.ts | 55 + ...elRequestDataAttributesSearchStepsItems.ts | 48 + .../models/FunnelRequestDataAttributesTime.ts | 45 + .../src/v2/models/FunnelRequestDataType.ts | 3 + .../funnel/src/v2/models/FunnelResponse.ts | 40 + .../src/v2/models/FunnelResponseData.ts | 52 + .../v2/models/FunnelResponseDataAttributes.ts | 58 + ...lResponseDataAttributesFunnelStepsItems.ts | 51 + .../src/v2/models/FunnelResponseDataType.ts | 3 + .../v2/models/FunnelResponseElapsedTime.ts | 69 + .../src/v2/models/FunnelSuggestionRequest.ts | 40 + .../v2/models/FunnelSuggestionRequestData.ts | 52 + .../FunnelSuggestionRequestDataAttributes.ts | 57 + ...elSuggestionRequestDataAttributesSearch.ts | 55 + ...onRequestDataAttributesSearchStepsItems.ts | 48 + ...ggestionRequestDataAttributesTermSearch.ts | 38 + ...nnelSuggestionRequestDataAttributesTime.ts | 45 + .../models/FunnelSuggestionRequestDataType.ts | 5 + .../src/v2/models/FunnelSuggestionResponse.ts | 40 + .../v2/models/FunnelSuggestionResponseData.ts | 52 + .../FunnelSuggestionResponseDataAttributes.ts | 46 + ...stionResponseDataAttributesActionsItems.ts | 38 + ...gestionResponseDataAttributesViewsItems.ts | 38 + .../FunnelSuggestionResponseDataType.ts | 5 + services/funnel/src/v2/models/TypingInfo.ts | 72 + services/funnel/tsconfig.json | 28 + services/segments/.yarnrc.yml | 1 + services/segments/README.md | 43 + services/segments/package.json | 43 + services/segments/src/index.ts | 3 + services/segments/src/v2/SegmentsApi.ts | 391 +++++ services/segments/src/v2/index.ts | 16 + .../src/v2/models/APIErrorResponse.ts | 45 + services/segments/src/v2/models/Segment.ts | 40 + .../segments/src/v2/models/SegmentArray.ts | 41 + .../segments/src/v2/models/SegmentData.ts | 52 + .../src/v2/models/SegmentDataAttributes.ts | 120 ++ .../models/SegmentDataAttributesDataQuery.ts | 63 + ...taAttributesDataQueryEventPlatformItems.ts | 59 + ...aAttributesDataQueryReferenceTableItems.ts | 63 + ...ataQueryReferenceTableItemsColumnsItems.ts | 43 + ...taQueryReferenceTableItemsJoinCondition.ts | 44 + ...gmentDataAttributesDataQueryStaticItems.ts | 49 + ...ntDataAttributesDataQueryUserStoreItems.ts | 48 + .../src/v2/models/SegmentDataSource.ts | 61 + .../segments/src/v2/models/SegmentDataType.ts | 3 + services/segments/src/v2/models/TypingInfo.ts | 43 + services/segments/tsconfig.json | 28 + services/user_flow/.yarnrc.yml | 1 + services/user_flow/README.md | 44 + services/user_flow/package.json | 43 + services/user_flow/src/index.ts | 3 + services/user_flow/src/v2/UserFlowApi.ts | 193 +++ services/user_flow/src/v2/index.ts | 23 + .../src/v2/models/APIErrorResponse.ts | 45 + .../user_flow/src/v2/models/SankeyRequest.ts | 40 + .../src/v2/models/SankeyRequestData.ts | 52 + .../v2/models/SankeyRequestDataAttributes.ts | 73 + .../SankeyRequestDataAttributesDefinition.ts | 55 + .../SankeyRequestDataAttributesSampling.ts | 41 + .../SankeyRequestDataAttributesSearch.ts | 56 + ...uestDataAttributesSearchAudienceFilters.ts | 57 + ...butesSearchAudienceFiltersAccountsItems.ts | 44 + ...butesSearchAudienceFiltersSegmentsItems.ts | 45 + ...tributesSearchAudienceFiltersUsersItems.ts | 44 + ...yRequestDataAttributesSearchOccurrences.ts | 50 + .../models/SankeyRequestDataAttributesTime.ts | 45 + .../src/v2/models/SankeyRequestDataType.ts | 3 + .../user_flow/src/v2/models/SankeyResponse.ts | 40 + .../src/v2/models/SankeyResponseData.ts | 52 + .../v2/models/SankeyResponseDataAttributes.ts | 46 + .../SankeyResponseDataAttributesLinksItems.ts | 60 + .../SankeyResponseDataAttributesNodesItems.ts | 79 + ...ttributesNodesItemsAggregatedNodesItems.ts | 66 + .../src/v2/models/SankeyResponseDataType.ts | 3 + .../user_flow/src/v2/models/TypingInfo.ts | 59 + services/user_flow/tsconfig.json | 28 + yarn.lock | 36 + 136 files changed, 8003 insertions(+) create mode 100644 features/v2/cohort.feature create mode 100644 features/v2/funnel.feature create mode 100644 features/v2/segments.feature create mode 100644 features/v2/user_flow.feature create mode 100644 services/cohort/.yarnrc.yml create mode 100644 services/cohort/README.md create mode 100644 services/cohort/package.json create mode 100644 services/cohort/src/index.ts create mode 100644 services/cohort/src/v2/CohortApi.ts create mode 100644 services/cohort/src/v2/index.ts create mode 100644 services/cohort/src/v2/models/APIErrorResponse.ts create mode 100644 services/cohort/src/v2/models/GetCohortRequest.ts create mode 100644 services/cohort/src/v2/models/GetCohortRequestData.ts create mode 100644 services/cohort/src/v2/models/GetCohortRequestDataAttributes.ts create mode 100644 services/cohort/src/v2/models/GetCohortRequestDataAttributesDefinition.ts create mode 100644 services/cohort/src/v2/models/GetCohortRequestDataAttributesDefinitionAudienceFilters.ts create mode 100644 services/cohort/src/v2/models/GetCohortRequestDataAttributesDefinitionAudienceFiltersAccountsItems.ts create mode 100644 services/cohort/src/v2/models/GetCohortRequestDataAttributesDefinitionAudienceFiltersSegmentsItems.ts create mode 100644 services/cohort/src/v2/models/GetCohortRequestDataAttributesDefinitionAudienceFiltersUsersItems.ts create mode 100644 services/cohort/src/v2/models/GetCohortRequestDataAttributesTime.ts create mode 100644 services/cohort/src/v2/models/GetCohortRequestDataType.ts create mode 100644 services/cohort/src/v2/models/GetCohortResponse.ts create mode 100644 services/cohort/src/v2/models/GetCohortResponseData.ts create mode 100644 services/cohort/src/v2/models/GetCohortResponseDataAttributes.ts create mode 100644 services/cohort/src/v2/models/GetCohortResponseDataAttributesCohortsItems.ts create mode 100644 services/cohort/src/v2/models/GetCohortResponseDataAttributesCohortsItemsValuesItems.ts create mode 100644 services/cohort/src/v2/models/GetCohortResponseDataType.ts create mode 100644 services/cohort/src/v2/models/GetCohortUsersRequest.ts create mode 100644 services/cohort/src/v2/models/GetCohortUsersRequestData.ts create mode 100644 services/cohort/src/v2/models/GetCohortUsersRequestDataAttributes.ts create mode 100644 services/cohort/src/v2/models/GetCohortUsersRequestDataAttributesDefinition.ts create mode 100644 services/cohort/src/v2/models/GetCohortUsersRequestDataAttributesDefinitionAudienceFilters.ts create mode 100644 services/cohort/src/v2/models/GetCohortUsersRequestDataAttributesDefinitionAudienceFiltersAccountsItems.ts create mode 100644 services/cohort/src/v2/models/GetCohortUsersRequestDataAttributesDefinitionAudienceFiltersSegmentsItems.ts create mode 100644 services/cohort/src/v2/models/GetCohortUsersRequestDataAttributesDefinitionAudienceFiltersUsersItems.ts create mode 100644 services/cohort/src/v2/models/GetCohortUsersRequestDataAttributesTime.ts create mode 100644 services/cohort/src/v2/models/GetCohortUsersRequestDataType.ts create mode 100644 services/cohort/src/v2/models/GetCohortUsersResponse.ts create mode 100644 services/cohort/src/v2/models/GetCohortUsersResponseData.ts create mode 100644 services/cohort/src/v2/models/GetCohortUsersResponseDataAttributes.ts create mode 100644 services/cohort/src/v2/models/GetCohortUsersResponseDataAttributesUsersItems.ts create mode 100644 services/cohort/src/v2/models/GetCohortUsersResponseDataType.ts create mode 100644 services/cohort/src/v2/models/TypingInfo.ts create mode 100644 services/cohort/tsconfig.json create mode 100644 services/funnel/.yarnrc.yml create mode 100644 services/funnel/README.md create mode 100644 services/funnel/package.json create mode 100644 services/funnel/src/index.ts create mode 100644 services/funnel/src/v2/FunnelApi.ts create mode 100644 services/funnel/src/v2/index.ts create mode 100644 services/funnel/src/v2/models/APIErrorResponse.ts create mode 100644 services/funnel/src/v2/models/FunnelRequest.ts create mode 100644 services/funnel/src/v2/models/FunnelRequestData.ts create mode 100644 services/funnel/src/v2/models/FunnelRequestDataAttributes.ts create mode 100644 services/funnel/src/v2/models/FunnelRequestDataAttributesSearch.ts create mode 100644 services/funnel/src/v2/models/FunnelRequestDataAttributesSearchStepsItems.ts create mode 100644 services/funnel/src/v2/models/FunnelRequestDataAttributesTime.ts create mode 100644 services/funnel/src/v2/models/FunnelRequestDataType.ts create mode 100644 services/funnel/src/v2/models/FunnelResponse.ts create mode 100644 services/funnel/src/v2/models/FunnelResponseData.ts create mode 100644 services/funnel/src/v2/models/FunnelResponseDataAttributes.ts create mode 100644 services/funnel/src/v2/models/FunnelResponseDataAttributesFunnelStepsItems.ts create mode 100644 services/funnel/src/v2/models/FunnelResponseDataType.ts create mode 100644 services/funnel/src/v2/models/FunnelResponseElapsedTime.ts create mode 100644 services/funnel/src/v2/models/FunnelSuggestionRequest.ts create mode 100644 services/funnel/src/v2/models/FunnelSuggestionRequestData.ts create mode 100644 services/funnel/src/v2/models/FunnelSuggestionRequestDataAttributes.ts create mode 100644 services/funnel/src/v2/models/FunnelSuggestionRequestDataAttributesSearch.ts create mode 100644 services/funnel/src/v2/models/FunnelSuggestionRequestDataAttributesSearchStepsItems.ts create mode 100644 services/funnel/src/v2/models/FunnelSuggestionRequestDataAttributesTermSearch.ts create mode 100644 services/funnel/src/v2/models/FunnelSuggestionRequestDataAttributesTime.ts create mode 100644 services/funnel/src/v2/models/FunnelSuggestionRequestDataType.ts create mode 100644 services/funnel/src/v2/models/FunnelSuggestionResponse.ts create mode 100644 services/funnel/src/v2/models/FunnelSuggestionResponseData.ts create mode 100644 services/funnel/src/v2/models/FunnelSuggestionResponseDataAttributes.ts create mode 100644 services/funnel/src/v2/models/FunnelSuggestionResponseDataAttributesActionsItems.ts create mode 100644 services/funnel/src/v2/models/FunnelSuggestionResponseDataAttributesViewsItems.ts create mode 100644 services/funnel/src/v2/models/FunnelSuggestionResponseDataType.ts create mode 100644 services/funnel/src/v2/models/TypingInfo.ts create mode 100644 services/funnel/tsconfig.json create mode 100644 services/segments/.yarnrc.yml create mode 100644 services/segments/README.md create mode 100644 services/segments/package.json create mode 100644 services/segments/src/index.ts create mode 100644 services/segments/src/v2/SegmentsApi.ts create mode 100644 services/segments/src/v2/index.ts create mode 100644 services/segments/src/v2/models/APIErrorResponse.ts create mode 100644 services/segments/src/v2/models/Segment.ts create mode 100644 services/segments/src/v2/models/SegmentArray.ts create mode 100644 services/segments/src/v2/models/SegmentData.ts create mode 100644 services/segments/src/v2/models/SegmentDataAttributes.ts create mode 100644 services/segments/src/v2/models/SegmentDataAttributesDataQuery.ts create mode 100644 services/segments/src/v2/models/SegmentDataAttributesDataQueryEventPlatformItems.ts create mode 100644 services/segments/src/v2/models/SegmentDataAttributesDataQueryReferenceTableItems.ts create mode 100644 services/segments/src/v2/models/SegmentDataAttributesDataQueryReferenceTableItemsColumnsItems.ts create mode 100644 services/segments/src/v2/models/SegmentDataAttributesDataQueryReferenceTableItemsJoinCondition.ts create mode 100644 services/segments/src/v2/models/SegmentDataAttributesDataQueryStaticItems.ts create mode 100644 services/segments/src/v2/models/SegmentDataAttributesDataQueryUserStoreItems.ts create mode 100644 services/segments/src/v2/models/SegmentDataSource.ts create mode 100644 services/segments/src/v2/models/SegmentDataType.ts create mode 100644 services/segments/src/v2/models/TypingInfo.ts create mode 100644 services/segments/tsconfig.json create mode 100644 services/user_flow/.yarnrc.yml create mode 100644 services/user_flow/README.md create mode 100644 services/user_flow/package.json create mode 100644 services/user_flow/src/index.ts create mode 100644 services/user_flow/src/v2/UserFlowApi.ts create mode 100644 services/user_flow/src/v2/index.ts create mode 100644 services/user_flow/src/v2/models/APIErrorResponse.ts create mode 100644 services/user_flow/src/v2/models/SankeyRequest.ts create mode 100644 services/user_flow/src/v2/models/SankeyRequestData.ts create mode 100644 services/user_flow/src/v2/models/SankeyRequestDataAttributes.ts create mode 100644 services/user_flow/src/v2/models/SankeyRequestDataAttributesDefinition.ts create mode 100644 services/user_flow/src/v2/models/SankeyRequestDataAttributesSampling.ts create mode 100644 services/user_flow/src/v2/models/SankeyRequestDataAttributesSearch.ts create mode 100644 services/user_flow/src/v2/models/SankeyRequestDataAttributesSearchAudienceFilters.ts create mode 100644 services/user_flow/src/v2/models/SankeyRequestDataAttributesSearchAudienceFiltersAccountsItems.ts create mode 100644 services/user_flow/src/v2/models/SankeyRequestDataAttributesSearchAudienceFiltersSegmentsItems.ts create mode 100644 services/user_flow/src/v2/models/SankeyRequestDataAttributesSearchAudienceFiltersUsersItems.ts create mode 100644 services/user_flow/src/v2/models/SankeyRequestDataAttributesSearchOccurrences.ts create mode 100644 services/user_flow/src/v2/models/SankeyRequestDataAttributesTime.ts create mode 100644 services/user_flow/src/v2/models/SankeyRequestDataType.ts create mode 100644 services/user_flow/src/v2/models/SankeyResponse.ts create mode 100644 services/user_flow/src/v2/models/SankeyResponseData.ts create mode 100644 services/user_flow/src/v2/models/SankeyResponseDataAttributes.ts create mode 100644 services/user_flow/src/v2/models/SankeyResponseDataAttributesLinksItems.ts create mode 100644 services/user_flow/src/v2/models/SankeyResponseDataAttributesNodesItems.ts create mode 100644 services/user_flow/src/v2/models/SankeyResponseDataAttributesNodesItemsAggregatedNodesItems.ts create mode 100644 services/user_flow/src/v2/models/SankeyResponseDataType.ts create mode 100644 services/user_flow/src/v2/models/TypingInfo.ts create mode 100644 services/user_flow/tsconfig.json diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 93efc78e5a9c..f95a76690c8c 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -20823,6 +20823,326 @@ components: - name - requirements type: object + FunnelRequest: + example: + data: + attributes: + data_source: rum + enforced_execution_type: '' + request_id: '' + search: + cross_session_filter: '' + query_string: '@type:view' + steps: + - facet: '@view.name' + step_filter: '' + value: /apm/home + - facet: '@view.name' + step_filter: '' + value: /apm/traces + subquery_id: '' + time: + from: 1756425600000 + to: 1756857600000 + id: funnel_request + type: funnel_request + properties: + data: + $ref: '#/components/schemas/FunnelRequestData' + type: object + FunnelRequestData: + properties: + attributes: + $ref: '#/components/schemas/FunnelRequestDataAttributes' + id: + type: string + type: + $ref: '#/components/schemas/FunnelRequestDataType' + required: + - type + type: object + FunnelRequestDataAttributes: + properties: + data_source: + type: string + enforced_execution_type: + type: string + request_id: + type: string + search: + $ref: '#/components/schemas/FunnelRequestDataAttributesSearch' + time: + $ref: '#/components/schemas/FunnelRequestDataAttributesTime' + type: object + FunnelRequestDataAttributesSearch: + properties: + cross_session_filter: + type: string + query_string: + type: string + steps: + items: + $ref: '#/components/schemas/FunnelRequestDataAttributesSearchStepsItems' + type: array + subquery_id: + type: string + type: object + FunnelRequestDataAttributesSearchStepsItems: + properties: + facet: + type: string + step_filter: + type: string + value: + type: string + type: object + FunnelRequestDataAttributesTime: + properties: + from: + format: int64 + type: integer + to: + format: int64 + type: integer + type: object + FunnelRequestDataType: + default: funnel_request + enum: + - funnel_request + example: funnel_request + type: string + x-enum-varnames: + - FUNNEL_REQUEST + FunnelResponse: + example: + data: + attributes: + end_to_end_conversion_rate: 0.1161386890038228 + funnel_steps: + - label: '@type:view @view.name:/apm/home' + value: 284608 + - label: '@type:view @view.name:/apm/traces' + value: 33054 + initial_count: 3925047 + id: funnel_response + type: funnel_response + properties: + data: + $ref: '#/components/schemas/FunnelResponseData' + type: object + FunnelResponseData: + properties: + attributes: + $ref: '#/components/schemas/FunnelResponseDataAttributes' + id: + type: string + type: + $ref: '#/components/schemas/FunnelResponseDataType' + required: + - type + type: object + FunnelResponseDataAttributes: + properties: + end_to_end_conversion_rate: + format: double + type: number + end_to_end_elapsed_time: + $ref: '#/components/schemas/FunnelResponseElapsedTime' + funnel_steps: + items: + $ref: '#/components/schemas/FunnelResponseDataAttributesFunnelStepsItems' + type: array + initial_count: + format: int64 + type: integer + type: object + FunnelResponseDataAttributesFunnelStepsItems: + properties: + elapsed_time_to_next_step: + $ref: '#/components/schemas/FunnelResponseElapsedTime' + label: + type: string + value: + format: int64 + type: integer + type: object + FunnelResponseDataType: + default: funnel_response + enum: + - funnel_response + example: funnel_response + type: string + x-enum-varnames: + - FUNNEL_RESPONSE + FunnelResponseElapsedTime: + properties: + avg: + format: int64 + type: integer + max: + format: int64 + type: integer + min: + format: int64 + type: integer + p5: + format: int64 + type: integer + p50: + format: int64 + type: integer + p95: + format: int64 + type: integer + type: object + FunnelSuggestionRequest: + example: + data: + attributes: + data_source: '' + search: + cross_session_filter: '' + query_string: '@type:view' + steps: + - facet: '@view.name' + step_filter: '' + value: /apm/home + subquery_id: '' + term_search: + query: apm + time: + from: 1756425600000 + to: 1756857600000 + id: funnel_suggestion_request + type: funnel_suggestion_request + properties: + data: + $ref: '#/components/schemas/FunnelSuggestionRequestData' + type: object + FunnelSuggestionRequestData: + properties: + attributes: + $ref: '#/components/schemas/FunnelSuggestionRequestDataAttributes' + id: + type: string + type: + $ref: '#/components/schemas/FunnelSuggestionRequestDataType' + required: + - type + type: object + FunnelSuggestionRequestDataAttributes: + properties: + data_source: + type: string + search: + $ref: '#/components/schemas/FunnelSuggestionRequestDataAttributesSearch' + term_search: + $ref: '#/components/schemas/FunnelSuggestionRequestDataAttributesTermSearch' + time: + $ref: '#/components/schemas/FunnelSuggestionRequestDataAttributesTime' + type: object + FunnelSuggestionRequestDataAttributesSearch: + properties: + cross_session_filter: + type: string + query_string: + type: string + steps: + items: + $ref: '#/components/schemas/FunnelSuggestionRequestDataAttributesSearchStepsItems' + type: array + subquery_id: + type: string + type: object + FunnelSuggestionRequestDataAttributesSearchStepsItems: + properties: + facet: + type: string + step_filter: + type: string + value: + type: string + type: object + FunnelSuggestionRequestDataAttributesTermSearch: + properties: + query: + type: string + type: object + FunnelSuggestionRequestDataAttributesTime: + properties: + from: + format: int64 + type: integer + to: + format: int64 + type: integer + type: object + FunnelSuggestionRequestDataType: + default: funnel_suggestion_request + enum: + - funnel_suggestion_request + example: funnel_suggestion_request + type: string + x-enum-varnames: + - FUNNEL_SUGGESTION_REQUEST + FunnelSuggestionResponse: + example: + data: + attributes: + actions: + - name: view_trace_details + - name: filter_by_service + - name: analyze_performance + views: + - name: /apm/traces + - name: /apm/services + - name: /apm/service-map + id: funnel_suggestion_response + type: funnel_suggestion_response + properties: + data: + $ref: '#/components/schemas/FunnelSuggestionResponseData' + type: object + FunnelSuggestionResponseData: + properties: + attributes: + $ref: '#/components/schemas/FunnelSuggestionResponseDataAttributes' + id: + type: string + type: + $ref: '#/components/schemas/FunnelSuggestionResponseDataType' + required: + - type + type: object + FunnelSuggestionResponseDataAttributes: + properties: + actions: + items: + $ref: '#/components/schemas/FunnelSuggestionResponseDataAttributesActionsItems' + type: array + views: + items: + $ref: '#/components/schemas/FunnelSuggestionResponseDataAttributesViewsItems' + type: array + type: object + FunnelSuggestionResponseDataAttributesActionsItems: + properties: + name: + type: string + type: object + FunnelSuggestionResponseDataAttributesViewsItems: + properties: + name: + type: string + type: object + FunnelSuggestionResponseDataType: + default: funnel_suggestion_response + enum: + - funnel_suggestion_response + example: funnel_suggestion_response + type: string + x-enum-varnames: + - FUNNEL_SUGGESTION_RESPONSE GCPCredentials: description: The definition of the `GCPCredentials` object. oneOf: @@ -21735,6 +22055,369 @@ components: type: string type: array type: object + GetCohortRequest: + properties: + data: + $ref: '#/components/schemas/GetCohortRequestData' + type: object + GetCohortRequestData: + properties: + attributes: + $ref: '#/components/schemas/GetCohortRequestDataAttributes' + id: + type: string + type: + $ref: '#/components/schemas/GetCohortRequestDataType' + required: + - type + type: object + GetCohortRequestDataAttributes: + properties: + data_source: + type: string + definition: + $ref: '#/components/schemas/GetCohortRequestDataAttributesDefinition' + enforced_execution_type: + type: string + request_id: + type: string + time: + $ref: '#/components/schemas/GetCohortRequestDataAttributesTime' + window_size: + type: string + type: object + GetCohortRequestDataAttributesDefinition: + properties: + audience_filters: + $ref: '#/components/schemas/GetCohortRequestDataAttributesDefinitionAudienceFilters' + inclusion_search: + type: string + return_search: + type: string + segment_id: + type: string + type: object + GetCohortRequestDataAttributesDefinitionAudienceFilters: + properties: + accounts: + items: + $ref: '#/components/schemas/GetCohortRequestDataAttributesDefinitionAudienceFiltersAccountsItems' + type: array + formula: + type: string + segments: + items: + $ref: '#/components/schemas/GetCohortRequestDataAttributesDefinitionAudienceFiltersSegmentsItems' + type: array + users: + items: + $ref: '#/components/schemas/GetCohortRequestDataAttributesDefinitionAudienceFiltersUsersItems' + type: array + type: object + GetCohortRequestDataAttributesDefinitionAudienceFiltersAccountsItems: + properties: + name: + example: '' + type: string + query: + type: string + required: + - name + type: object + GetCohortRequestDataAttributesDefinitionAudienceFiltersSegmentsItems: + properties: + name: + example: '' + type: string + segment_id: + example: '' + type: string + required: + - name + - segment_id + type: object + GetCohortRequestDataAttributesDefinitionAudienceFiltersUsersItems: + properties: + name: + example: '' + type: string + query: + type: string + required: + - name + type: object + GetCohortRequestDataAttributesTime: + properties: + from: + format: int64 + type: integer + to: + format: int64 + type: integer + type: object + GetCohortRequestDataType: + default: cohort_request + enum: + - cohort_request + example: cohort_request + type: string + x-enum-varnames: + - COHORT_REQUEST + GetCohortResponse: + example: + data: + attributes: + cohorts: + - cohort: '2024-01-01' + cohort_size: 1000 + start_time: 1704067200000 + values: + - absolute_value: 1000 + end_time: 1704672000000 + relative_value: 100 + start_time: 1704067200000 + window: 0 + - absolute_value: 750 + end_time: 1705276800000 + relative_value: 75 + start_time: 1704672000000 + window: 1 + - absolute_value: 600 + end_time: 1705881600000 + relative_value: 60 + start_time: 1705276800000 + window: 2 + id: cohort_response + type: cohort_response + properties: + data: + $ref: '#/components/schemas/GetCohortResponseData' + type: object + GetCohortResponseData: + properties: + attributes: + $ref: '#/components/schemas/GetCohortResponseDataAttributes' + id: + type: string + type: + $ref: '#/components/schemas/GetCohortResponseDataType' + required: + - type + type: object + GetCohortResponseDataAttributes: + properties: + cohorts: + items: + $ref: '#/components/schemas/GetCohortResponseDataAttributesCohortsItems' + type: array + type: object + GetCohortResponseDataAttributesCohortsItems: + properties: + cohort: + type: string + cohort_size: + format: int64 + type: integer + start_time: + format: int64 + type: integer + values: + items: + $ref: '#/components/schemas/GetCohortResponseDataAttributesCohortsItemsValuesItems' + type: array + type: object + GetCohortResponseDataAttributesCohortsItemsValuesItems: + properties: + absolute_value: + format: int64 + type: integer + end_time: + format: int64 + type: integer + relative_value: + format: double + type: number + start_time: + format: int64 + type: integer + window: + format: int64 + type: integer + type: object + GetCohortResponseDataType: + default: cohort_response + enum: + - cohort_response + example: cohort_response + type: string + x-enum-varnames: + - COHORT_RESPONSE + GetCohortUsersRequest: + properties: + data: + $ref: '#/components/schemas/GetCohortUsersRequestData' + type: object + GetCohortUsersRequestData: + properties: + attributes: + $ref: '#/components/schemas/GetCohortUsersRequestDataAttributes' + id: + type: string + type: + $ref: '#/components/schemas/GetCohortUsersRequestDataType' + required: + - type + type: object + GetCohortUsersRequestDataAttributes: + properties: + data_source: + type: string + definition: + $ref: '#/components/schemas/GetCohortUsersRequestDataAttributesDefinition' + execution: + format: int64 + type: integer + time: + $ref: '#/components/schemas/GetCohortUsersRequestDataAttributesTime' + user_selection: + type: string + window_size: + type: string + type: object + GetCohortUsersRequestDataAttributesDefinition: + properties: + audience_filters: + $ref: '#/components/schemas/GetCohortUsersRequestDataAttributesDefinitionAudienceFilters' + cohort: + type: string + inclusion_search: + type: string + return_search: + type: string + segment_id: + type: string + window: + format: int64 + type: integer + type: object + GetCohortUsersRequestDataAttributesDefinitionAudienceFilters: + properties: + accounts: + items: + $ref: '#/components/schemas/GetCohortUsersRequestDataAttributesDefinitionAudienceFiltersAccountsItems' + type: array + formula: + type: string + segments: + items: + $ref: '#/components/schemas/GetCohortUsersRequestDataAttributesDefinitionAudienceFiltersSegmentsItems' + type: array + users: + items: + $ref: '#/components/schemas/GetCohortUsersRequestDataAttributesDefinitionAudienceFiltersUsersItems' + type: array + type: object + GetCohortUsersRequestDataAttributesDefinitionAudienceFiltersAccountsItems: + properties: + name: + example: '' + type: string + query: + type: string + required: + - name + type: object + GetCohortUsersRequestDataAttributesDefinitionAudienceFiltersSegmentsItems: + properties: + name: + example: '' + type: string + segment_id: + example: '' + type: string + required: + - name + - segment_id + type: object + GetCohortUsersRequestDataAttributesDefinitionAudienceFiltersUsersItems: + properties: + name: + example: '' + type: string + query: + type: string + required: + - name + type: object + GetCohortUsersRequestDataAttributesTime: + properties: + from: + format: int64 + type: integer + to: + format: int64 + type: integer + type: object + GetCohortUsersRequestDataType: + default: cohort_users_request + enum: + - cohort_users_request + example: cohort_users_request + type: string + x-enum-varnames: + - COHORT_USERS_REQUEST + GetCohortUsersResponse: + example: + data: + attributes: + users: + - email: user@example.com + id: user123 + name: John Doe + - email: jane@example.com + id: user456 + name: Jane Smith + id: cohort_users_response + type: cohort_users_response + properties: + data: + $ref: '#/components/schemas/GetCohortUsersResponseData' + type: object + GetCohortUsersResponseData: + properties: + attributes: + $ref: '#/components/schemas/GetCohortUsersResponseDataAttributes' + id: + type: string + type: + $ref: '#/components/schemas/GetCohortUsersResponseDataType' + required: + - type + type: object + GetCohortUsersResponseDataAttributes: + properties: + users: + items: + $ref: '#/components/schemas/GetCohortUsersResponseDataAttributesUsersItems' + type: array + type: object + GetCohortUsersResponseDataAttributesUsersItems: + properties: + email: + type: string + id: + type: string + name: + type: string + type: object + GetCohortUsersResponseDataType: + default: cohort_users_response + enum: + - cohort_users_response + example: cohort_users_response + type: string + x-enum-varnames: + - COHORT_USERS_RESPONSE GetCustomFrameworkResponse: description: Response object to get a custom framework. properties: @@ -42312,6 +42995,294 @@ components: example: report_id type: string type: object + SankeyRequest: + example: + data: + attributes: + data_source: '' + definition: + entries_per_step: 10 + number_of_steps: 5 + source: '@view.name' + target: '@view.name' + enforced_execution_type: '' + request_id: '' + sampling: + enabled: true + search: + audience_filters: {} + query: '@type:view @application.id:*' + subquery_id: '' + time: + from: 1756425600000 + to: 1756857600000 + id: sankey_request + type: sankey_request + properties: + data: + $ref: '#/components/schemas/SankeyRequestData' + type: object + SankeyRequestData: + properties: + attributes: + $ref: '#/components/schemas/SankeyRequestDataAttributes' + id: + type: string + type: + $ref: '#/components/schemas/SankeyRequestDataType' + required: + - type + type: object + SankeyRequestDataAttributes: + properties: + data_source: + type: string + definition: + $ref: '#/components/schemas/SankeyRequestDataAttributesDefinition' + enforced_execution_type: + type: string + request_id: + type: string + sampling: + $ref: '#/components/schemas/SankeyRequestDataAttributesSampling' + search: + $ref: '#/components/schemas/SankeyRequestDataAttributesSearch' + time: + $ref: '#/components/schemas/SankeyRequestDataAttributesTime' + type: object + SankeyRequestDataAttributesDefinition: + properties: + entries_per_step: + format: int64 + type: integer + number_of_steps: + format: int64 + type: integer + source: + type: string + target: + type: string + type: object + SankeyRequestDataAttributesSampling: + properties: + enabled: + description: The `sampling` `enabled`. + type: boolean + type: object + SankeyRequestDataAttributesSearch: + properties: + audience_filters: + $ref: '#/components/schemas/SankeyRequestDataAttributesSearchAudienceFilters' + occurrences: + $ref: '#/components/schemas/SankeyRequestDataAttributesSearchOccurrences' + query: + type: string + subquery_id: + type: string + type: object + SankeyRequestDataAttributesSearchAudienceFilters: + properties: + accounts: + items: + $ref: '#/components/schemas/SankeyRequestDataAttributesSearchAudienceFiltersAccountsItems' + type: array + formula: + type: string + segments: + items: + $ref: '#/components/schemas/SankeyRequestDataAttributesSearchAudienceFiltersSegmentsItems' + type: array + users: + items: + $ref: '#/components/schemas/SankeyRequestDataAttributesSearchAudienceFiltersUsersItems' + type: array + type: object + SankeyRequestDataAttributesSearchAudienceFiltersAccountsItems: + properties: + name: + example: '' + type: string + query: + type: string + required: + - name + type: object + SankeyRequestDataAttributesSearchAudienceFiltersSegmentsItems: + properties: + name: + example: '' + type: string + segment_id: + example: '' + type: string + required: + - name + - segment_id + type: object + SankeyRequestDataAttributesSearchAudienceFiltersUsersItems: + properties: + name: + example: '' + type: string + query: + type: string + required: + - name + type: object + SankeyRequestDataAttributesSearchOccurrences: + properties: + meta: + additionalProperties: + type: string + type: object + operator: + example: '' + type: string + value: + example: '' + type: string + required: + - operator + - value + type: object + SankeyRequestDataAttributesTime: + properties: + from: + format: int64 + type: integer + to: + format: int64 + type: integer + type: object + SankeyRequestDataType: + default: sankey_request + enum: + - sankey_request + example: sankey_request + type: string + x-enum-varnames: + - SANKEY_REQUEST + SankeyResponse: + example: + data: + attributes: + links: + - column: 0 + id: apm_home-to-apm_traces + source: apm_home + target: apm_traces + value: 33054 + nodes: + - aggregated_nodes: null + column: 0 + id: apm_home + incoming_value: 0 + name: /apm/home + outgoing_value: 33054 + type: regular + value: 284608 + - aggregated_nodes: null + column: 1 + id: apm_traces + incoming_value: 33054 + name: /apm/traces + outgoing_value: 15000 + type: regular + value: 33054 + id: sankey_response + type: sankey_response + properties: + data: + $ref: '#/components/schemas/SankeyResponseData' + type: object + SankeyResponseData: + properties: + attributes: + $ref: '#/components/schemas/SankeyResponseDataAttributes' + id: + type: string + type: + $ref: '#/components/schemas/SankeyResponseDataType' + required: + - type + type: object + SankeyResponseDataAttributes: + properties: + links: + items: + $ref: '#/components/schemas/SankeyResponseDataAttributesLinksItems' + type: array + nodes: + items: + $ref: '#/components/schemas/SankeyResponseDataAttributesNodesItems' + type: array + type: object + SankeyResponseDataAttributesLinksItems: + properties: + column: + format: int64 + type: integer + id: + type: string + source: + type: string + target: + type: string + value: + format: int64 + type: integer + type: object + SankeyResponseDataAttributesNodesItems: + properties: + aggregated_nodes: + items: + $ref: '#/components/schemas/SankeyResponseDataAttributesNodesItemsAggregatedNodesItems' + type: array + column: + format: int64 + type: integer + id: + type: string + incoming_value: + format: int64 + type: integer + name: + type: string + outgoing_value: + format: int64 + type: integer + type: + type: string + value: + format: int64 + type: integer + type: object + SankeyResponseDataAttributesNodesItemsAggregatedNodesItems: + properties: + id: + type: string + incoming_value: + format: int64 + type: integer + name: + type: string + outgoing_value: + format: int64 + type: integer + type: + type: string + value: + format: int64 + type: integer + type: object + SankeyResponseDataType: + default: sankey_response + enum: + - sankey_response + example: sankey_response + type: string + x-enum-varnames: + - SANKEY_RESPONSE ScaRequest: properties: data: @@ -45944,6 +46915,229 @@ components: required: - securityTrigger type: object + Segment: + example: + data: + attributes: + created_at: '0001-01-01T00:00:00Z' + created_by: + handle: '' + id: '' + uuid: '' + data_query: + event_platform: + - facet: '@usr.id' + from: '2025-08-01' + name: high_value_users + query: '@type:view @view.name:/logs @usr.session_duration:>300000' + to: '2025-09-01' + description: Users who frequently visit logs and have high session duration + modified_at: '0001-01-01T00:00:00Z' + modified_by: + handle: '' + id: '' + uuid: '' + name: High-Value Users + org_id: 123456 + source: 0 + tags: + - high-value + - logs + - active + version: 1 + id: segment-12345 + type: segment + properties: + data: + $ref: '#/components/schemas/SegmentData' + type: object + SegmentArray: + properties: + data: + items: + $ref: '#/components/schemas/SegmentData' + type: array + required: + - data + type: object + SegmentData: + properties: + attributes: + $ref: '#/components/schemas/SegmentDataAttributes' + id: + type: string + type: + $ref: '#/components/schemas/SegmentDataType' + required: + - type + type: object + SegmentDataAttributes: + properties: + created_at: + format: date-time + type: string + created_by: + $ref: '#/components/schemas/SegmentDataSource' + data_query: + $ref: '#/components/schemas/SegmentDataAttributesDataQuery' + description: + type: string + disabled_at: + format: date-time + type: string + disabled_by: + $ref: '#/components/schemas/SegmentDataSource' + materialization_row_count: + format: int64 + type: integer + materialized_at: + type: string + modified_at: + format: date-time + type: string + modified_by: + $ref: '#/components/schemas/SegmentDataSource' + name: + example: '' + type: string + org_id: + format: int64 + type: integer + source: + format: int64 + type: integer + tags: + items: + type: string + type: array + version: + format: int64 + type: integer + required: + - data_query + - name + type: object + SegmentDataAttributesDataQuery: + properties: + combination: + type: string + event_platform: + items: + $ref: '#/components/schemas/SegmentDataAttributesDataQueryEventPlatformItems' + type: array + reference_table: + items: + $ref: '#/components/schemas/SegmentDataAttributesDataQueryReferenceTableItems' + type: array + static: + items: + $ref: '#/components/schemas/SegmentDataAttributesDataQueryStaticItems' + type: array + user_store: + items: + $ref: '#/components/schemas/SegmentDataAttributesDataQueryUserStoreItems' + type: array + type: object + SegmentDataAttributesDataQueryEventPlatformItems: + properties: + facet: + example: '' + type: string + from: + type: string + name: + type: string + query: + type: string + to: + type: string + required: + - facet + type: object + SegmentDataAttributesDataQueryReferenceTableItems: + properties: + columns: + items: + $ref: '#/components/schemas/SegmentDataAttributesDataQueryReferenceTableItemsColumnsItems' + type: array + filter_query: + type: string + join_condition: + $ref: '#/components/schemas/SegmentDataAttributesDataQueryReferenceTableItemsJoinCondition' + name: + type: string + table_name: + example: '' + type: string + required: + - join_condition + - table_name + type: object + SegmentDataAttributesDataQueryReferenceTableItemsColumnsItems: + properties: + alias: + type: string + name: + type: string + type: object + SegmentDataAttributesDataQueryReferenceTableItemsJoinCondition: + properties: + column_name: + example: '' + type: string + facet: + type: string + required: + - column_name + type: object + SegmentDataAttributesDataQueryStaticItems: + properties: + id: + type: string + name: + type: string + user_count: + format: int64 + minimum: 0 + type: integer + type: object + SegmentDataAttributesDataQueryUserStoreItems: + properties: + facet: + type: string + name: + type: string + query: + type: string + type: object + SegmentDataSource: + properties: + handle: + example: '' + type: string + icon: + type: string + id: + example: '' + type: string + name: + type: string + uuid: + example: '' + type: string + required: + - handle + - id + - uuid + type: object + SegmentDataType: + default: segment + enum: + - segment + example: segment + type: string + x-enum-varnames: + - SEGMENT Selectors: description: 'Selectors are used to filter security issues for which notifications should be generated. @@ -73028,6 +74222,54 @@ paths: operator: OR permissions: - rum_apps_write + /api/v2/rum/cohort: + post: + description: Analyze user cohorts for retention and conversion analysis + operationId: GetRumCohort + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GetCohortRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/GetCohortResponse' + description: Successful response with cohort analysis data + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: [] + summary: Get rum cohort + tags: + - Cohort + x-unstable: '**Note**: This endpoint may be subject to changes.' + /api/v2/rum/cohort/users: + post: + description: Get users within a specific cohort for retention analysis + operationId: GetRumCohortUsers + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GetCohortUsersRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/GetCohortUsersResponse' + description: Successful response with cohort users + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: [] + summary: Get rum cohort users + tags: + - Cohort + x-unstable: '**Note**: This endpoint may be subject to changes.' /api/v2/rum/config/metrics: get: description: Get the list of configured rum-based metrics with their definitions. @@ -73282,6 +74524,134 @@ paths: operator: OR permissions: - rum_apps_read + /api/v2/rum/funnel: + post: + description: Analyze conversion funnels to understand user drop-off patterns + operationId: GetRumFunnel + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/FunnelRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/FunnelResponse' + description: Successful response with funnel analysis data + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: [] + summary: Get rum funnel + tags: + - Funnel + x-unstable: '**Note**: This endpoint may be subject to changes.' + /api/v2/rum/funnel/new_step_suggestions: + post: + description: Get suggested steps for building conversion funnels + operationId: GetRumFunnelStepSuggestions + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/FunnelSuggestionRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/FunnelSuggestionResponse' + description: Successful response with funnel step suggestions + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: [] + summary: Get rum funnel step suggestions + tags: + - Funnel + x-unstable: '**Note**: This endpoint may be subject to changes.' + /api/v2/rum/sankey: + post: + description: Generate Sankey diagrams to visualize user flow paths and drop-off + points + operationId: GetRumSankey + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SankeyRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/SankeyResponse' + description: Successful response with Sankey diagram data + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: [] + summary: Get rum sankey + tags: + - User Flow + x-unstable: '**Note**: This endpoint may be subject to changes.' + /api/v2/rum/segment: + get: + description: List all available user segments for audience targeting + operationId: ListRumSegments + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/SegmentArray' + description: Successful response with list of segments + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: [] + summary: List rum segments + tags: + - Segments + x-unstable: '**Note**: This endpoint may be subject to changes.' + post: + description: Create a new user segment for audience targeting + operationId: CreateRumSegment + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Segment' + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/Segment' + description: Segment created successfully + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: [] + summary: Create rum segment + tags: + - Segments + x-unstable: '**Note**: This endpoint may be subject to changes.' + /api/v2/rum/segment/initialize: + post: + description: Initialize default segments for a new organization + operationId: InitializeRumSegments + responses: + '200': + description: Default segments created successfully + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: [] + summary: Initialize rum segments + tags: + - Segments + x-unstable: '**Note**: This endpoint may be subject to changes.' /api/v2/saml_configurations/idp_metadata: post: description: 'Endpoint for uploading IdP metadata for SAML setup. @@ -81252,6 +82622,8 @@ tags: API. See the [Cloudflare integration page](https://docs.datadoghq.com/integrations/cloudflare/) for more information. name: Cloudflare Integration +- description: API for Cohort. + name: Cohort - description: Manage your Datadog Confluent Cloud integration accounts and account resources directly through the Datadog API. See the [Confluent Cloud page](https://docs.datadoghq.com/integrations/confluent_cloud/) for more information. @@ -81335,6 +82707,8 @@ tags: that apply configuration changes to multiple hosts at once.' name: Fleet Automation +- description: API for funnel. + name: Funnel - description: 'Configure your Datadog-Google Cloud Platform (GCP) integration directly through the Datadog API. Read more about the [Datadog-Google Cloud Platform integration](https://docs.datadoghq.com/integrations/google_cloud_platform).' @@ -81556,6 +82930,8 @@ tags: See the [Datadog Security page](https://docs.datadoghq.com/security/) for more information. name: Security Monitoring +- description: API for segments. + name: Segments - description: Create, update, delete, and retrieve sensitive data scanner groups and rules. See the [Sensitive Data Scanner page](https://docs.datadoghq.com/sensitive_data_scanner/) for more information. @@ -81643,6 +83019,8 @@ tags: description: Find out more at url: https://docs.datadoghq.com/account_management/billing/usage_details/ name: Usage Metering +- description: API for user flow. + name: User Flow - description: Create, edit, and disable users. externalDocs: url: https://docs.datadoghq.com/account_management/users diff --git a/features/v2/cohort.feature b/features/v2/cohort.feature new file mode 100644 index 000000000000..8ca5e7bbdd9f --- /dev/null +++ b/features/v2/cohort.feature @@ -0,0 +1,24 @@ +@endpoint(cohort) @endpoint(cohort-v2) +Feature: Cohort + API for Cohort. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "Cohort" API + + @generated @skip @team:DataDog/product-analytics-backend + Scenario: Get rum cohort returns "Successful response with cohort analysis data" response + Given operation "GetRumCohort" enabled + And new "GetRumCohort" request + And body with value {"data": {"attributes": {"definition": {"audience_filters": {"accounts": [{"name": ""}], "segments": [{"name": "", "segment_id": ""}], "users": [{"name": ""}]}}, "time": {}}, "type": "cohort_request"}} + When the request is sent + Then the response status is 200 Successful response with cohort analysis data + + @generated @skip @team:DataDog/product-analytics-backend + Scenario: Get rum cohort users returns "Successful response with cohort users" response + Given operation "GetRumCohortUsers" enabled + And new "GetRumCohortUsers" request + And body with value {"data": {"attributes": {"definition": {"audience_filters": {"accounts": [{"name": ""}], "segments": [{"name": "", "segment_id": ""}], "users": [{"name": ""}]}}, "time": {}}, "type": "cohort_users_request"}} + When the request is sent + Then the response status is 200 Successful response with cohort users diff --git a/features/v2/funnel.feature b/features/v2/funnel.feature new file mode 100644 index 000000000000..929450400fe4 --- /dev/null +++ b/features/v2/funnel.feature @@ -0,0 +1,24 @@ +@endpoint(funnel) @endpoint(funnel-v2) +Feature: Funnel + API for funnel. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "Funnel" API + + @generated @skip @team:DataDog/product-analytics-backend + Scenario: Get rum funnel returns "Successful response with funnel analysis data" response + Given operation "GetRumFunnel" enabled + And new "GetRumFunnel" request + And body with value {"data": {"attributes": {"data_source": "rum", "enforced_execution_type": "", "request_id": "", "search": {"cross_session_filter": "", "query_string": "@type:view", "steps": [{"facet": "@view.name", "step_filter": "", "value": "/apm/home"}, {"facet": "@view.name", "step_filter": "", "value": "/apm/traces"}], "subquery_id": ""}, "time": {"from": 1756425600000, "to": 1756857600000}}, "id": "funnel_request", "type": "funnel_request"}} + When the request is sent + Then the response status is 200 Successful response with funnel analysis data + + @generated @skip @team:DataDog/product-analytics-backend + Scenario: Get rum funnel step suggestions returns "Successful response with funnel step suggestions" response + Given operation "GetRumFunnelStepSuggestions" enabled + And new "GetRumFunnelStepSuggestions" request + And body with value {"data": {"attributes": {"data_source": "", "search": {"cross_session_filter": "", "query_string": "@type:view", "steps": [{"facet": "@view.name", "step_filter": "", "value": "/apm/home"}], "subquery_id": ""}, "term_search": {"query": "apm"}, "time": {"from": 1756425600000, "to": 1756857600000}}, "id": "funnel_suggestion_request", "type": "funnel_suggestion_request"}} + When the request is sent + Then the response status is 200 Successful response with funnel step suggestions diff --git a/features/v2/segments.feature b/features/v2/segments.feature new file mode 100644 index 000000000000..95cc467d6d60 --- /dev/null +++ b/features/v2/segments.feature @@ -0,0 +1,30 @@ +@endpoint(segments) @endpoint(segments-v2) +Feature: Segments + API for segments. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "Segments" API + + @generated @skip @team:DataDog/product-analytics-backend + Scenario: Create rum segment returns "Segment created successfully" response + Given operation "CreateRumSegment" enabled + And new "CreateRumSegment" request + And body with value {"data": {"attributes": {"created_at": "0001-01-01T00:00:00Z", "created_by": {"handle": "", "id": "", "uuid": ""}, "data_query": {"event_platform": [{"facet": "@usr.id", "from": "2025-08-01", "name": "high_value_users", "query": "@type:view @view.name:/logs @usr.session_duration:>300000", "to": "2025-09-01"}]}, "description": "Users who frequently visit logs and have high session duration", "modified_at": "0001-01-01T00:00:00Z", "modified_by": {"handle": "", "id": "", "uuid": ""}, "name": "High-Value Users", "org_id": 123456, "source": 0, "tags": ["high-value", "logs", "active"], "version": 1}, "id": "segment-12345", "type": "segment"}} + When the request is sent + Then the response status is 201 Segment created successfully + + @generated @skip @team:DataDog/product-analytics-backend + Scenario: Initialize rum segments returns "Default segments created successfully" response + Given operation "InitializeRumSegments" enabled + And new "InitializeRumSegments" request + When the request is sent + Then the response status is 200 Default segments created successfully + + @generated @skip @team:DataDog/product-analytics-backend + Scenario: List rum segments returns "Successful response with list of segments" response + Given operation "ListRumSegments" enabled + And new "ListRumSegments" request + When the request is sent + Then the response status is 200 Successful response with list of segments diff --git a/features/v2/undo.json b/features/v2/undo.json index f4a7f9e7f8de..f019e40f8b6e 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -3254,6 +3254,18 @@ "type": "idempotent" } }, + "GetRumCohort": { + "tag": "Cohort", + "undo": { + "type": "safe" + } + }, + "GetRumCohortUsers": { + "tag": "Cohort", + "undo": { + "type": "safe" + } + }, "ListRumMetrics": { "tag": "Rum Metrics", "undo": { @@ -3303,6 +3315,42 @@ "type": "safe" } }, + "GetRumFunnel": { + "tag": "Funnel", + "undo": { + "type": "safe" + } + }, + "GetRumFunnelStepSuggestions": { + "tag": "Funnel", + "undo": { + "type": "safe" + } + }, + "GetRumSankey": { + "tag": "User Flow", + "undo": { + "type": "safe" + } + }, + "ListRumSegments": { + "tag": "Segments", + "undo": { + "type": "safe" + } + }, + "CreateRumSegment": { + "tag": "Segments", + "undo": { + "type": "safe" + } + }, + "InitializeRumSegments": { + "tag": "Segments", + "undo": { + "type": "safe" + } + }, "UploadIdPMetadata": { "tag": "Organizations", "undo": { diff --git a/features/v2/user_flow.feature b/features/v2/user_flow.feature new file mode 100644 index 000000000000..6dca1f698760 --- /dev/null +++ b/features/v2/user_flow.feature @@ -0,0 +1,14 @@ +@endpoint(user-flow) @endpoint(user-flow-v2) +Feature: User Flow + API for user flow. + + @generated @skip @team:DataDog/product-analytics-backend + Scenario: Get rum sankey returns "Successful response with Sankey diagram data" response + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "UserFlow" API + And operation "GetRumSankey" enabled + And new "GetRumSankey" request + And body with value {"data": {"attributes": {"data_source": "", "definition": {"entries_per_step": 10, "number_of_steps": 5, "source": "@view.name", "target": "@view.name"}, "enforced_execution_type": "", "request_id": "", "sampling": {"enabled": true}, "search": {"audience_filters": {}, "query": "@type:view @application.id:*", "subquery_id": ""}, "time": {"from": 1756425600000, "to": 1756857600000}}, "id": "sankey_request", "type": "sankey_request"}} + When the request is sent + Then the response status is 200 Successful response with Sankey diagram data diff --git a/packages/datadog-api-client/README.md b/packages/datadog-api-client/README.md index c9955347ddd4..280849df189c 100644 --- a/packages/datadog-api-client/README.md +++ b/packages/datadog-api-client/README.md @@ -367,6 +367,7 @@ apiInstance | Cloud Cost Management | @datadog/datadog-api-client-cloud-cost-management | [README.md](../../services/cloud-cost-management/README.md) | | Cloud Network Monitoring | @datadog/datadog-api-client-cloud-network-monitoring | [README.md](../../services/cloud-network-monitoring/README.md) | | Cloudflare Integration | @datadog/datadog-api-client-cloudflare-integration | [README.md](../../services/cloudflare-integration/README.md) | +| Cohort | @datadog/datadog-api-client-cohort | [README.md](../../services/cohort/README.md) | | Confluent Cloud | @datadog/datadog-api-client-confluent-cloud | [README.md](../../services/confluent-cloud/README.md) | | Container Images | @datadog/datadog-api-client-container-images | [README.md](../../services/container-images/README.md) | | Containers | @datadog/datadog-api-client-containers | [README.md](../../services/containers/README.md) | @@ -384,6 +385,7 @@ apiInstance | Events | @datadog/datadog-api-client-events | [README.md](../../services/events/README.md) | | Fastly Integration | @datadog/datadog-api-client-fastly-integration | [README.md](../../services/fastly-integration/README.md) | | Fleet Automation | @datadog/datadog-api-client-fleet-automation | [README.md](../../services/fleet-automation/README.md) | +| Funnel | @datadog/datadog-api-client-funnel | [README.md](../../services/funnel/README.md) | | GCP Integration | @datadog/datadog-api-client-gcp-integration | [README.md](../../services/gcp-integration/README.md) | | Hosts | @datadog/datadog-api-client-hosts | [README.md](../../services/hosts/README.md) | | Incident Services | @datadog/datadog-api-client-incident-services | [README.md](../../services/incident-services/README.md) | @@ -420,6 +422,7 @@ apiInstance | Rum Metrics | @datadog/datadog-api-client-rum-metrics | [README.md](../../services/rum-metrics/README.md) | | Rum Retention Filters | @datadog/datadog-api-client-rum-retention-filters | [README.md](../../services/rum-retention-filters/README.md) | | Security Monitoring | @datadog/datadog-api-client-security-monitoring | [README.md](../../services/security-monitoring/README.md) | +| Segments | @datadog/datadog-api-client-segments | [README.md](../../services/segments/README.md) | | Sensitive Data Scanner | @datadog/datadog-api-client-sensitive-data-scanner | [README.md](../../services/sensitive-data-scanner/README.md) | | Service Accounts | @datadog/datadog-api-client-service-accounts | [README.md](../../services/service-accounts/README.md) | | Service Checks | @datadog/datadog-api-client-service-checks | [README.md](../../services/service-checks/README.md) | @@ -439,6 +442,7 @@ apiInstance | Teams | @datadog/datadog-api-client-teams | [README.md](../../services/teams/README.md) | | Test Optimization | @datadog/datadog-api-client-test-optimization | [README.md](../../services/test-optimization/README.md) | | Usage Metering | @datadog/datadog-api-client-usage-metering | [README.md](../../services/usage-metering/README.md) | +| User Flow | @datadog/datadog-api-client-user-flow | [README.md](../../services/user-flow/README.md) | | Users | @datadog/datadog-api-client-users | [README.md](../../services/users/README.md) | | Webhooks Integration | @datadog/datadog-api-client-webhooks-integration | [README.md](../../services/webhooks-integration/README.md) | | Workflow Automation | @datadog/datadog-api-client-workflow-automation | [README.md](../../services/workflow-automation/README.md) | \ No newline at end of file diff --git a/private/bdd_runner/src/support/scenarios_model_mapping.ts b/private/bdd_runner/src/support/scenarios_model_mapping.ts index 06c0f70476fd..4e05d412bc4e 100644 --- a/private/bdd_runner/src/support/scenarios_model_mapping.ts +++ b/private/bdd_runner/src/support/scenarios_model_mapping.ts @@ -8001,6 +8001,20 @@ export const ScenariosModelMappings: { [key: string]: OperationMapping } = { }, operationResponseType: "RumRetentionFilterResponse", }, + "CohortApi.V2.GetRumCohort": { + body: { + type: "GetCohortRequest", + format: "", + }, + operationResponseType: "GetCohortResponse", + }, + "CohortApi.V2.GetRumCohortUsers": { + body: { + type: "GetCohortUsersRequest", + format: "", + }, + operationResponseType: "GetCohortUsersResponse", + }, "RumMetricsApi.V2.ListRumMetrics": { operationResponseType: "RumMetricsResponse", }, @@ -8036,6 +8050,40 @@ export const ScenariosModelMappings: { [key: string]: OperationMapping } = { }, operationResponseType: "RumMetricResponse", }, + "FunnelApi.V2.GetRumFunnel": { + body: { + type: "FunnelRequest", + format: "", + }, + operationResponseType: "FunnelResponse", + }, + "FunnelApi.V2.GetRumFunnelStepSuggestions": { + body: { + type: "FunnelSuggestionRequest", + format: "", + }, + operationResponseType: "FunnelSuggestionResponse", + }, + "UserFlowApi.V2.GetRumSankey": { + body: { + type: "SankeyRequest", + format: "", + }, + operationResponseType: "SankeyResponse", + }, + "SegmentsApi.V2.ListRumSegments": { + operationResponseType: "SegmentArray", + }, + "SegmentsApi.V2.CreateRumSegment": { + body: { + type: "Segment", + format: "", + }, + operationResponseType: "Segment", + }, + "SegmentsApi.V2.InitializeRumSegments": { + operationResponseType: "{}", + }, "ServiceScorecardsApi.V2.ListScorecardOutcomes": { pageSize: { type: "number", diff --git a/services/cohort/.yarnrc.yml b/services/cohort/.yarnrc.yml new file mode 100644 index 000000000000..3186f3f0795a --- /dev/null +++ b/services/cohort/.yarnrc.yml @@ -0,0 +1 @@ +nodeLinker: node-modules diff --git a/services/cohort/README.md b/services/cohort/README.md new file mode 100644 index 000000000000..629bea4a17f5 --- /dev/null +++ b/services/cohort/README.md @@ -0,0 +1,44 @@ +# @datadog/datadog-api-client-cohort + +## Description + +API for Cohort. + +## Navigation + +- [Installation](#installation) +- [Getting Started](#getting-started) + +## Installation + +```sh +# NPM +npm install @datadog/datadog-api-client-cohort +# Yarn +yarn add @datadog/datadog-api-client-cohort +``` + +## Getting Started +```ts +import { createConfiguration } from "@datadog/datadog-api-client"; +import { CohortApiV2 } from "@datadog/datadog-api-client-cohort"; +import { v2 } from "@datadog/datadog-api-client-cohort"; + +const configuration = createConfiguration(); +// Enable unstable operations +const configurationOpts = { + unstableOperations: { + "CohortApi.v2.getRumCohort": true + } +} + +const configuration = createConfiguration(configurationOpts); +const apiInstance = new CohortApiV2(configuration); +const params = {/* parameters */}; + +apiInstance.getRumCohort(params).then((data) => { + console.log("API called successfully. Returned data: " + JSON.stringify(data)); +}).catch((error) => { + console.error("Error calling API: " + error); +}); +``` \ No newline at end of file diff --git a/services/cohort/package.json b/services/cohort/package.json new file mode 100644 index 000000000000..99fe3dea72fa --- /dev/null +++ b/services/cohort/package.json @@ -0,0 +1,43 @@ +{ + "name": "@datadog/datadog-api-client-cohort", + "description": "", + "author": "", + "keywords": [ + "api", + "fetch", + "typescript" + ], + "license": "Apache-2.0", + "licenses": [ + { + "type": "Apache-2.0", + "url": "http://www.apache.org/licenses/LICENSE-2.0" + } + ], + "repository": { + "type": "git", + "url": "https://github.com/DataDog/datadog-api-client-typescript.git", + "directory": "services/cohort" + }, + "files": [ + "dist/**/*" + ], + "main": "./dist/index.js", + "typings": "./dist/index.d.ts", + "scripts": { + "prepack": "yarn workspace @datadog/datadog-api-client build && yarn build", + "build": "yarn generate-version-files && tsc", + "generate-version-files": "node -p \"'export const version = ' + JSON.stringify(require('./package.json').version)\" > src/version.ts" + }, + "dependencies": { + "@datadog/datadog-api-client": "^2.0.0-beta.0" + }, + "devDependencies": { + "typescript": "5.8.3" + }, + "engines": { + "node": ">=18.0.0" + }, + "version": "0.0.1", + "packageManager": "yarn@4.9.1" +} diff --git a/services/cohort/src/index.ts b/services/cohort/src/index.ts new file mode 100644 index 000000000000..d9928334a687 --- /dev/null +++ b/services/cohort/src/index.ts @@ -0,0 +1,3 @@ +export * as v2 from "./v2"; + +export { CohortApi as CohortApiV2 } from "./v2/CohortApi"; diff --git a/services/cohort/src/v2/CohortApi.ts b/services/cohort/src/v2/CohortApi.ts new file mode 100644 index 000000000000..630bac2dda9d --- /dev/null +++ b/services/cohort/src/v2/CohortApi.ts @@ -0,0 +1,329 @@ +import { + ApiException, + BaseAPIRequestFactory, + BaseServerConfiguration, + buildUserAgent, + Configuration, + createConfiguration, + deserialize, + getPreferredMediaType, + HttpMethod, + isBrowser, + logger, + normalizeMediaType, + parse, + RequiredError, + RequestContext, + ResponseContext, + serialize, + ServerConfiguration, + stringify, +} from "@datadog/datadog-api-client"; + +import { TypingInfo } from "./models/TypingInfo"; +import { APIErrorResponse } from "./models/APIErrorResponse"; +import { GetCohortRequest } from "./models/GetCohortRequest"; +import { GetCohortResponse } from "./models/GetCohortResponse"; +import { GetCohortUsersRequest } from "./models/GetCohortUsersRequest"; +import { GetCohortUsersResponse } from "./models/GetCohortUsersResponse"; +import { version } from "../version"; + +export class CohortApiRequestFactory extends BaseAPIRequestFactory { + public userAgent: string | undefined; + + public constructor(configuration: Configuration) { + super(configuration); + if (!isBrowser) { + this.userAgent = buildUserAgent("cohort", version); + } + } + public async getRumCohort( + body: GetCohortRequest, + _options?: Configuration, + ): Promise { + const _config = _options || this.configuration; + + if (!_config.unstableOperations["CohortApi.v2.getRumCohort"]) { + throw new Error( + "Unstable operation 'getRumCohort' is disabled. Enable it by setting `configuration.unstableOperations['CohortApi.v2.getRumCohort'] = true`", + ); + } + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError("body", "getRumCohort"); + } + + // Path Params + const localVarPath = "/api/v2/rum/cohort"; + + // Make Request Context + const { server, overrides } = _config.getServerAndOverrides( + "CohortApi.v2.getRumCohort", + CohortApi.operationServers, + ); + const requestContext = server.makeRequestContext( + localVarPath, + HttpMethod.POST, + overrides, + ); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Set User-Agent + if (this.userAgent) { + requestContext.setHeaderParam("User-Agent", this.userAgent); + } + + // Body Params + const contentType = getPreferredMediaType(["application/json"]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = stringify( + serialize(body, TypingInfo, "GetCohortRequest", ""), + contentType, + ); + requestContext.setBody(serializedBody); + + return requestContext; + } + + public async getRumCohortUsers( + body: GetCohortUsersRequest, + _options?: Configuration, + ): Promise { + const _config = _options || this.configuration; + + if (!_config.unstableOperations["CohortApi.v2.getRumCohortUsers"]) { + throw new Error( + "Unstable operation 'getRumCohortUsers' is disabled. Enable it by setting `configuration.unstableOperations['CohortApi.v2.getRumCohortUsers'] = true`", + ); + } + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError("body", "getRumCohortUsers"); + } + + // Path Params + const localVarPath = "/api/v2/rum/cohort/users"; + + // Make Request Context + const { server, overrides } = _config.getServerAndOverrides( + "CohortApi.v2.getRumCohortUsers", + CohortApi.operationServers, + ); + const requestContext = server.makeRequestContext( + localVarPath, + HttpMethod.POST, + overrides, + ); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Set User-Agent + if (this.userAgent) { + requestContext.setHeaderParam("User-Agent", this.userAgent); + } + + // Body Params + const contentType = getPreferredMediaType(["application/json"]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = stringify( + serialize(body, TypingInfo, "GetCohortUsersRequest", ""), + contentType, + ); + requestContext.setBody(serializedBody); + + return requestContext; + } +} + +export class CohortApiResponseProcessor { + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to getRumCohort + * @throws ApiException if the response code was not in [200, 299] + */ + public async getRumCohort( + response: ResponseContext, + ): Promise { + const contentType = normalizeMediaType(response.headers["content-type"]); + if (response.httpStatusCode === 200) { + const body: GetCohortResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "GetCohortResponse", + ) as GetCohortResponse; + return body; + } + if (response.httpStatusCode === 429) { + const bodyText = parse(await response.body.text(), contentType); + let body: APIErrorResponse; + try { + body = deserialize( + bodyText, + TypingInfo, + "APIErrorResponse", + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText, + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: GetCohortResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "GetCohortResponse", + "", + ) as GetCohortResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"', + ); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to getRumCohortUsers + * @throws ApiException if the response code was not in [200, 299] + */ + public async getRumCohortUsers( + response: ResponseContext, + ): Promise { + const contentType = normalizeMediaType(response.headers["content-type"]); + if (response.httpStatusCode === 200) { + const body: GetCohortUsersResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "GetCohortUsersResponse", + ) as GetCohortUsersResponse; + return body; + } + if (response.httpStatusCode === 429) { + const bodyText = parse(await response.body.text(), contentType); + let body: APIErrorResponse; + try { + body = deserialize( + bodyText, + TypingInfo, + "APIErrorResponse", + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText, + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: GetCohortUsersResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "GetCohortUsersResponse", + "", + ) as GetCohortUsersResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"', + ); + } +} + +export interface CohortApiGetRumCohortRequest { + /** + * @type GetCohortRequest + */ + body: GetCohortRequest; +} + +export interface CohortApiGetRumCohortUsersRequest { + /** + * @type GetCohortUsersRequest + */ + body: GetCohortUsersRequest; +} + +export class CohortApi { + private requestFactory: CohortApiRequestFactory; + private responseProcessor: CohortApiResponseProcessor; + private configuration: Configuration; + + static operationServers: { [key: string]: BaseServerConfiguration[] } = {}; + + public constructor( + configuration?: Configuration, + requestFactory?: CohortApiRequestFactory, + responseProcessor?: CohortApiResponseProcessor, + ) { + this.configuration = configuration || createConfiguration(); + this.requestFactory = + requestFactory || new CohortApiRequestFactory(this.configuration); + this.responseProcessor = + responseProcessor || new CohortApiResponseProcessor(); + } + + /** + * Analyze user cohorts for retention and conversion analysis + * @param param The request object + */ + public getRumCohort( + param: CohortApiGetRumCohortRequest, + options?: Configuration, + ): Promise { + const requestContextPromise = this.requestFactory.getRumCohort( + param.body, + options, + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.getRumCohort(responseContext); + }); + }); + } + + /** + * Get users within a specific cohort for retention analysis + * @param param The request object + */ + public getRumCohortUsers( + param: CohortApiGetRumCohortUsersRequest, + options?: Configuration, + ): Promise { + const requestContextPromise = this.requestFactory.getRumCohortUsers( + param.body, + options, + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.getRumCohortUsers(responseContext); + }); + }); + } +} diff --git a/services/cohort/src/v2/index.ts b/services/cohort/src/v2/index.ts new file mode 100644 index 000000000000..7e05a4df9ffe --- /dev/null +++ b/services/cohort/src/v2/index.ts @@ -0,0 +1,38 @@ +export { + CohortApiGetRumCohortRequest, + CohortApiGetRumCohortUsersRequest, + CohortApi, +} from "./CohortApi"; + +export { APIErrorResponse } from "./models/APIErrorResponse"; +export { GetCohortRequest } from "./models/GetCohortRequest"; +export { GetCohortRequestData } from "./models/GetCohortRequestData"; +export { GetCohortRequestDataAttributes } from "./models/GetCohortRequestDataAttributes"; +export { GetCohortRequestDataAttributesDefinition } from "./models/GetCohortRequestDataAttributesDefinition"; +export { GetCohortRequestDataAttributesDefinitionAudienceFilters } from "./models/GetCohortRequestDataAttributesDefinitionAudienceFilters"; +export { GetCohortRequestDataAttributesDefinitionAudienceFiltersAccountsItems } from "./models/GetCohortRequestDataAttributesDefinitionAudienceFiltersAccountsItems"; +export { GetCohortRequestDataAttributesDefinitionAudienceFiltersSegmentsItems } from "./models/GetCohortRequestDataAttributesDefinitionAudienceFiltersSegmentsItems"; +export { GetCohortRequestDataAttributesDefinitionAudienceFiltersUsersItems } from "./models/GetCohortRequestDataAttributesDefinitionAudienceFiltersUsersItems"; +export { GetCohortRequestDataAttributesTime } from "./models/GetCohortRequestDataAttributesTime"; +export { GetCohortRequestDataType } from "./models/GetCohortRequestDataType"; +export { GetCohortResponse } from "./models/GetCohortResponse"; +export { GetCohortResponseData } from "./models/GetCohortResponseData"; +export { GetCohortResponseDataAttributes } from "./models/GetCohortResponseDataAttributes"; +export { GetCohortResponseDataAttributesCohortsItems } from "./models/GetCohortResponseDataAttributesCohortsItems"; +export { GetCohortResponseDataAttributesCohortsItemsValuesItems } from "./models/GetCohortResponseDataAttributesCohortsItemsValuesItems"; +export { GetCohortResponseDataType } from "./models/GetCohortResponseDataType"; +export { GetCohortUsersRequest } from "./models/GetCohortUsersRequest"; +export { GetCohortUsersRequestData } from "./models/GetCohortUsersRequestData"; +export { GetCohortUsersRequestDataAttributes } from "./models/GetCohortUsersRequestDataAttributes"; +export { GetCohortUsersRequestDataAttributesDefinition } from "./models/GetCohortUsersRequestDataAttributesDefinition"; +export { GetCohortUsersRequestDataAttributesDefinitionAudienceFilters } from "./models/GetCohortUsersRequestDataAttributesDefinitionAudienceFilters"; +export { GetCohortUsersRequestDataAttributesDefinitionAudienceFiltersAccountsItems } from "./models/GetCohortUsersRequestDataAttributesDefinitionAudienceFiltersAccountsItems"; +export { GetCohortUsersRequestDataAttributesDefinitionAudienceFiltersSegmentsItems } from "./models/GetCohortUsersRequestDataAttributesDefinitionAudienceFiltersSegmentsItems"; +export { GetCohortUsersRequestDataAttributesDefinitionAudienceFiltersUsersItems } from "./models/GetCohortUsersRequestDataAttributesDefinitionAudienceFiltersUsersItems"; +export { GetCohortUsersRequestDataAttributesTime } from "./models/GetCohortUsersRequestDataAttributesTime"; +export { GetCohortUsersRequestDataType } from "./models/GetCohortUsersRequestDataType"; +export { GetCohortUsersResponse } from "./models/GetCohortUsersResponse"; +export { GetCohortUsersResponseData } from "./models/GetCohortUsersResponseData"; +export { GetCohortUsersResponseDataAttributes } from "./models/GetCohortUsersResponseDataAttributes"; +export { GetCohortUsersResponseDataAttributesUsersItems } from "./models/GetCohortUsersResponseDataAttributesUsersItems"; +export { GetCohortUsersResponseDataType } from "./models/GetCohortUsersResponseDataType"; diff --git a/services/cohort/src/v2/models/APIErrorResponse.ts b/services/cohort/src/v2/models/APIErrorResponse.ts new file mode 100644 index 000000000000..58d6c35b80f0 --- /dev/null +++ b/services/cohort/src/v2/models/APIErrorResponse.ts @@ -0,0 +1,45 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +/** + * API error response. + */ +export class APIErrorResponse { + /** + * A list of errors. + */ + "errors": Array; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + errors: { + baseName: "errors", + type: "Array", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return APIErrorResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/cohort/src/v2/models/GetCohortRequest.ts b/services/cohort/src/v2/models/GetCohortRequest.ts new file mode 100644 index 000000000000..82f75d4fd652 --- /dev/null +++ b/services/cohort/src/v2/models/GetCohortRequest.ts @@ -0,0 +1,40 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { GetCohortRequestData } from "./GetCohortRequestData"; + +export class GetCohortRequest { + "data"?: GetCohortRequestData; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "GetCohortRequestData", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return GetCohortRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/cohort/src/v2/models/GetCohortRequestData.ts b/services/cohort/src/v2/models/GetCohortRequestData.ts new file mode 100644 index 000000000000..a22ca92e77a1 --- /dev/null +++ b/services/cohort/src/v2/models/GetCohortRequestData.ts @@ -0,0 +1,52 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { GetCohortRequestDataAttributes } from "./GetCohortRequestDataAttributes"; +import { GetCohortRequestDataType } from "./GetCohortRequestDataType"; + +export class GetCohortRequestData { + "attributes"?: GetCohortRequestDataAttributes; + "id"?: string; + "type": GetCohortRequestDataType; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "GetCohortRequestDataAttributes", + }, + id: { + baseName: "id", + type: "string", + }, + type: { + baseName: "type", + type: "GetCohortRequestDataType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return GetCohortRequestData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/cohort/src/v2/models/GetCohortRequestDataAttributes.ts b/services/cohort/src/v2/models/GetCohortRequestDataAttributes.ts new file mode 100644 index 000000000000..e1e7e5b4b8c0 --- /dev/null +++ b/services/cohort/src/v2/models/GetCohortRequestDataAttributes.ts @@ -0,0 +1,66 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { GetCohortRequestDataAttributesDefinition } from "./GetCohortRequestDataAttributesDefinition"; +import { GetCohortRequestDataAttributesTime } from "./GetCohortRequestDataAttributesTime"; + +export class GetCohortRequestDataAttributes { + "dataSource"?: string; + "definition"?: GetCohortRequestDataAttributesDefinition; + "enforcedExecutionType"?: string; + "requestId"?: string; + "time"?: GetCohortRequestDataAttributesTime; + "windowSize"?: string; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + dataSource: { + baseName: "data_source", + type: "string", + }, + definition: { + baseName: "definition", + type: "GetCohortRequestDataAttributesDefinition", + }, + enforcedExecutionType: { + baseName: "enforced_execution_type", + type: "string", + }, + requestId: { + baseName: "request_id", + type: "string", + }, + time: { + baseName: "time", + type: "GetCohortRequestDataAttributesTime", + }, + windowSize: { + baseName: "window_size", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return GetCohortRequestDataAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/cohort/src/v2/models/GetCohortRequestDataAttributesDefinition.ts b/services/cohort/src/v2/models/GetCohortRequestDataAttributesDefinition.ts new file mode 100644 index 000000000000..3959e6cf22b9 --- /dev/null +++ b/services/cohort/src/v2/models/GetCohortRequestDataAttributesDefinition.ts @@ -0,0 +1,55 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { GetCohortRequestDataAttributesDefinitionAudienceFilters } from "./GetCohortRequestDataAttributesDefinitionAudienceFilters"; + +export class GetCohortRequestDataAttributesDefinition { + "audienceFilters"?: GetCohortRequestDataAttributesDefinitionAudienceFilters; + "inclusionSearch"?: string; + "returnSearch"?: string; + "segmentId"?: string; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + audienceFilters: { + baseName: "audience_filters", + type: "GetCohortRequestDataAttributesDefinitionAudienceFilters", + }, + inclusionSearch: { + baseName: "inclusion_search", + type: "string", + }, + returnSearch: { + baseName: "return_search", + type: "string", + }, + segmentId: { + baseName: "segment_id", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return GetCohortRequestDataAttributesDefinition.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/cohort/src/v2/models/GetCohortRequestDataAttributesDefinitionAudienceFilters.ts b/services/cohort/src/v2/models/GetCohortRequestDataAttributesDefinitionAudienceFilters.ts new file mode 100644 index 000000000000..5274b931465b --- /dev/null +++ b/services/cohort/src/v2/models/GetCohortRequestDataAttributesDefinitionAudienceFilters.ts @@ -0,0 +1,57 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { GetCohortRequestDataAttributesDefinitionAudienceFiltersAccountsItems } from "./GetCohortRequestDataAttributesDefinitionAudienceFiltersAccountsItems"; +import { GetCohortRequestDataAttributesDefinitionAudienceFiltersSegmentsItems } from "./GetCohortRequestDataAttributesDefinitionAudienceFiltersSegmentsItems"; +import { GetCohortRequestDataAttributesDefinitionAudienceFiltersUsersItems } from "./GetCohortRequestDataAttributesDefinitionAudienceFiltersUsersItems"; + +export class GetCohortRequestDataAttributesDefinitionAudienceFilters { + "accounts"?: Array; + "formula"?: string; + "segments"?: Array; + "users"?: Array; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + accounts: { + baseName: "accounts", + type: "Array", + }, + formula: { + baseName: "formula", + type: "string", + }, + segments: { + baseName: "segments", + type: "Array", + }, + users: { + baseName: "users", + type: "Array", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return GetCohortRequestDataAttributesDefinitionAudienceFilters.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/cohort/src/v2/models/GetCohortRequestDataAttributesDefinitionAudienceFiltersAccountsItems.ts b/services/cohort/src/v2/models/GetCohortRequestDataAttributesDefinitionAudienceFiltersAccountsItems.ts new file mode 100644 index 000000000000..2119b5542ee9 --- /dev/null +++ b/services/cohort/src/v2/models/GetCohortRequestDataAttributesDefinitionAudienceFiltersAccountsItems.ts @@ -0,0 +1,44 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +export class GetCohortRequestDataAttributesDefinitionAudienceFiltersAccountsItems { + "name": string; + "query"?: string; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + name: { + baseName: "name", + type: "string", + required: true, + }, + query: { + baseName: "query", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return GetCohortRequestDataAttributesDefinitionAudienceFiltersAccountsItems.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/cohort/src/v2/models/GetCohortRequestDataAttributesDefinitionAudienceFiltersSegmentsItems.ts b/services/cohort/src/v2/models/GetCohortRequestDataAttributesDefinitionAudienceFiltersSegmentsItems.ts new file mode 100644 index 000000000000..bd02f26cafe4 --- /dev/null +++ b/services/cohort/src/v2/models/GetCohortRequestDataAttributesDefinitionAudienceFiltersSegmentsItems.ts @@ -0,0 +1,45 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +export class GetCohortRequestDataAttributesDefinitionAudienceFiltersSegmentsItems { + "name": string; + "segmentId": string; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + name: { + baseName: "name", + type: "string", + required: true, + }, + segmentId: { + baseName: "segment_id", + type: "string", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return GetCohortRequestDataAttributesDefinitionAudienceFiltersSegmentsItems.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/cohort/src/v2/models/GetCohortRequestDataAttributesDefinitionAudienceFiltersUsersItems.ts b/services/cohort/src/v2/models/GetCohortRequestDataAttributesDefinitionAudienceFiltersUsersItems.ts new file mode 100644 index 000000000000..afee5e5995f1 --- /dev/null +++ b/services/cohort/src/v2/models/GetCohortRequestDataAttributesDefinitionAudienceFiltersUsersItems.ts @@ -0,0 +1,44 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +export class GetCohortRequestDataAttributesDefinitionAudienceFiltersUsersItems { + "name": string; + "query"?: string; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + name: { + baseName: "name", + type: "string", + required: true, + }, + query: { + baseName: "query", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return GetCohortRequestDataAttributesDefinitionAudienceFiltersUsersItems.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/cohort/src/v2/models/GetCohortRequestDataAttributesTime.ts b/services/cohort/src/v2/models/GetCohortRequestDataAttributesTime.ts new file mode 100644 index 000000000000..ecf221b1663e --- /dev/null +++ b/services/cohort/src/v2/models/GetCohortRequestDataAttributesTime.ts @@ -0,0 +1,45 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +export class GetCohortRequestDataAttributesTime { + "from"?: number; + "to"?: number; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + from: { + baseName: "from", + type: "number", + format: "int64", + }, + to: { + baseName: "to", + type: "number", + format: "int64", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return GetCohortRequestDataAttributesTime.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/cohort/src/v2/models/GetCohortRequestDataType.ts b/services/cohort/src/v2/models/GetCohortRequestDataType.ts new file mode 100644 index 000000000000..ec5dd1baaf48 --- /dev/null +++ b/services/cohort/src/v2/models/GetCohortRequestDataType.ts @@ -0,0 +1,3 @@ +import { UnparsedObject } from "@datadog/datadog-api-client"; +export type GetCohortRequestDataType = typeof COHORT_REQUEST | UnparsedObject; +export const COHORT_REQUEST = "cohort_request"; diff --git a/services/cohort/src/v2/models/GetCohortResponse.ts b/services/cohort/src/v2/models/GetCohortResponse.ts new file mode 100644 index 000000000000..94fa57f01e6f --- /dev/null +++ b/services/cohort/src/v2/models/GetCohortResponse.ts @@ -0,0 +1,40 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { GetCohortResponseData } from "./GetCohortResponseData"; + +export class GetCohortResponse { + "data"?: GetCohortResponseData; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "GetCohortResponseData", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return GetCohortResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/cohort/src/v2/models/GetCohortResponseData.ts b/services/cohort/src/v2/models/GetCohortResponseData.ts new file mode 100644 index 000000000000..dd8532ac67ed --- /dev/null +++ b/services/cohort/src/v2/models/GetCohortResponseData.ts @@ -0,0 +1,52 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { GetCohortResponseDataAttributes } from "./GetCohortResponseDataAttributes"; +import { GetCohortResponseDataType } from "./GetCohortResponseDataType"; + +export class GetCohortResponseData { + "attributes"?: GetCohortResponseDataAttributes; + "id"?: string; + "type": GetCohortResponseDataType; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "GetCohortResponseDataAttributes", + }, + id: { + baseName: "id", + type: "string", + }, + type: { + baseName: "type", + type: "GetCohortResponseDataType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return GetCohortResponseData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/cohort/src/v2/models/GetCohortResponseDataAttributes.ts b/services/cohort/src/v2/models/GetCohortResponseDataAttributes.ts new file mode 100644 index 000000000000..01a74165f83c --- /dev/null +++ b/services/cohort/src/v2/models/GetCohortResponseDataAttributes.ts @@ -0,0 +1,40 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { GetCohortResponseDataAttributesCohortsItems } from "./GetCohortResponseDataAttributesCohortsItems"; + +export class GetCohortResponseDataAttributes { + "cohorts"?: Array; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + cohorts: { + baseName: "cohorts", + type: "Array", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return GetCohortResponseDataAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/cohort/src/v2/models/GetCohortResponseDataAttributesCohortsItems.ts b/services/cohort/src/v2/models/GetCohortResponseDataAttributesCohortsItems.ts new file mode 100644 index 000000000000..c481f05fabaa --- /dev/null +++ b/services/cohort/src/v2/models/GetCohortResponseDataAttributesCohortsItems.ts @@ -0,0 +1,57 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { GetCohortResponseDataAttributesCohortsItemsValuesItems } from "./GetCohortResponseDataAttributesCohortsItemsValuesItems"; + +export class GetCohortResponseDataAttributesCohortsItems { + "cohort"?: string; + "cohortSize"?: number; + "startTime"?: number; + "values"?: Array; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + cohort: { + baseName: "cohort", + type: "string", + }, + cohortSize: { + baseName: "cohort_size", + type: "number", + format: "int64", + }, + startTime: { + baseName: "start_time", + type: "number", + format: "int64", + }, + values: { + baseName: "values", + type: "Array", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return GetCohortResponseDataAttributesCohortsItems.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/cohort/src/v2/models/GetCohortResponseDataAttributesCohortsItemsValuesItems.ts b/services/cohort/src/v2/models/GetCohortResponseDataAttributesCohortsItemsValuesItems.ts new file mode 100644 index 000000000000..d7d8f471a093 --- /dev/null +++ b/services/cohort/src/v2/models/GetCohortResponseDataAttributesCohortsItemsValuesItems.ts @@ -0,0 +1,63 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +export class GetCohortResponseDataAttributesCohortsItemsValuesItems { + "absoluteValue"?: number; + "endTime"?: number; + "relativeValue"?: number; + "startTime"?: number; + "window"?: number; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + absoluteValue: { + baseName: "absolute_value", + type: "number", + format: "int64", + }, + endTime: { + baseName: "end_time", + type: "number", + format: "int64", + }, + relativeValue: { + baseName: "relative_value", + type: "number", + format: "double", + }, + startTime: { + baseName: "start_time", + type: "number", + format: "int64", + }, + window: { + baseName: "window", + type: "number", + format: "int64", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return GetCohortResponseDataAttributesCohortsItemsValuesItems.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/cohort/src/v2/models/GetCohortResponseDataType.ts b/services/cohort/src/v2/models/GetCohortResponseDataType.ts new file mode 100644 index 000000000000..85f0cc8a221a --- /dev/null +++ b/services/cohort/src/v2/models/GetCohortResponseDataType.ts @@ -0,0 +1,3 @@ +import { UnparsedObject } from "@datadog/datadog-api-client"; +export type GetCohortResponseDataType = typeof COHORT_RESPONSE | UnparsedObject; +export const COHORT_RESPONSE = "cohort_response"; diff --git a/services/cohort/src/v2/models/GetCohortUsersRequest.ts b/services/cohort/src/v2/models/GetCohortUsersRequest.ts new file mode 100644 index 000000000000..bd3545d6ec50 --- /dev/null +++ b/services/cohort/src/v2/models/GetCohortUsersRequest.ts @@ -0,0 +1,40 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { GetCohortUsersRequestData } from "./GetCohortUsersRequestData"; + +export class GetCohortUsersRequest { + "data"?: GetCohortUsersRequestData; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "GetCohortUsersRequestData", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return GetCohortUsersRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/cohort/src/v2/models/GetCohortUsersRequestData.ts b/services/cohort/src/v2/models/GetCohortUsersRequestData.ts new file mode 100644 index 000000000000..6785f1f733f5 --- /dev/null +++ b/services/cohort/src/v2/models/GetCohortUsersRequestData.ts @@ -0,0 +1,52 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { GetCohortUsersRequestDataAttributes } from "./GetCohortUsersRequestDataAttributes"; +import { GetCohortUsersRequestDataType } from "./GetCohortUsersRequestDataType"; + +export class GetCohortUsersRequestData { + "attributes"?: GetCohortUsersRequestDataAttributes; + "id"?: string; + "type": GetCohortUsersRequestDataType; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "GetCohortUsersRequestDataAttributes", + }, + id: { + baseName: "id", + type: "string", + }, + type: { + baseName: "type", + type: "GetCohortUsersRequestDataType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return GetCohortUsersRequestData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/cohort/src/v2/models/GetCohortUsersRequestDataAttributes.ts b/services/cohort/src/v2/models/GetCohortUsersRequestDataAttributes.ts new file mode 100644 index 000000000000..ab8392c41850 --- /dev/null +++ b/services/cohort/src/v2/models/GetCohortUsersRequestDataAttributes.ts @@ -0,0 +1,67 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { GetCohortUsersRequestDataAttributesDefinition } from "./GetCohortUsersRequestDataAttributesDefinition"; +import { GetCohortUsersRequestDataAttributesTime } from "./GetCohortUsersRequestDataAttributesTime"; + +export class GetCohortUsersRequestDataAttributes { + "dataSource"?: string; + "definition"?: GetCohortUsersRequestDataAttributesDefinition; + "execution"?: number; + "time"?: GetCohortUsersRequestDataAttributesTime; + "userSelection"?: string; + "windowSize"?: string; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + dataSource: { + baseName: "data_source", + type: "string", + }, + definition: { + baseName: "definition", + type: "GetCohortUsersRequestDataAttributesDefinition", + }, + execution: { + baseName: "execution", + type: "number", + format: "int64", + }, + time: { + baseName: "time", + type: "GetCohortUsersRequestDataAttributesTime", + }, + userSelection: { + baseName: "user_selection", + type: "string", + }, + windowSize: { + baseName: "window_size", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return GetCohortUsersRequestDataAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/cohort/src/v2/models/GetCohortUsersRequestDataAttributesDefinition.ts b/services/cohort/src/v2/models/GetCohortUsersRequestDataAttributesDefinition.ts new file mode 100644 index 000000000000..a597225b55e6 --- /dev/null +++ b/services/cohort/src/v2/models/GetCohortUsersRequestDataAttributesDefinition.ts @@ -0,0 +1,66 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { GetCohortUsersRequestDataAttributesDefinitionAudienceFilters } from "./GetCohortUsersRequestDataAttributesDefinitionAudienceFilters"; + +export class GetCohortUsersRequestDataAttributesDefinition { + "audienceFilters"?: GetCohortUsersRequestDataAttributesDefinitionAudienceFilters; + "cohort"?: string; + "inclusionSearch"?: string; + "returnSearch"?: string; + "segmentId"?: string; + "window"?: number; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + audienceFilters: { + baseName: "audience_filters", + type: "GetCohortUsersRequestDataAttributesDefinitionAudienceFilters", + }, + cohort: { + baseName: "cohort", + type: "string", + }, + inclusionSearch: { + baseName: "inclusion_search", + type: "string", + }, + returnSearch: { + baseName: "return_search", + type: "string", + }, + segmentId: { + baseName: "segment_id", + type: "string", + }, + window: { + baseName: "window", + type: "number", + format: "int64", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return GetCohortUsersRequestDataAttributesDefinition.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/cohort/src/v2/models/GetCohortUsersRequestDataAttributesDefinitionAudienceFilters.ts b/services/cohort/src/v2/models/GetCohortUsersRequestDataAttributesDefinitionAudienceFilters.ts new file mode 100644 index 000000000000..7bf7c3fd35db --- /dev/null +++ b/services/cohort/src/v2/models/GetCohortUsersRequestDataAttributesDefinitionAudienceFilters.ts @@ -0,0 +1,57 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { GetCohortUsersRequestDataAttributesDefinitionAudienceFiltersAccountsItems } from "./GetCohortUsersRequestDataAttributesDefinitionAudienceFiltersAccountsItems"; +import { GetCohortUsersRequestDataAttributesDefinitionAudienceFiltersSegmentsItems } from "./GetCohortUsersRequestDataAttributesDefinitionAudienceFiltersSegmentsItems"; +import { GetCohortUsersRequestDataAttributesDefinitionAudienceFiltersUsersItems } from "./GetCohortUsersRequestDataAttributesDefinitionAudienceFiltersUsersItems"; + +export class GetCohortUsersRequestDataAttributesDefinitionAudienceFilters { + "accounts"?: Array; + "formula"?: string; + "segments"?: Array; + "users"?: Array; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + accounts: { + baseName: "accounts", + type: "Array", + }, + formula: { + baseName: "formula", + type: "string", + }, + segments: { + baseName: "segments", + type: "Array", + }, + users: { + baseName: "users", + type: "Array", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return GetCohortUsersRequestDataAttributesDefinitionAudienceFilters.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/cohort/src/v2/models/GetCohortUsersRequestDataAttributesDefinitionAudienceFiltersAccountsItems.ts b/services/cohort/src/v2/models/GetCohortUsersRequestDataAttributesDefinitionAudienceFiltersAccountsItems.ts new file mode 100644 index 000000000000..b52031d0cf2d --- /dev/null +++ b/services/cohort/src/v2/models/GetCohortUsersRequestDataAttributesDefinitionAudienceFiltersAccountsItems.ts @@ -0,0 +1,44 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +export class GetCohortUsersRequestDataAttributesDefinitionAudienceFiltersAccountsItems { + "name": string; + "query"?: string; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + name: { + baseName: "name", + type: "string", + required: true, + }, + query: { + baseName: "query", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return GetCohortUsersRequestDataAttributesDefinitionAudienceFiltersAccountsItems.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/cohort/src/v2/models/GetCohortUsersRequestDataAttributesDefinitionAudienceFiltersSegmentsItems.ts b/services/cohort/src/v2/models/GetCohortUsersRequestDataAttributesDefinitionAudienceFiltersSegmentsItems.ts new file mode 100644 index 000000000000..97e52d5694be --- /dev/null +++ b/services/cohort/src/v2/models/GetCohortUsersRequestDataAttributesDefinitionAudienceFiltersSegmentsItems.ts @@ -0,0 +1,45 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +export class GetCohortUsersRequestDataAttributesDefinitionAudienceFiltersSegmentsItems { + "name": string; + "segmentId": string; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + name: { + baseName: "name", + type: "string", + required: true, + }, + segmentId: { + baseName: "segment_id", + type: "string", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return GetCohortUsersRequestDataAttributesDefinitionAudienceFiltersSegmentsItems.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/cohort/src/v2/models/GetCohortUsersRequestDataAttributesDefinitionAudienceFiltersUsersItems.ts b/services/cohort/src/v2/models/GetCohortUsersRequestDataAttributesDefinitionAudienceFiltersUsersItems.ts new file mode 100644 index 000000000000..ff255de1b8ca --- /dev/null +++ b/services/cohort/src/v2/models/GetCohortUsersRequestDataAttributesDefinitionAudienceFiltersUsersItems.ts @@ -0,0 +1,44 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +export class GetCohortUsersRequestDataAttributesDefinitionAudienceFiltersUsersItems { + "name": string; + "query"?: string; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + name: { + baseName: "name", + type: "string", + required: true, + }, + query: { + baseName: "query", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return GetCohortUsersRequestDataAttributesDefinitionAudienceFiltersUsersItems.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/cohort/src/v2/models/GetCohortUsersRequestDataAttributesTime.ts b/services/cohort/src/v2/models/GetCohortUsersRequestDataAttributesTime.ts new file mode 100644 index 000000000000..5327379774bd --- /dev/null +++ b/services/cohort/src/v2/models/GetCohortUsersRequestDataAttributesTime.ts @@ -0,0 +1,45 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +export class GetCohortUsersRequestDataAttributesTime { + "from"?: number; + "to"?: number; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + from: { + baseName: "from", + type: "number", + format: "int64", + }, + to: { + baseName: "to", + type: "number", + format: "int64", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return GetCohortUsersRequestDataAttributesTime.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/cohort/src/v2/models/GetCohortUsersRequestDataType.ts b/services/cohort/src/v2/models/GetCohortUsersRequestDataType.ts new file mode 100644 index 000000000000..d44c421e522a --- /dev/null +++ b/services/cohort/src/v2/models/GetCohortUsersRequestDataType.ts @@ -0,0 +1,5 @@ +import { UnparsedObject } from "@datadog/datadog-api-client"; +export type GetCohortUsersRequestDataType = + | typeof COHORT_USERS_REQUEST + | UnparsedObject; +export const COHORT_USERS_REQUEST = "cohort_users_request"; diff --git a/services/cohort/src/v2/models/GetCohortUsersResponse.ts b/services/cohort/src/v2/models/GetCohortUsersResponse.ts new file mode 100644 index 000000000000..f962b32c2d6a --- /dev/null +++ b/services/cohort/src/v2/models/GetCohortUsersResponse.ts @@ -0,0 +1,40 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { GetCohortUsersResponseData } from "./GetCohortUsersResponseData"; + +export class GetCohortUsersResponse { + "data"?: GetCohortUsersResponseData; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "GetCohortUsersResponseData", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return GetCohortUsersResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/cohort/src/v2/models/GetCohortUsersResponseData.ts b/services/cohort/src/v2/models/GetCohortUsersResponseData.ts new file mode 100644 index 000000000000..dcb89a2212f9 --- /dev/null +++ b/services/cohort/src/v2/models/GetCohortUsersResponseData.ts @@ -0,0 +1,52 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { GetCohortUsersResponseDataAttributes } from "./GetCohortUsersResponseDataAttributes"; +import { GetCohortUsersResponseDataType } from "./GetCohortUsersResponseDataType"; + +export class GetCohortUsersResponseData { + "attributes"?: GetCohortUsersResponseDataAttributes; + "id"?: string; + "type": GetCohortUsersResponseDataType; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "GetCohortUsersResponseDataAttributes", + }, + id: { + baseName: "id", + type: "string", + }, + type: { + baseName: "type", + type: "GetCohortUsersResponseDataType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return GetCohortUsersResponseData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/cohort/src/v2/models/GetCohortUsersResponseDataAttributes.ts b/services/cohort/src/v2/models/GetCohortUsersResponseDataAttributes.ts new file mode 100644 index 000000000000..4d9ce0a41af4 --- /dev/null +++ b/services/cohort/src/v2/models/GetCohortUsersResponseDataAttributes.ts @@ -0,0 +1,40 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { GetCohortUsersResponseDataAttributesUsersItems } from "./GetCohortUsersResponseDataAttributesUsersItems"; + +export class GetCohortUsersResponseDataAttributes { + "users"?: Array; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + users: { + baseName: "users", + type: "Array", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return GetCohortUsersResponseDataAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/cohort/src/v2/models/GetCohortUsersResponseDataAttributesUsersItems.ts b/services/cohort/src/v2/models/GetCohortUsersResponseDataAttributesUsersItems.ts new file mode 100644 index 000000000000..1365705cef8a --- /dev/null +++ b/services/cohort/src/v2/models/GetCohortUsersResponseDataAttributesUsersItems.ts @@ -0,0 +1,48 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +export class GetCohortUsersResponseDataAttributesUsersItems { + "email"?: string; + "id"?: string; + "name"?: string; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + email: { + baseName: "email", + type: "string", + }, + id: { + baseName: "id", + type: "string", + }, + name: { + baseName: "name", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return GetCohortUsersResponseDataAttributesUsersItems.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/cohort/src/v2/models/GetCohortUsersResponseDataType.ts b/services/cohort/src/v2/models/GetCohortUsersResponseDataType.ts new file mode 100644 index 000000000000..752b70076071 --- /dev/null +++ b/services/cohort/src/v2/models/GetCohortUsersResponseDataType.ts @@ -0,0 +1,5 @@ +import { UnparsedObject } from "@datadog/datadog-api-client"; +export type GetCohortUsersResponseDataType = + | typeof COHORT_USERS_RESPONSE + | UnparsedObject; +export const COHORT_USERS_RESPONSE = "cohort_users_response"; diff --git a/services/cohort/src/v2/models/TypingInfo.ts b/services/cohort/src/v2/models/TypingInfo.ts new file mode 100644 index 000000000000..ec72a8d33328 --- /dev/null +++ b/services/cohort/src/v2/models/TypingInfo.ts @@ -0,0 +1,84 @@ +import { ModelTypingInfo } from "@datadog/datadog-api-client"; + +import { APIErrorResponse } from "./APIErrorResponse"; +import { GetCohortRequest } from "./GetCohortRequest"; +import { GetCohortRequestData } from "./GetCohortRequestData"; +import { GetCohortRequestDataAttributes } from "./GetCohortRequestDataAttributes"; +import { GetCohortRequestDataAttributesDefinition } from "./GetCohortRequestDataAttributesDefinition"; +import { GetCohortRequestDataAttributesDefinitionAudienceFilters } from "./GetCohortRequestDataAttributesDefinitionAudienceFilters"; +import { GetCohortRequestDataAttributesDefinitionAudienceFiltersAccountsItems } from "./GetCohortRequestDataAttributesDefinitionAudienceFiltersAccountsItems"; +import { GetCohortRequestDataAttributesDefinitionAudienceFiltersSegmentsItems } from "./GetCohortRequestDataAttributesDefinitionAudienceFiltersSegmentsItems"; +import { GetCohortRequestDataAttributesDefinitionAudienceFiltersUsersItems } from "./GetCohortRequestDataAttributesDefinitionAudienceFiltersUsersItems"; +import { GetCohortRequestDataAttributesTime } from "./GetCohortRequestDataAttributesTime"; +import { GetCohortResponse } from "./GetCohortResponse"; +import { GetCohortResponseData } from "./GetCohortResponseData"; +import { GetCohortResponseDataAttributes } from "./GetCohortResponseDataAttributes"; +import { GetCohortResponseDataAttributesCohortsItems } from "./GetCohortResponseDataAttributesCohortsItems"; +import { GetCohortResponseDataAttributesCohortsItemsValuesItems } from "./GetCohortResponseDataAttributesCohortsItemsValuesItems"; +import { GetCohortUsersRequest } from "./GetCohortUsersRequest"; +import { GetCohortUsersRequestData } from "./GetCohortUsersRequestData"; +import { GetCohortUsersRequestDataAttributes } from "./GetCohortUsersRequestDataAttributes"; +import { GetCohortUsersRequestDataAttributesDefinition } from "./GetCohortUsersRequestDataAttributesDefinition"; +import { GetCohortUsersRequestDataAttributesDefinitionAudienceFilters } from "./GetCohortUsersRequestDataAttributesDefinitionAudienceFilters"; +import { GetCohortUsersRequestDataAttributesDefinitionAudienceFiltersAccountsItems } from "./GetCohortUsersRequestDataAttributesDefinitionAudienceFiltersAccountsItems"; +import { GetCohortUsersRequestDataAttributesDefinitionAudienceFiltersSegmentsItems } from "./GetCohortUsersRequestDataAttributesDefinitionAudienceFiltersSegmentsItems"; +import { GetCohortUsersRequestDataAttributesDefinitionAudienceFiltersUsersItems } from "./GetCohortUsersRequestDataAttributesDefinitionAudienceFiltersUsersItems"; +import { GetCohortUsersRequestDataAttributesTime } from "./GetCohortUsersRequestDataAttributesTime"; +import { GetCohortUsersResponse } from "./GetCohortUsersResponse"; +import { GetCohortUsersResponseData } from "./GetCohortUsersResponseData"; +import { GetCohortUsersResponseDataAttributes } from "./GetCohortUsersResponseDataAttributes"; +import { GetCohortUsersResponseDataAttributesUsersItems } from "./GetCohortUsersResponseDataAttributesUsersItems"; + +export const TypingInfo: ModelTypingInfo = { + enumsMap: { + GetCohortRequestDataType: ["cohort_request"], + GetCohortResponseDataType: ["cohort_response"], + GetCohortUsersRequestDataType: ["cohort_users_request"], + GetCohortUsersResponseDataType: ["cohort_users_response"], + }, + oneOfMap: {}, + typeMap: { + APIErrorResponse: APIErrorResponse, + GetCohortRequest: GetCohortRequest, + GetCohortRequestData: GetCohortRequestData, + GetCohortRequestDataAttributes: GetCohortRequestDataAttributes, + GetCohortRequestDataAttributesDefinition: + GetCohortRequestDataAttributesDefinition, + GetCohortRequestDataAttributesDefinitionAudienceFilters: + GetCohortRequestDataAttributesDefinitionAudienceFilters, + GetCohortRequestDataAttributesDefinitionAudienceFiltersAccountsItems: + GetCohortRequestDataAttributesDefinitionAudienceFiltersAccountsItems, + GetCohortRequestDataAttributesDefinitionAudienceFiltersSegmentsItems: + GetCohortRequestDataAttributesDefinitionAudienceFiltersSegmentsItems, + GetCohortRequestDataAttributesDefinitionAudienceFiltersUsersItems: + GetCohortRequestDataAttributesDefinitionAudienceFiltersUsersItems, + GetCohortRequestDataAttributesTime: GetCohortRequestDataAttributesTime, + GetCohortResponse: GetCohortResponse, + GetCohortResponseData: GetCohortResponseData, + GetCohortResponseDataAttributes: GetCohortResponseDataAttributes, + GetCohortResponseDataAttributesCohortsItems: + GetCohortResponseDataAttributesCohortsItems, + GetCohortResponseDataAttributesCohortsItemsValuesItems: + GetCohortResponseDataAttributesCohortsItemsValuesItems, + GetCohortUsersRequest: GetCohortUsersRequest, + GetCohortUsersRequestData: GetCohortUsersRequestData, + GetCohortUsersRequestDataAttributes: GetCohortUsersRequestDataAttributes, + GetCohortUsersRequestDataAttributesDefinition: + GetCohortUsersRequestDataAttributesDefinition, + GetCohortUsersRequestDataAttributesDefinitionAudienceFilters: + GetCohortUsersRequestDataAttributesDefinitionAudienceFilters, + GetCohortUsersRequestDataAttributesDefinitionAudienceFiltersAccountsItems: + GetCohortUsersRequestDataAttributesDefinitionAudienceFiltersAccountsItems, + GetCohortUsersRequestDataAttributesDefinitionAudienceFiltersSegmentsItems: + GetCohortUsersRequestDataAttributesDefinitionAudienceFiltersSegmentsItems, + GetCohortUsersRequestDataAttributesDefinitionAudienceFiltersUsersItems: + GetCohortUsersRequestDataAttributesDefinitionAudienceFiltersUsersItems, + GetCohortUsersRequestDataAttributesTime: + GetCohortUsersRequestDataAttributesTime, + GetCohortUsersResponse: GetCohortUsersResponse, + GetCohortUsersResponseData: GetCohortUsersResponseData, + GetCohortUsersResponseDataAttributes: GetCohortUsersResponseDataAttributes, + GetCohortUsersResponseDataAttributesUsersItems: + GetCohortUsersResponseDataAttributesUsersItems, + }, +}; diff --git a/services/cohort/tsconfig.json b/services/cohort/tsconfig.json new file mode 100644 index 000000000000..d6c32bfb893c --- /dev/null +++ b/services/cohort/tsconfig.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "strict": true, + /* Basic Options */ + "target": "es6", + "module": "commonjs", + "moduleResolution": "node", + "declaration": true, + + "esModuleInterop": true, + "resolveJsonModule": true, + + "noImplicitAny": true, + "noImplicitThis": true, + + /* Additional Checks */ + "noUnusedLocals": false /* Report errors on unused locals. */, // TODO: reenable (unused imports!) + "noUnusedParameters": false /* Report errors on unused parameters. */, // TODO: set to true again + "noImplicitReturns": true /* Report error when not all code paths in function return a value. */, + "noFallthroughCasesInSwitch": true /* Report errors for fallthrough cases in switch statement. */, + + "sourceMap": true, + "outDir": "./dist", + "lib": ["es6", "es7"] + }, + "exclude": ["dist", "node_modules", "tests"], + "include": ["src"] +} diff --git a/services/funnel/.yarnrc.yml b/services/funnel/.yarnrc.yml new file mode 100644 index 000000000000..3186f3f0795a --- /dev/null +++ b/services/funnel/.yarnrc.yml @@ -0,0 +1 @@ +nodeLinker: node-modules diff --git a/services/funnel/README.md b/services/funnel/README.md new file mode 100644 index 000000000000..538b7d60fda4 --- /dev/null +++ b/services/funnel/README.md @@ -0,0 +1,44 @@ +# @datadog/datadog-api-client-funnel + +## Description + +API for funnel. + +## Navigation + +- [Installation](#installation) +- [Getting Started](#getting-started) + +## Installation + +```sh +# NPM +npm install @datadog/datadog-api-client-funnel +# Yarn +yarn add @datadog/datadog-api-client-funnel +``` + +## Getting Started +```ts +import { createConfiguration } from "@datadog/datadog-api-client"; +import { FunnelApiV2 } from "@datadog/datadog-api-client-funnel"; +import { v2 } from "@datadog/datadog-api-client-funnel"; + +const configuration = createConfiguration(); +// Enable unstable operations +const configurationOpts = { + unstableOperations: { + "FunnelApi.v2.getRumFunnel": true + } +} + +const configuration = createConfiguration(configurationOpts); +const apiInstance = new FunnelApiV2(configuration); +const params = {/* parameters */}; + +apiInstance.getRumFunnel(params).then((data) => { + console.log("API called successfully. Returned data: " + JSON.stringify(data)); +}).catch((error) => { + console.error("Error calling API: " + error); +}); +``` \ No newline at end of file diff --git a/services/funnel/package.json b/services/funnel/package.json new file mode 100644 index 000000000000..f71dc1a63d25 --- /dev/null +++ b/services/funnel/package.json @@ -0,0 +1,43 @@ +{ + "name": "@datadog/datadog-api-client-funnel", + "description": "", + "author": "", + "keywords": [ + "api", + "fetch", + "typescript" + ], + "license": "Apache-2.0", + "licenses": [ + { + "type": "Apache-2.0", + "url": "http://www.apache.org/licenses/LICENSE-2.0" + } + ], + "repository": { + "type": "git", + "url": "https://github.com/DataDog/datadog-api-client-typescript.git", + "directory": "services/funnel" + }, + "files": [ + "dist/**/*" + ], + "main": "./dist/index.js", + "typings": "./dist/index.d.ts", + "scripts": { + "prepack": "yarn workspace @datadog/datadog-api-client build && yarn build", + "build": "yarn generate-version-files && tsc", + "generate-version-files": "node -p \"'export const version = ' + JSON.stringify(require('./package.json').version)\" > src/version.ts" + }, + "dependencies": { + "@datadog/datadog-api-client": "^2.0.0-beta.0" + }, + "devDependencies": { + "typescript": "5.8.3" + }, + "engines": { + "node": ">=18.0.0" + }, + "version": "0.0.1", + "packageManager": "yarn@4.9.1" +} diff --git a/services/funnel/src/index.ts b/services/funnel/src/index.ts new file mode 100644 index 000000000000..34ce3d6b6cbb --- /dev/null +++ b/services/funnel/src/index.ts @@ -0,0 +1,3 @@ +export * as v2 from "./v2"; + +export { FunnelApi as FunnelApiV2 } from "./v2/FunnelApi"; diff --git a/services/funnel/src/v2/FunnelApi.ts b/services/funnel/src/v2/FunnelApi.ts new file mode 100644 index 000000000000..32cc841572a4 --- /dev/null +++ b/services/funnel/src/v2/FunnelApi.ts @@ -0,0 +1,331 @@ +import { + ApiException, + BaseAPIRequestFactory, + BaseServerConfiguration, + buildUserAgent, + Configuration, + createConfiguration, + deserialize, + getPreferredMediaType, + HttpMethod, + isBrowser, + logger, + normalizeMediaType, + parse, + RequiredError, + RequestContext, + ResponseContext, + serialize, + ServerConfiguration, + stringify, +} from "@datadog/datadog-api-client"; + +import { TypingInfo } from "./models/TypingInfo"; +import { APIErrorResponse } from "./models/APIErrorResponse"; +import { FunnelRequest } from "./models/FunnelRequest"; +import { FunnelResponse } from "./models/FunnelResponse"; +import { FunnelSuggestionRequest } from "./models/FunnelSuggestionRequest"; +import { FunnelSuggestionResponse } from "./models/FunnelSuggestionResponse"; +import { version } from "../version"; + +export class FunnelApiRequestFactory extends BaseAPIRequestFactory { + public userAgent: string | undefined; + + public constructor(configuration: Configuration) { + super(configuration); + if (!isBrowser) { + this.userAgent = buildUserAgent("funnel", version); + } + } + public async getRumFunnel( + body: FunnelRequest, + _options?: Configuration, + ): Promise { + const _config = _options || this.configuration; + + if (!_config.unstableOperations["FunnelApi.v2.getRumFunnel"]) { + throw new Error( + "Unstable operation 'getRumFunnel' is disabled. Enable it by setting `configuration.unstableOperations['FunnelApi.v2.getRumFunnel'] = true`", + ); + } + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError("body", "getRumFunnel"); + } + + // Path Params + const localVarPath = "/api/v2/rum/funnel"; + + // Make Request Context + const { server, overrides } = _config.getServerAndOverrides( + "FunnelApi.v2.getRumFunnel", + FunnelApi.operationServers, + ); + const requestContext = server.makeRequestContext( + localVarPath, + HttpMethod.POST, + overrides, + ); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Set User-Agent + if (this.userAgent) { + requestContext.setHeaderParam("User-Agent", this.userAgent); + } + + // Body Params + const contentType = getPreferredMediaType(["application/json"]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = stringify( + serialize(body, TypingInfo, "FunnelRequest", ""), + contentType, + ); + requestContext.setBody(serializedBody); + + return requestContext; + } + + public async getRumFunnelStepSuggestions( + body: FunnelSuggestionRequest, + _options?: Configuration, + ): Promise { + const _config = _options || this.configuration; + + if ( + !_config.unstableOperations["FunnelApi.v2.getRumFunnelStepSuggestions"] + ) { + throw new Error( + "Unstable operation 'getRumFunnelStepSuggestions' is disabled. Enable it by setting `configuration.unstableOperations['FunnelApi.v2.getRumFunnelStepSuggestions'] = true`", + ); + } + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError("body", "getRumFunnelStepSuggestions"); + } + + // Path Params + const localVarPath = "/api/v2/rum/funnel/new_step_suggestions"; + + // Make Request Context + const { server, overrides } = _config.getServerAndOverrides( + "FunnelApi.v2.getRumFunnelStepSuggestions", + FunnelApi.operationServers, + ); + const requestContext = server.makeRequestContext( + localVarPath, + HttpMethod.POST, + overrides, + ); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Set User-Agent + if (this.userAgent) { + requestContext.setHeaderParam("User-Agent", this.userAgent); + } + + // Body Params + const contentType = getPreferredMediaType(["application/json"]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = stringify( + serialize(body, TypingInfo, "FunnelSuggestionRequest", ""), + contentType, + ); + requestContext.setBody(serializedBody); + + return requestContext; + } +} + +export class FunnelApiResponseProcessor { + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to getRumFunnel + * @throws ApiException if the response code was not in [200, 299] + */ + public async getRumFunnel( + response: ResponseContext, + ): Promise { + const contentType = normalizeMediaType(response.headers["content-type"]); + if (response.httpStatusCode === 200) { + const body: FunnelResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "FunnelResponse", + ) as FunnelResponse; + return body; + } + if (response.httpStatusCode === 429) { + const bodyText = parse(await response.body.text(), contentType); + let body: APIErrorResponse; + try { + body = deserialize( + bodyText, + TypingInfo, + "APIErrorResponse", + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText, + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: FunnelResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "FunnelResponse", + "", + ) as FunnelResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"', + ); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to getRumFunnelStepSuggestions + * @throws ApiException if the response code was not in [200, 299] + */ + public async getRumFunnelStepSuggestions( + response: ResponseContext, + ): Promise { + const contentType = normalizeMediaType(response.headers["content-type"]); + if (response.httpStatusCode === 200) { + const body: FunnelSuggestionResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "FunnelSuggestionResponse", + ) as FunnelSuggestionResponse; + return body; + } + if (response.httpStatusCode === 429) { + const bodyText = parse(await response.body.text(), contentType); + let body: APIErrorResponse; + try { + body = deserialize( + bodyText, + TypingInfo, + "APIErrorResponse", + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText, + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: FunnelSuggestionResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "FunnelSuggestionResponse", + "", + ) as FunnelSuggestionResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"', + ); + } +} + +export interface FunnelApiGetRumFunnelRequest { + /** + * @type FunnelRequest + */ + body: FunnelRequest; +} + +export interface FunnelApiGetRumFunnelStepSuggestionsRequest { + /** + * @type FunnelSuggestionRequest + */ + body: FunnelSuggestionRequest; +} + +export class FunnelApi { + private requestFactory: FunnelApiRequestFactory; + private responseProcessor: FunnelApiResponseProcessor; + private configuration: Configuration; + + static operationServers: { [key: string]: BaseServerConfiguration[] } = {}; + + public constructor( + configuration?: Configuration, + requestFactory?: FunnelApiRequestFactory, + responseProcessor?: FunnelApiResponseProcessor, + ) { + this.configuration = configuration || createConfiguration(); + this.requestFactory = + requestFactory || new FunnelApiRequestFactory(this.configuration); + this.responseProcessor = + responseProcessor || new FunnelApiResponseProcessor(); + } + + /** + * Analyze conversion funnels to understand user drop-off patterns + * @param param The request object + */ + public getRumFunnel( + param: FunnelApiGetRumFunnelRequest, + options?: Configuration, + ): Promise { + const requestContextPromise = this.requestFactory.getRumFunnel( + param.body, + options, + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.getRumFunnel(responseContext); + }); + }); + } + + /** + * Get suggested steps for building conversion funnels + * @param param The request object + */ + public getRumFunnelStepSuggestions( + param: FunnelApiGetRumFunnelStepSuggestionsRequest, + options?: Configuration, + ): Promise { + const requestContextPromise = + this.requestFactory.getRumFunnelStepSuggestions(param.body, options); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.getRumFunnelStepSuggestions( + responseContext, + ); + }); + }); + } +} diff --git a/services/funnel/src/v2/index.ts b/services/funnel/src/v2/index.ts new file mode 100644 index 000000000000..fcee24369558 --- /dev/null +++ b/services/funnel/src/v2/index.ts @@ -0,0 +1,34 @@ +export { + FunnelApiGetRumFunnelRequest, + FunnelApiGetRumFunnelStepSuggestionsRequest, + FunnelApi, +} from "./FunnelApi"; + +export { APIErrorResponse } from "./models/APIErrorResponse"; +export { FunnelRequest } from "./models/FunnelRequest"; +export { FunnelRequestData } from "./models/FunnelRequestData"; +export { FunnelRequestDataAttributes } from "./models/FunnelRequestDataAttributes"; +export { FunnelRequestDataAttributesSearch } from "./models/FunnelRequestDataAttributesSearch"; +export { FunnelRequestDataAttributesSearchStepsItems } from "./models/FunnelRequestDataAttributesSearchStepsItems"; +export { FunnelRequestDataAttributesTime } from "./models/FunnelRequestDataAttributesTime"; +export { FunnelRequestDataType } from "./models/FunnelRequestDataType"; +export { FunnelResponse } from "./models/FunnelResponse"; +export { FunnelResponseData } from "./models/FunnelResponseData"; +export { FunnelResponseDataAttributes } from "./models/FunnelResponseDataAttributes"; +export { FunnelResponseDataAttributesFunnelStepsItems } from "./models/FunnelResponseDataAttributesFunnelStepsItems"; +export { FunnelResponseDataType } from "./models/FunnelResponseDataType"; +export { FunnelResponseElapsedTime } from "./models/FunnelResponseElapsedTime"; +export { FunnelSuggestionRequest } from "./models/FunnelSuggestionRequest"; +export { FunnelSuggestionRequestData } from "./models/FunnelSuggestionRequestData"; +export { FunnelSuggestionRequestDataAttributes } from "./models/FunnelSuggestionRequestDataAttributes"; +export { FunnelSuggestionRequestDataAttributesSearch } from "./models/FunnelSuggestionRequestDataAttributesSearch"; +export { FunnelSuggestionRequestDataAttributesSearchStepsItems } from "./models/FunnelSuggestionRequestDataAttributesSearchStepsItems"; +export { FunnelSuggestionRequestDataAttributesTermSearch } from "./models/FunnelSuggestionRequestDataAttributesTermSearch"; +export { FunnelSuggestionRequestDataAttributesTime } from "./models/FunnelSuggestionRequestDataAttributesTime"; +export { FunnelSuggestionRequestDataType } from "./models/FunnelSuggestionRequestDataType"; +export { FunnelSuggestionResponse } from "./models/FunnelSuggestionResponse"; +export { FunnelSuggestionResponseData } from "./models/FunnelSuggestionResponseData"; +export { FunnelSuggestionResponseDataAttributes } from "./models/FunnelSuggestionResponseDataAttributes"; +export { FunnelSuggestionResponseDataAttributesActionsItems } from "./models/FunnelSuggestionResponseDataAttributesActionsItems"; +export { FunnelSuggestionResponseDataAttributesViewsItems } from "./models/FunnelSuggestionResponseDataAttributesViewsItems"; +export { FunnelSuggestionResponseDataType } from "./models/FunnelSuggestionResponseDataType"; diff --git a/services/funnel/src/v2/models/APIErrorResponse.ts b/services/funnel/src/v2/models/APIErrorResponse.ts new file mode 100644 index 000000000000..58d6c35b80f0 --- /dev/null +++ b/services/funnel/src/v2/models/APIErrorResponse.ts @@ -0,0 +1,45 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +/** + * API error response. + */ +export class APIErrorResponse { + /** + * A list of errors. + */ + "errors": Array; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + errors: { + baseName: "errors", + type: "Array", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return APIErrorResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/funnel/src/v2/models/FunnelRequest.ts b/services/funnel/src/v2/models/FunnelRequest.ts new file mode 100644 index 000000000000..4782f9afee39 --- /dev/null +++ b/services/funnel/src/v2/models/FunnelRequest.ts @@ -0,0 +1,40 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { FunnelRequestData } from "./FunnelRequestData"; + +export class FunnelRequest { + "data"?: FunnelRequestData; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "FunnelRequestData", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return FunnelRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/funnel/src/v2/models/FunnelRequestData.ts b/services/funnel/src/v2/models/FunnelRequestData.ts new file mode 100644 index 000000000000..d7945ea59891 --- /dev/null +++ b/services/funnel/src/v2/models/FunnelRequestData.ts @@ -0,0 +1,52 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { FunnelRequestDataAttributes } from "./FunnelRequestDataAttributes"; +import { FunnelRequestDataType } from "./FunnelRequestDataType"; + +export class FunnelRequestData { + "attributes"?: FunnelRequestDataAttributes; + "id"?: string; + "type": FunnelRequestDataType; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "FunnelRequestDataAttributes", + }, + id: { + baseName: "id", + type: "string", + }, + type: { + baseName: "type", + type: "FunnelRequestDataType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return FunnelRequestData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/funnel/src/v2/models/FunnelRequestDataAttributes.ts b/services/funnel/src/v2/models/FunnelRequestDataAttributes.ts new file mode 100644 index 000000000000..1ac063bcb3e7 --- /dev/null +++ b/services/funnel/src/v2/models/FunnelRequestDataAttributes.ts @@ -0,0 +1,61 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { FunnelRequestDataAttributesSearch } from "./FunnelRequestDataAttributesSearch"; +import { FunnelRequestDataAttributesTime } from "./FunnelRequestDataAttributesTime"; + +export class FunnelRequestDataAttributes { + "dataSource"?: string; + "enforcedExecutionType"?: string; + "requestId"?: string; + "search"?: FunnelRequestDataAttributesSearch; + "time"?: FunnelRequestDataAttributesTime; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + dataSource: { + baseName: "data_source", + type: "string", + }, + enforcedExecutionType: { + baseName: "enforced_execution_type", + type: "string", + }, + requestId: { + baseName: "request_id", + type: "string", + }, + search: { + baseName: "search", + type: "FunnelRequestDataAttributesSearch", + }, + time: { + baseName: "time", + type: "FunnelRequestDataAttributesTime", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return FunnelRequestDataAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/funnel/src/v2/models/FunnelRequestDataAttributesSearch.ts b/services/funnel/src/v2/models/FunnelRequestDataAttributesSearch.ts new file mode 100644 index 000000000000..52ea440d7f28 --- /dev/null +++ b/services/funnel/src/v2/models/FunnelRequestDataAttributesSearch.ts @@ -0,0 +1,55 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { FunnelRequestDataAttributesSearchStepsItems } from "./FunnelRequestDataAttributesSearchStepsItems"; + +export class FunnelRequestDataAttributesSearch { + "crossSessionFilter"?: string; + "queryString"?: string; + "steps"?: Array; + "subqueryId"?: string; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + crossSessionFilter: { + baseName: "cross_session_filter", + type: "string", + }, + queryString: { + baseName: "query_string", + type: "string", + }, + steps: { + baseName: "steps", + type: "Array", + }, + subqueryId: { + baseName: "subquery_id", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return FunnelRequestDataAttributesSearch.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/funnel/src/v2/models/FunnelRequestDataAttributesSearchStepsItems.ts b/services/funnel/src/v2/models/FunnelRequestDataAttributesSearchStepsItems.ts new file mode 100644 index 000000000000..31509930e496 --- /dev/null +++ b/services/funnel/src/v2/models/FunnelRequestDataAttributesSearchStepsItems.ts @@ -0,0 +1,48 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +export class FunnelRequestDataAttributesSearchStepsItems { + "facet"?: string; + "stepFilter"?: string; + "value"?: string; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + facet: { + baseName: "facet", + type: "string", + }, + stepFilter: { + baseName: "step_filter", + type: "string", + }, + value: { + baseName: "value", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return FunnelRequestDataAttributesSearchStepsItems.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/funnel/src/v2/models/FunnelRequestDataAttributesTime.ts b/services/funnel/src/v2/models/FunnelRequestDataAttributesTime.ts new file mode 100644 index 000000000000..6dfa38744a57 --- /dev/null +++ b/services/funnel/src/v2/models/FunnelRequestDataAttributesTime.ts @@ -0,0 +1,45 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +export class FunnelRequestDataAttributesTime { + "from"?: number; + "to"?: number; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + from: { + baseName: "from", + type: "number", + format: "int64", + }, + to: { + baseName: "to", + type: "number", + format: "int64", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return FunnelRequestDataAttributesTime.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/funnel/src/v2/models/FunnelRequestDataType.ts b/services/funnel/src/v2/models/FunnelRequestDataType.ts new file mode 100644 index 000000000000..3e224225c0cd --- /dev/null +++ b/services/funnel/src/v2/models/FunnelRequestDataType.ts @@ -0,0 +1,3 @@ +import { UnparsedObject } from "@datadog/datadog-api-client"; +export type FunnelRequestDataType = typeof FUNNEL_REQUEST | UnparsedObject; +export const FUNNEL_REQUEST = "funnel_request"; diff --git a/services/funnel/src/v2/models/FunnelResponse.ts b/services/funnel/src/v2/models/FunnelResponse.ts new file mode 100644 index 000000000000..cf837901ead5 --- /dev/null +++ b/services/funnel/src/v2/models/FunnelResponse.ts @@ -0,0 +1,40 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { FunnelResponseData } from "./FunnelResponseData"; + +export class FunnelResponse { + "data"?: FunnelResponseData; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "FunnelResponseData", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return FunnelResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/funnel/src/v2/models/FunnelResponseData.ts b/services/funnel/src/v2/models/FunnelResponseData.ts new file mode 100644 index 000000000000..1b321da41b61 --- /dev/null +++ b/services/funnel/src/v2/models/FunnelResponseData.ts @@ -0,0 +1,52 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { FunnelResponseDataAttributes } from "./FunnelResponseDataAttributes"; +import { FunnelResponseDataType } from "./FunnelResponseDataType"; + +export class FunnelResponseData { + "attributes"?: FunnelResponseDataAttributes; + "id"?: string; + "type": FunnelResponseDataType; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "FunnelResponseDataAttributes", + }, + id: { + baseName: "id", + type: "string", + }, + type: { + baseName: "type", + type: "FunnelResponseDataType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return FunnelResponseData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/funnel/src/v2/models/FunnelResponseDataAttributes.ts b/services/funnel/src/v2/models/FunnelResponseDataAttributes.ts new file mode 100644 index 000000000000..945c8d56073b --- /dev/null +++ b/services/funnel/src/v2/models/FunnelResponseDataAttributes.ts @@ -0,0 +1,58 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { FunnelResponseDataAttributesFunnelStepsItems } from "./FunnelResponseDataAttributesFunnelStepsItems"; +import { FunnelResponseElapsedTime } from "./FunnelResponseElapsedTime"; + +export class FunnelResponseDataAttributes { + "endToEndConversionRate"?: number; + "endToEndElapsedTime"?: FunnelResponseElapsedTime; + "funnelSteps"?: Array; + "initialCount"?: number; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + endToEndConversionRate: { + baseName: "end_to_end_conversion_rate", + type: "number", + format: "double", + }, + endToEndElapsedTime: { + baseName: "end_to_end_elapsed_time", + type: "FunnelResponseElapsedTime", + }, + funnelSteps: { + baseName: "funnel_steps", + type: "Array", + }, + initialCount: { + baseName: "initial_count", + type: "number", + format: "int64", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return FunnelResponseDataAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/funnel/src/v2/models/FunnelResponseDataAttributesFunnelStepsItems.ts b/services/funnel/src/v2/models/FunnelResponseDataAttributesFunnelStepsItems.ts new file mode 100644 index 000000000000..0eb8d06d5f52 --- /dev/null +++ b/services/funnel/src/v2/models/FunnelResponseDataAttributesFunnelStepsItems.ts @@ -0,0 +1,51 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { FunnelResponseElapsedTime } from "./FunnelResponseElapsedTime"; + +export class FunnelResponseDataAttributesFunnelStepsItems { + "elapsedTimeToNextStep"?: FunnelResponseElapsedTime; + "label"?: string; + "value"?: number; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + elapsedTimeToNextStep: { + baseName: "elapsed_time_to_next_step", + type: "FunnelResponseElapsedTime", + }, + label: { + baseName: "label", + type: "string", + }, + value: { + baseName: "value", + type: "number", + format: "int64", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return FunnelResponseDataAttributesFunnelStepsItems.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/funnel/src/v2/models/FunnelResponseDataType.ts b/services/funnel/src/v2/models/FunnelResponseDataType.ts new file mode 100644 index 000000000000..4babdac31f9f --- /dev/null +++ b/services/funnel/src/v2/models/FunnelResponseDataType.ts @@ -0,0 +1,3 @@ +import { UnparsedObject } from "@datadog/datadog-api-client"; +export type FunnelResponseDataType = typeof FUNNEL_RESPONSE | UnparsedObject; +export const FUNNEL_RESPONSE = "funnel_response"; diff --git a/services/funnel/src/v2/models/FunnelResponseElapsedTime.ts b/services/funnel/src/v2/models/FunnelResponseElapsedTime.ts new file mode 100644 index 000000000000..b120ac566f40 --- /dev/null +++ b/services/funnel/src/v2/models/FunnelResponseElapsedTime.ts @@ -0,0 +1,69 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +export class FunnelResponseElapsedTime { + "avg"?: number; + "max"?: number; + "min"?: number; + "p5"?: number; + "p50"?: number; + "p95"?: number; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + avg: { + baseName: "avg", + type: "number", + format: "int64", + }, + max: { + baseName: "max", + type: "number", + format: "int64", + }, + min: { + baseName: "min", + type: "number", + format: "int64", + }, + p5: { + baseName: "p5", + type: "number", + format: "int64", + }, + p50: { + baseName: "p50", + type: "number", + format: "int64", + }, + p95: { + baseName: "p95", + type: "number", + format: "int64", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return FunnelResponseElapsedTime.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/funnel/src/v2/models/FunnelSuggestionRequest.ts b/services/funnel/src/v2/models/FunnelSuggestionRequest.ts new file mode 100644 index 000000000000..e6db560f152a --- /dev/null +++ b/services/funnel/src/v2/models/FunnelSuggestionRequest.ts @@ -0,0 +1,40 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { FunnelSuggestionRequestData } from "./FunnelSuggestionRequestData"; + +export class FunnelSuggestionRequest { + "data"?: FunnelSuggestionRequestData; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "FunnelSuggestionRequestData", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return FunnelSuggestionRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/funnel/src/v2/models/FunnelSuggestionRequestData.ts b/services/funnel/src/v2/models/FunnelSuggestionRequestData.ts new file mode 100644 index 000000000000..6e009507ab8c --- /dev/null +++ b/services/funnel/src/v2/models/FunnelSuggestionRequestData.ts @@ -0,0 +1,52 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { FunnelSuggestionRequestDataAttributes } from "./FunnelSuggestionRequestDataAttributes"; +import { FunnelSuggestionRequestDataType } from "./FunnelSuggestionRequestDataType"; + +export class FunnelSuggestionRequestData { + "attributes"?: FunnelSuggestionRequestDataAttributes; + "id"?: string; + "type": FunnelSuggestionRequestDataType; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "FunnelSuggestionRequestDataAttributes", + }, + id: { + baseName: "id", + type: "string", + }, + type: { + baseName: "type", + type: "FunnelSuggestionRequestDataType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return FunnelSuggestionRequestData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/funnel/src/v2/models/FunnelSuggestionRequestDataAttributes.ts b/services/funnel/src/v2/models/FunnelSuggestionRequestDataAttributes.ts new file mode 100644 index 000000000000..97b6c3b2d4fc --- /dev/null +++ b/services/funnel/src/v2/models/FunnelSuggestionRequestDataAttributes.ts @@ -0,0 +1,57 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { FunnelSuggestionRequestDataAttributesSearch } from "./FunnelSuggestionRequestDataAttributesSearch"; +import { FunnelSuggestionRequestDataAttributesTermSearch } from "./FunnelSuggestionRequestDataAttributesTermSearch"; +import { FunnelSuggestionRequestDataAttributesTime } from "./FunnelSuggestionRequestDataAttributesTime"; + +export class FunnelSuggestionRequestDataAttributes { + "dataSource"?: string; + "search"?: FunnelSuggestionRequestDataAttributesSearch; + "termSearch"?: FunnelSuggestionRequestDataAttributesTermSearch; + "time"?: FunnelSuggestionRequestDataAttributesTime; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + dataSource: { + baseName: "data_source", + type: "string", + }, + search: { + baseName: "search", + type: "FunnelSuggestionRequestDataAttributesSearch", + }, + termSearch: { + baseName: "term_search", + type: "FunnelSuggestionRequestDataAttributesTermSearch", + }, + time: { + baseName: "time", + type: "FunnelSuggestionRequestDataAttributesTime", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return FunnelSuggestionRequestDataAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/funnel/src/v2/models/FunnelSuggestionRequestDataAttributesSearch.ts b/services/funnel/src/v2/models/FunnelSuggestionRequestDataAttributesSearch.ts new file mode 100644 index 000000000000..ff3fd7931fad --- /dev/null +++ b/services/funnel/src/v2/models/FunnelSuggestionRequestDataAttributesSearch.ts @@ -0,0 +1,55 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { FunnelSuggestionRequestDataAttributesSearchStepsItems } from "./FunnelSuggestionRequestDataAttributesSearchStepsItems"; + +export class FunnelSuggestionRequestDataAttributesSearch { + "crossSessionFilter"?: string; + "queryString"?: string; + "steps"?: Array; + "subqueryId"?: string; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + crossSessionFilter: { + baseName: "cross_session_filter", + type: "string", + }, + queryString: { + baseName: "query_string", + type: "string", + }, + steps: { + baseName: "steps", + type: "Array", + }, + subqueryId: { + baseName: "subquery_id", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return FunnelSuggestionRequestDataAttributesSearch.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/funnel/src/v2/models/FunnelSuggestionRequestDataAttributesSearchStepsItems.ts b/services/funnel/src/v2/models/FunnelSuggestionRequestDataAttributesSearchStepsItems.ts new file mode 100644 index 000000000000..d42ba516b151 --- /dev/null +++ b/services/funnel/src/v2/models/FunnelSuggestionRequestDataAttributesSearchStepsItems.ts @@ -0,0 +1,48 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +export class FunnelSuggestionRequestDataAttributesSearchStepsItems { + "facet"?: string; + "stepFilter"?: string; + "value"?: string; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + facet: { + baseName: "facet", + type: "string", + }, + stepFilter: { + baseName: "step_filter", + type: "string", + }, + value: { + baseName: "value", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return FunnelSuggestionRequestDataAttributesSearchStepsItems.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/funnel/src/v2/models/FunnelSuggestionRequestDataAttributesTermSearch.ts b/services/funnel/src/v2/models/FunnelSuggestionRequestDataAttributesTermSearch.ts new file mode 100644 index 000000000000..e1a6fc953345 --- /dev/null +++ b/services/funnel/src/v2/models/FunnelSuggestionRequestDataAttributesTermSearch.ts @@ -0,0 +1,38 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +export class FunnelSuggestionRequestDataAttributesTermSearch { + "query"?: string; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + query: { + baseName: "query", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return FunnelSuggestionRequestDataAttributesTermSearch.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/funnel/src/v2/models/FunnelSuggestionRequestDataAttributesTime.ts b/services/funnel/src/v2/models/FunnelSuggestionRequestDataAttributesTime.ts new file mode 100644 index 000000000000..34fb21debf12 --- /dev/null +++ b/services/funnel/src/v2/models/FunnelSuggestionRequestDataAttributesTime.ts @@ -0,0 +1,45 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +export class FunnelSuggestionRequestDataAttributesTime { + "from"?: number; + "to"?: number; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + from: { + baseName: "from", + type: "number", + format: "int64", + }, + to: { + baseName: "to", + type: "number", + format: "int64", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return FunnelSuggestionRequestDataAttributesTime.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/funnel/src/v2/models/FunnelSuggestionRequestDataType.ts b/services/funnel/src/v2/models/FunnelSuggestionRequestDataType.ts new file mode 100644 index 000000000000..d7f5ac618401 --- /dev/null +++ b/services/funnel/src/v2/models/FunnelSuggestionRequestDataType.ts @@ -0,0 +1,5 @@ +import { UnparsedObject } from "@datadog/datadog-api-client"; +export type FunnelSuggestionRequestDataType = + | typeof FUNNEL_SUGGESTION_REQUEST + | UnparsedObject; +export const FUNNEL_SUGGESTION_REQUEST = "funnel_suggestion_request"; diff --git a/services/funnel/src/v2/models/FunnelSuggestionResponse.ts b/services/funnel/src/v2/models/FunnelSuggestionResponse.ts new file mode 100644 index 000000000000..1b3ec5128673 --- /dev/null +++ b/services/funnel/src/v2/models/FunnelSuggestionResponse.ts @@ -0,0 +1,40 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { FunnelSuggestionResponseData } from "./FunnelSuggestionResponseData"; + +export class FunnelSuggestionResponse { + "data"?: FunnelSuggestionResponseData; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "FunnelSuggestionResponseData", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return FunnelSuggestionResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/funnel/src/v2/models/FunnelSuggestionResponseData.ts b/services/funnel/src/v2/models/FunnelSuggestionResponseData.ts new file mode 100644 index 000000000000..7338a78a274f --- /dev/null +++ b/services/funnel/src/v2/models/FunnelSuggestionResponseData.ts @@ -0,0 +1,52 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { FunnelSuggestionResponseDataAttributes } from "./FunnelSuggestionResponseDataAttributes"; +import { FunnelSuggestionResponseDataType } from "./FunnelSuggestionResponseDataType"; + +export class FunnelSuggestionResponseData { + "attributes"?: FunnelSuggestionResponseDataAttributes; + "id"?: string; + "type": FunnelSuggestionResponseDataType; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "FunnelSuggestionResponseDataAttributes", + }, + id: { + baseName: "id", + type: "string", + }, + type: { + baseName: "type", + type: "FunnelSuggestionResponseDataType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return FunnelSuggestionResponseData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/funnel/src/v2/models/FunnelSuggestionResponseDataAttributes.ts b/services/funnel/src/v2/models/FunnelSuggestionResponseDataAttributes.ts new file mode 100644 index 000000000000..dc9c7f8ad888 --- /dev/null +++ b/services/funnel/src/v2/models/FunnelSuggestionResponseDataAttributes.ts @@ -0,0 +1,46 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { FunnelSuggestionResponseDataAttributesActionsItems } from "./FunnelSuggestionResponseDataAttributesActionsItems"; +import { FunnelSuggestionResponseDataAttributesViewsItems } from "./FunnelSuggestionResponseDataAttributesViewsItems"; + +export class FunnelSuggestionResponseDataAttributes { + "actions"?: Array; + "views"?: Array; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + actions: { + baseName: "actions", + type: "Array", + }, + views: { + baseName: "views", + type: "Array", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return FunnelSuggestionResponseDataAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/funnel/src/v2/models/FunnelSuggestionResponseDataAttributesActionsItems.ts b/services/funnel/src/v2/models/FunnelSuggestionResponseDataAttributesActionsItems.ts new file mode 100644 index 000000000000..2c9ca186d098 --- /dev/null +++ b/services/funnel/src/v2/models/FunnelSuggestionResponseDataAttributesActionsItems.ts @@ -0,0 +1,38 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +export class FunnelSuggestionResponseDataAttributesActionsItems { + "name"?: string; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + name: { + baseName: "name", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return FunnelSuggestionResponseDataAttributesActionsItems.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/funnel/src/v2/models/FunnelSuggestionResponseDataAttributesViewsItems.ts b/services/funnel/src/v2/models/FunnelSuggestionResponseDataAttributesViewsItems.ts new file mode 100644 index 000000000000..ac534ef0e2f6 --- /dev/null +++ b/services/funnel/src/v2/models/FunnelSuggestionResponseDataAttributesViewsItems.ts @@ -0,0 +1,38 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +export class FunnelSuggestionResponseDataAttributesViewsItems { + "name"?: string; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + name: { + baseName: "name", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return FunnelSuggestionResponseDataAttributesViewsItems.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/funnel/src/v2/models/FunnelSuggestionResponseDataType.ts b/services/funnel/src/v2/models/FunnelSuggestionResponseDataType.ts new file mode 100644 index 000000000000..e25a39879aa7 --- /dev/null +++ b/services/funnel/src/v2/models/FunnelSuggestionResponseDataType.ts @@ -0,0 +1,5 @@ +import { UnparsedObject } from "@datadog/datadog-api-client"; +export type FunnelSuggestionResponseDataType = + | typeof FUNNEL_SUGGESTION_RESPONSE + | UnparsedObject; +export const FUNNEL_SUGGESTION_RESPONSE = "funnel_suggestion_response"; diff --git a/services/funnel/src/v2/models/TypingInfo.ts b/services/funnel/src/v2/models/TypingInfo.ts new file mode 100644 index 000000000000..6205a78f2145 --- /dev/null +++ b/services/funnel/src/v2/models/TypingInfo.ts @@ -0,0 +1,72 @@ +import { ModelTypingInfo } from "@datadog/datadog-api-client"; + +import { APIErrorResponse } from "./APIErrorResponse"; +import { FunnelRequest } from "./FunnelRequest"; +import { FunnelRequestData } from "./FunnelRequestData"; +import { FunnelRequestDataAttributes } from "./FunnelRequestDataAttributes"; +import { FunnelRequestDataAttributesSearch } from "./FunnelRequestDataAttributesSearch"; +import { FunnelRequestDataAttributesSearchStepsItems } from "./FunnelRequestDataAttributesSearchStepsItems"; +import { FunnelRequestDataAttributesTime } from "./FunnelRequestDataAttributesTime"; +import { FunnelResponse } from "./FunnelResponse"; +import { FunnelResponseData } from "./FunnelResponseData"; +import { FunnelResponseDataAttributes } from "./FunnelResponseDataAttributes"; +import { FunnelResponseDataAttributesFunnelStepsItems } from "./FunnelResponseDataAttributesFunnelStepsItems"; +import { FunnelResponseElapsedTime } from "./FunnelResponseElapsedTime"; +import { FunnelSuggestionRequest } from "./FunnelSuggestionRequest"; +import { FunnelSuggestionRequestData } from "./FunnelSuggestionRequestData"; +import { FunnelSuggestionRequestDataAttributes } from "./FunnelSuggestionRequestDataAttributes"; +import { FunnelSuggestionRequestDataAttributesSearch } from "./FunnelSuggestionRequestDataAttributesSearch"; +import { FunnelSuggestionRequestDataAttributesSearchStepsItems } from "./FunnelSuggestionRequestDataAttributesSearchStepsItems"; +import { FunnelSuggestionRequestDataAttributesTermSearch } from "./FunnelSuggestionRequestDataAttributesTermSearch"; +import { FunnelSuggestionRequestDataAttributesTime } from "./FunnelSuggestionRequestDataAttributesTime"; +import { FunnelSuggestionResponse } from "./FunnelSuggestionResponse"; +import { FunnelSuggestionResponseData } from "./FunnelSuggestionResponseData"; +import { FunnelSuggestionResponseDataAttributes } from "./FunnelSuggestionResponseDataAttributes"; +import { FunnelSuggestionResponseDataAttributesActionsItems } from "./FunnelSuggestionResponseDataAttributesActionsItems"; +import { FunnelSuggestionResponseDataAttributesViewsItems } from "./FunnelSuggestionResponseDataAttributesViewsItems"; + +export const TypingInfo: ModelTypingInfo = { + enumsMap: { + FunnelRequestDataType: ["funnel_request"], + FunnelResponseDataType: ["funnel_response"], + FunnelSuggestionRequestDataType: ["funnel_suggestion_request"], + FunnelSuggestionResponseDataType: ["funnel_suggestion_response"], + }, + oneOfMap: {}, + typeMap: { + APIErrorResponse: APIErrorResponse, + FunnelRequest: FunnelRequest, + FunnelRequestData: FunnelRequestData, + FunnelRequestDataAttributes: FunnelRequestDataAttributes, + FunnelRequestDataAttributesSearch: FunnelRequestDataAttributesSearch, + FunnelRequestDataAttributesSearchStepsItems: + FunnelRequestDataAttributesSearchStepsItems, + FunnelRequestDataAttributesTime: FunnelRequestDataAttributesTime, + FunnelResponse: FunnelResponse, + FunnelResponseData: FunnelResponseData, + FunnelResponseDataAttributes: FunnelResponseDataAttributes, + FunnelResponseDataAttributesFunnelStepsItems: + FunnelResponseDataAttributesFunnelStepsItems, + FunnelResponseElapsedTime: FunnelResponseElapsedTime, + FunnelSuggestionRequest: FunnelSuggestionRequest, + FunnelSuggestionRequestData: FunnelSuggestionRequestData, + FunnelSuggestionRequestDataAttributes: + FunnelSuggestionRequestDataAttributes, + FunnelSuggestionRequestDataAttributesSearch: + FunnelSuggestionRequestDataAttributesSearch, + FunnelSuggestionRequestDataAttributesSearchStepsItems: + FunnelSuggestionRequestDataAttributesSearchStepsItems, + FunnelSuggestionRequestDataAttributesTermSearch: + FunnelSuggestionRequestDataAttributesTermSearch, + FunnelSuggestionRequestDataAttributesTime: + FunnelSuggestionRequestDataAttributesTime, + FunnelSuggestionResponse: FunnelSuggestionResponse, + FunnelSuggestionResponseData: FunnelSuggestionResponseData, + FunnelSuggestionResponseDataAttributes: + FunnelSuggestionResponseDataAttributes, + FunnelSuggestionResponseDataAttributesActionsItems: + FunnelSuggestionResponseDataAttributesActionsItems, + FunnelSuggestionResponseDataAttributesViewsItems: + FunnelSuggestionResponseDataAttributesViewsItems, + }, +}; diff --git a/services/funnel/tsconfig.json b/services/funnel/tsconfig.json new file mode 100644 index 000000000000..d6c32bfb893c --- /dev/null +++ b/services/funnel/tsconfig.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "strict": true, + /* Basic Options */ + "target": "es6", + "module": "commonjs", + "moduleResolution": "node", + "declaration": true, + + "esModuleInterop": true, + "resolveJsonModule": true, + + "noImplicitAny": true, + "noImplicitThis": true, + + /* Additional Checks */ + "noUnusedLocals": false /* Report errors on unused locals. */, // TODO: reenable (unused imports!) + "noUnusedParameters": false /* Report errors on unused parameters. */, // TODO: set to true again + "noImplicitReturns": true /* Report error when not all code paths in function return a value. */, + "noFallthroughCasesInSwitch": true /* Report errors for fallthrough cases in switch statement. */, + + "sourceMap": true, + "outDir": "./dist", + "lib": ["es6", "es7"] + }, + "exclude": ["dist", "node_modules", "tests"], + "include": ["src"] +} diff --git a/services/segments/.yarnrc.yml b/services/segments/.yarnrc.yml new file mode 100644 index 000000000000..3186f3f0795a --- /dev/null +++ b/services/segments/.yarnrc.yml @@ -0,0 +1 @@ +nodeLinker: node-modules diff --git a/services/segments/README.md b/services/segments/README.md new file mode 100644 index 000000000000..90c40e9ff007 --- /dev/null +++ b/services/segments/README.md @@ -0,0 +1,43 @@ +# @datadog/datadog-api-client-segments + +## Description + +API for segments. + +## Navigation + +- [Installation](#installation) +- [Getting Started](#getting-started) + +## Installation + +```sh +# NPM +npm install @datadog/datadog-api-client-segments +# Yarn +yarn add @datadog/datadog-api-client-segments +``` + +## Getting Started +```ts +import { createConfiguration } from "@datadog/datadog-api-client"; +import { SegmentsApiV2 } from "@datadog/datadog-api-client-segments"; +import { v2 } from "@datadog/datadog-api-client-segments"; + +const configuration = createConfiguration(); +// Enable unstable operations +const configurationOpts = { + unstableOperations: { + "SegmentsApi.v2.listRumSegments": true + } +} + +const configuration = createConfiguration(configurationOpts); +const apiInstance = new SegmentsApiV2(configuration); + +apiInstance.listRumSegments().then((data) => { + console.log("API called successfully. Returned data: " + JSON.stringify(data)); +}).catch((error) => { + console.error("Error calling API: " + error); +}); +``` \ No newline at end of file diff --git a/services/segments/package.json b/services/segments/package.json new file mode 100644 index 000000000000..1d8a099f2ca6 --- /dev/null +++ b/services/segments/package.json @@ -0,0 +1,43 @@ +{ + "name": "@datadog/datadog-api-client-segments", + "description": "", + "author": "", + "keywords": [ + "api", + "fetch", + "typescript" + ], + "license": "Apache-2.0", + "licenses": [ + { + "type": "Apache-2.0", + "url": "http://www.apache.org/licenses/LICENSE-2.0" + } + ], + "repository": { + "type": "git", + "url": "https://github.com/DataDog/datadog-api-client-typescript.git", + "directory": "services/segments" + }, + "files": [ + "dist/**/*" + ], + "main": "./dist/index.js", + "typings": "./dist/index.d.ts", + "scripts": { + "prepack": "yarn workspace @datadog/datadog-api-client build && yarn build", + "build": "yarn generate-version-files && tsc", + "generate-version-files": "node -p \"'export const version = ' + JSON.stringify(require('./package.json').version)\" > src/version.ts" + }, + "dependencies": { + "@datadog/datadog-api-client": "^2.0.0-beta.0" + }, + "devDependencies": { + "typescript": "5.8.3" + }, + "engines": { + "node": ">=18.0.0" + }, + "version": "0.0.1", + "packageManager": "yarn@4.9.1" +} diff --git a/services/segments/src/index.ts b/services/segments/src/index.ts new file mode 100644 index 000000000000..03824a075d30 --- /dev/null +++ b/services/segments/src/index.ts @@ -0,0 +1,3 @@ +export * as v2 from "./v2"; + +export { SegmentsApi as SegmentsApiV2 } from "./v2/SegmentsApi"; diff --git a/services/segments/src/v2/SegmentsApi.ts b/services/segments/src/v2/SegmentsApi.ts new file mode 100644 index 000000000000..e5d5bf9775ef --- /dev/null +++ b/services/segments/src/v2/SegmentsApi.ts @@ -0,0 +1,391 @@ +import { + ApiException, + BaseAPIRequestFactory, + BaseServerConfiguration, + buildUserAgent, + Configuration, + createConfiguration, + deserialize, + getPreferredMediaType, + HttpMethod, + isBrowser, + logger, + normalizeMediaType, + parse, + RequiredError, + RequestContext, + ResponseContext, + serialize, + ServerConfiguration, + stringify, +} from "@datadog/datadog-api-client"; + +import { TypingInfo } from "./models/TypingInfo"; +import { APIErrorResponse } from "./models/APIErrorResponse"; +import { Segment } from "./models/Segment"; +import { SegmentArray } from "./models/SegmentArray"; +import { version } from "../version"; + +export class SegmentsApiRequestFactory extends BaseAPIRequestFactory { + public userAgent: string | undefined; + + public constructor(configuration: Configuration) { + super(configuration); + if (!isBrowser) { + this.userAgent = buildUserAgent("segments", version); + } + } + public async createRumSegment( + body: Segment, + _options?: Configuration, + ): Promise { + const _config = _options || this.configuration; + + if (!_config.unstableOperations["SegmentsApi.v2.createRumSegment"]) { + throw new Error( + "Unstable operation 'createRumSegment' is disabled. Enable it by setting `configuration.unstableOperations['SegmentsApi.v2.createRumSegment'] = true`", + ); + } + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError("body", "createRumSegment"); + } + + // Path Params + const localVarPath = "/api/v2/rum/segment"; + + // Make Request Context + const { server, overrides } = _config.getServerAndOverrides( + "SegmentsApi.v2.createRumSegment", + SegmentsApi.operationServers, + ); + const requestContext = server.makeRequestContext( + localVarPath, + HttpMethod.POST, + overrides, + ); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Set User-Agent + if (this.userAgent) { + requestContext.setHeaderParam("User-Agent", this.userAgent); + } + + // Body Params + const contentType = getPreferredMediaType(["application/json"]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = stringify( + serialize(body, TypingInfo, "Segment", ""), + contentType, + ); + requestContext.setBody(serializedBody); + + return requestContext; + } + + public async initializeRumSegments( + _options?: Configuration, + ): Promise { + const _config = _options || this.configuration; + + if (!_config.unstableOperations["SegmentsApi.v2.initializeRumSegments"]) { + throw new Error( + "Unstable operation 'initializeRumSegments' is disabled. Enable it by setting `configuration.unstableOperations['SegmentsApi.v2.initializeRumSegments'] = true`", + ); + } + + // Path Params + const localVarPath = "/api/v2/rum/segment/initialize"; + + // Make Request Context + const { server, overrides } = _config.getServerAndOverrides( + "SegmentsApi.v2.initializeRumSegments", + SegmentsApi.operationServers, + ); + const requestContext = server.makeRequestContext( + localVarPath, + HttpMethod.POST, + overrides, + ); + requestContext.setHeaderParam("Accept", "*/*"); + requestContext.setHttpConfig(_config.httpConfig); + + // Set User-Agent + if (this.userAgent) { + requestContext.setHeaderParam("User-Agent", this.userAgent); + } + + return requestContext; + } + + public async listRumSegments( + _options?: Configuration, + ): Promise { + const _config = _options || this.configuration; + + if (!_config.unstableOperations["SegmentsApi.v2.listRumSegments"]) { + throw new Error( + "Unstable operation 'listRumSegments' is disabled. Enable it by setting `configuration.unstableOperations['SegmentsApi.v2.listRumSegments'] = true`", + ); + } + + // Path Params + const localVarPath = "/api/v2/rum/segment"; + + // Make Request Context + const { server, overrides } = _config.getServerAndOverrides( + "SegmentsApi.v2.listRumSegments", + SegmentsApi.operationServers, + ); + const requestContext = server.makeRequestContext( + localVarPath, + HttpMethod.GET, + overrides, + ); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Set User-Agent + if (this.userAgent) { + requestContext.setHeaderParam("User-Agent", this.userAgent); + } + + return requestContext; + } +} + +export class SegmentsApiResponseProcessor { + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to createRumSegment + * @throws ApiException if the response code was not in [200, 299] + */ + public async createRumSegment(response: ResponseContext): Promise { + const contentType = normalizeMediaType(response.headers["content-type"]); + if (response.httpStatusCode === 201) { + const body: Segment = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "Segment", + ) as Segment; + return body; + } + if (response.httpStatusCode === 429) { + const bodyText = parse(await response.body.text(), contentType); + let body: APIErrorResponse; + try { + body = deserialize( + bodyText, + TypingInfo, + "APIErrorResponse", + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText, + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: Segment = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "Segment", + "", + ) as Segment; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"', + ); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to initializeRumSegments + * @throws ApiException if the response code was not in [200, 299] + */ + public async initializeRumSegments(response: ResponseContext): Promise { + const contentType = normalizeMediaType(response.headers["content-type"]); + if (response.httpStatusCode === 200) { + return; + } + if (response.httpStatusCode === 429) { + const bodyText = parse(await response.body.text(), contentType); + let body: APIErrorResponse; + try { + body = deserialize( + bodyText, + TypingInfo, + "APIErrorResponse", + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText, + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + return; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"', + ); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to listRumSegments + * @throws ApiException if the response code was not in [200, 299] + */ + public async listRumSegments( + response: ResponseContext, + ): Promise { + const contentType = normalizeMediaType(response.headers["content-type"]); + if (response.httpStatusCode === 200) { + const body: SegmentArray = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "SegmentArray", + ) as SegmentArray; + return body; + } + if (response.httpStatusCode === 429) { + const bodyText = parse(await response.body.text(), contentType); + let body: APIErrorResponse; + try { + body = deserialize( + bodyText, + TypingInfo, + "APIErrorResponse", + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText, + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: SegmentArray = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "SegmentArray", + "", + ) as SegmentArray; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"', + ); + } +} + +export interface SegmentsApiCreateRumSegmentRequest { + /** + * @type Segment + */ + body: Segment; +} + +export class SegmentsApi { + private requestFactory: SegmentsApiRequestFactory; + private responseProcessor: SegmentsApiResponseProcessor; + private configuration: Configuration; + + static operationServers: { [key: string]: BaseServerConfiguration[] } = {}; + + public constructor( + configuration?: Configuration, + requestFactory?: SegmentsApiRequestFactory, + responseProcessor?: SegmentsApiResponseProcessor, + ) { + this.configuration = configuration || createConfiguration(); + this.requestFactory = + requestFactory || new SegmentsApiRequestFactory(this.configuration); + this.responseProcessor = + responseProcessor || new SegmentsApiResponseProcessor(); + } + + /** + * Create a new user segment for audience targeting + * @param param The request object + */ + public createRumSegment( + param: SegmentsApiCreateRumSegmentRequest, + options?: Configuration, + ): Promise { + const requestContextPromise = this.requestFactory.createRumSegment( + param.body, + options, + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.createRumSegment(responseContext); + }); + }); + } + + /** + * Initialize default segments for a new organization + * @param param The request object + */ + public initializeRumSegments(options?: Configuration): Promise { + const requestContextPromise = + this.requestFactory.initializeRumSegments(options); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.initializeRumSegments(responseContext); + }); + }); + } + + /** + * List all available user segments for audience targeting + * @param param The request object + */ + public listRumSegments(options?: Configuration): Promise { + const requestContextPromise = this.requestFactory.listRumSegments(options); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.listRumSegments(responseContext); + }); + }); + } +} diff --git a/services/segments/src/v2/index.ts b/services/segments/src/v2/index.ts new file mode 100644 index 000000000000..c9c07b6718dd --- /dev/null +++ b/services/segments/src/v2/index.ts @@ -0,0 +1,16 @@ +export { SegmentsApiCreateRumSegmentRequest, SegmentsApi } from "./SegmentsApi"; + +export { APIErrorResponse } from "./models/APIErrorResponse"; +export { Segment } from "./models/Segment"; +export { SegmentArray } from "./models/SegmentArray"; +export { SegmentData } from "./models/SegmentData"; +export { SegmentDataAttributes } from "./models/SegmentDataAttributes"; +export { SegmentDataAttributesDataQuery } from "./models/SegmentDataAttributesDataQuery"; +export { SegmentDataAttributesDataQueryEventPlatformItems } from "./models/SegmentDataAttributesDataQueryEventPlatformItems"; +export { SegmentDataAttributesDataQueryReferenceTableItems } from "./models/SegmentDataAttributesDataQueryReferenceTableItems"; +export { SegmentDataAttributesDataQueryReferenceTableItemsColumnsItems } from "./models/SegmentDataAttributesDataQueryReferenceTableItemsColumnsItems"; +export { SegmentDataAttributesDataQueryReferenceTableItemsJoinCondition } from "./models/SegmentDataAttributesDataQueryReferenceTableItemsJoinCondition"; +export { SegmentDataAttributesDataQueryStaticItems } from "./models/SegmentDataAttributesDataQueryStaticItems"; +export { SegmentDataAttributesDataQueryUserStoreItems } from "./models/SegmentDataAttributesDataQueryUserStoreItems"; +export { SegmentDataSource } from "./models/SegmentDataSource"; +export { SegmentDataType } from "./models/SegmentDataType"; diff --git a/services/segments/src/v2/models/APIErrorResponse.ts b/services/segments/src/v2/models/APIErrorResponse.ts new file mode 100644 index 000000000000..58d6c35b80f0 --- /dev/null +++ b/services/segments/src/v2/models/APIErrorResponse.ts @@ -0,0 +1,45 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +/** + * API error response. + */ +export class APIErrorResponse { + /** + * A list of errors. + */ + "errors": Array; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + errors: { + baseName: "errors", + type: "Array", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return APIErrorResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/segments/src/v2/models/Segment.ts b/services/segments/src/v2/models/Segment.ts new file mode 100644 index 000000000000..4778c35404cc --- /dev/null +++ b/services/segments/src/v2/models/Segment.ts @@ -0,0 +1,40 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { SegmentData } from "./SegmentData"; + +export class Segment { + "data"?: SegmentData; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "SegmentData", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return Segment.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/segments/src/v2/models/SegmentArray.ts b/services/segments/src/v2/models/SegmentArray.ts new file mode 100644 index 000000000000..9bd05a3b7fa5 --- /dev/null +++ b/services/segments/src/v2/models/SegmentArray.ts @@ -0,0 +1,41 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { SegmentData } from "./SegmentData"; + +export class SegmentArray { + "data": Array; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "Array", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SegmentArray.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/segments/src/v2/models/SegmentData.ts b/services/segments/src/v2/models/SegmentData.ts new file mode 100644 index 000000000000..836dd27e871f --- /dev/null +++ b/services/segments/src/v2/models/SegmentData.ts @@ -0,0 +1,52 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { SegmentDataAttributes } from "./SegmentDataAttributes"; +import { SegmentDataType } from "./SegmentDataType"; + +export class SegmentData { + "attributes"?: SegmentDataAttributes; + "id"?: string; + "type": SegmentDataType; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "SegmentDataAttributes", + }, + id: { + baseName: "id", + type: "string", + }, + type: { + baseName: "type", + type: "SegmentDataType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SegmentData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/segments/src/v2/models/SegmentDataAttributes.ts b/services/segments/src/v2/models/SegmentDataAttributes.ts new file mode 100644 index 000000000000..39d689ed29ed --- /dev/null +++ b/services/segments/src/v2/models/SegmentDataAttributes.ts @@ -0,0 +1,120 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { SegmentDataAttributesDataQuery } from "./SegmentDataAttributesDataQuery"; +import { SegmentDataSource } from "./SegmentDataSource"; + +export class SegmentDataAttributes { + "createdAt"?: Date; + "createdBy"?: SegmentDataSource; + "dataQuery": SegmentDataAttributesDataQuery; + "description"?: string; + "disabledAt"?: Date; + "disabledBy"?: SegmentDataSource; + "materializationRowCount"?: number; + "materializedAt"?: string; + "modifiedAt"?: Date; + "modifiedBy"?: SegmentDataSource; + "name": string; + "orgId"?: number; + "source"?: number; + "tags"?: Array; + "version"?: number; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + createdAt: { + baseName: "created_at", + type: "Date", + format: "date-time", + }, + createdBy: { + baseName: "created_by", + type: "SegmentDataSource", + }, + dataQuery: { + baseName: "data_query", + type: "SegmentDataAttributesDataQuery", + required: true, + }, + description: { + baseName: "description", + type: "string", + }, + disabledAt: { + baseName: "disabled_at", + type: "Date", + format: "date-time", + }, + disabledBy: { + baseName: "disabled_by", + type: "SegmentDataSource", + }, + materializationRowCount: { + baseName: "materialization_row_count", + type: "number", + format: "int64", + }, + materializedAt: { + baseName: "materialized_at", + type: "string", + }, + modifiedAt: { + baseName: "modified_at", + type: "Date", + format: "date-time", + }, + modifiedBy: { + baseName: "modified_by", + type: "SegmentDataSource", + }, + name: { + baseName: "name", + type: "string", + required: true, + }, + orgId: { + baseName: "org_id", + type: "number", + format: "int64", + }, + source: { + baseName: "source", + type: "number", + format: "int64", + }, + tags: { + baseName: "tags", + type: "Array", + }, + version: { + baseName: "version", + type: "number", + format: "int64", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SegmentDataAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/segments/src/v2/models/SegmentDataAttributesDataQuery.ts b/services/segments/src/v2/models/SegmentDataAttributesDataQuery.ts new file mode 100644 index 000000000000..03075933ddb0 --- /dev/null +++ b/services/segments/src/v2/models/SegmentDataAttributesDataQuery.ts @@ -0,0 +1,63 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { SegmentDataAttributesDataQueryEventPlatformItems } from "./SegmentDataAttributesDataQueryEventPlatformItems"; +import { SegmentDataAttributesDataQueryReferenceTableItems } from "./SegmentDataAttributesDataQueryReferenceTableItems"; +import { SegmentDataAttributesDataQueryStaticItems } from "./SegmentDataAttributesDataQueryStaticItems"; +import { SegmentDataAttributesDataQueryUserStoreItems } from "./SegmentDataAttributesDataQueryUserStoreItems"; + +export class SegmentDataAttributesDataQuery { + "combination"?: string; + "eventPlatform"?: Array; + "referenceTable"?: Array; + "_static"?: Array; + "userStore"?: Array; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + combination: { + baseName: "combination", + type: "string", + }, + eventPlatform: { + baseName: "event_platform", + type: "Array", + }, + referenceTable: { + baseName: "reference_table", + type: "Array", + }, + _static: { + baseName: "static", + type: "Array", + }, + userStore: { + baseName: "user_store", + type: "Array", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SegmentDataAttributesDataQuery.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/segments/src/v2/models/SegmentDataAttributesDataQueryEventPlatformItems.ts b/services/segments/src/v2/models/SegmentDataAttributesDataQueryEventPlatformItems.ts new file mode 100644 index 000000000000..525158ddcb38 --- /dev/null +++ b/services/segments/src/v2/models/SegmentDataAttributesDataQueryEventPlatformItems.ts @@ -0,0 +1,59 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +export class SegmentDataAttributesDataQueryEventPlatformItems { + "facet": string; + "from"?: string; + "name"?: string; + "query"?: string; + "to"?: string; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + facet: { + baseName: "facet", + type: "string", + required: true, + }, + from: { + baseName: "from", + type: "string", + }, + name: { + baseName: "name", + type: "string", + }, + query: { + baseName: "query", + type: "string", + }, + to: { + baseName: "to", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SegmentDataAttributesDataQueryEventPlatformItems.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/segments/src/v2/models/SegmentDataAttributesDataQueryReferenceTableItems.ts b/services/segments/src/v2/models/SegmentDataAttributesDataQueryReferenceTableItems.ts new file mode 100644 index 000000000000..c0b8afde1c59 --- /dev/null +++ b/services/segments/src/v2/models/SegmentDataAttributesDataQueryReferenceTableItems.ts @@ -0,0 +1,63 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { SegmentDataAttributesDataQueryReferenceTableItemsColumnsItems } from "./SegmentDataAttributesDataQueryReferenceTableItemsColumnsItems"; +import { SegmentDataAttributesDataQueryReferenceTableItemsJoinCondition } from "./SegmentDataAttributesDataQueryReferenceTableItemsJoinCondition"; + +export class SegmentDataAttributesDataQueryReferenceTableItems { + "columns"?: Array; + "filterQuery"?: string; + "joinCondition": SegmentDataAttributesDataQueryReferenceTableItemsJoinCondition; + "name"?: string; + "tableName": string; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + columns: { + baseName: "columns", + type: "Array", + }, + filterQuery: { + baseName: "filter_query", + type: "string", + }, + joinCondition: { + baseName: "join_condition", + type: "SegmentDataAttributesDataQueryReferenceTableItemsJoinCondition", + required: true, + }, + name: { + baseName: "name", + type: "string", + }, + tableName: { + baseName: "table_name", + type: "string", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SegmentDataAttributesDataQueryReferenceTableItems.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/segments/src/v2/models/SegmentDataAttributesDataQueryReferenceTableItemsColumnsItems.ts b/services/segments/src/v2/models/SegmentDataAttributesDataQueryReferenceTableItemsColumnsItems.ts new file mode 100644 index 000000000000..05622a9ff6ae --- /dev/null +++ b/services/segments/src/v2/models/SegmentDataAttributesDataQueryReferenceTableItemsColumnsItems.ts @@ -0,0 +1,43 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +export class SegmentDataAttributesDataQueryReferenceTableItemsColumnsItems { + "alias"?: string; + "name"?: string; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + alias: { + baseName: "alias", + type: "string", + }, + name: { + baseName: "name", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SegmentDataAttributesDataQueryReferenceTableItemsColumnsItems.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/segments/src/v2/models/SegmentDataAttributesDataQueryReferenceTableItemsJoinCondition.ts b/services/segments/src/v2/models/SegmentDataAttributesDataQueryReferenceTableItemsJoinCondition.ts new file mode 100644 index 000000000000..46a49157dbae --- /dev/null +++ b/services/segments/src/v2/models/SegmentDataAttributesDataQueryReferenceTableItemsJoinCondition.ts @@ -0,0 +1,44 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +export class SegmentDataAttributesDataQueryReferenceTableItemsJoinCondition { + "columnName": string; + "facet"?: string; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + columnName: { + baseName: "column_name", + type: "string", + required: true, + }, + facet: { + baseName: "facet", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SegmentDataAttributesDataQueryReferenceTableItemsJoinCondition.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/segments/src/v2/models/SegmentDataAttributesDataQueryStaticItems.ts b/services/segments/src/v2/models/SegmentDataAttributesDataQueryStaticItems.ts new file mode 100644 index 000000000000..487b4c7d59ca --- /dev/null +++ b/services/segments/src/v2/models/SegmentDataAttributesDataQueryStaticItems.ts @@ -0,0 +1,49 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +export class SegmentDataAttributesDataQueryStaticItems { + "id"?: string; + "name"?: string; + "userCount"?: number; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + id: { + baseName: "id", + type: "string", + }, + name: { + baseName: "name", + type: "string", + }, + userCount: { + baseName: "user_count", + type: "number", + format: "int64", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SegmentDataAttributesDataQueryStaticItems.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/segments/src/v2/models/SegmentDataAttributesDataQueryUserStoreItems.ts b/services/segments/src/v2/models/SegmentDataAttributesDataQueryUserStoreItems.ts new file mode 100644 index 000000000000..551ab6acd79d --- /dev/null +++ b/services/segments/src/v2/models/SegmentDataAttributesDataQueryUserStoreItems.ts @@ -0,0 +1,48 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +export class SegmentDataAttributesDataQueryUserStoreItems { + "facet"?: string; + "name"?: string; + "query"?: string; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + facet: { + baseName: "facet", + type: "string", + }, + name: { + baseName: "name", + type: "string", + }, + query: { + baseName: "query", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SegmentDataAttributesDataQueryUserStoreItems.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/segments/src/v2/models/SegmentDataSource.ts b/services/segments/src/v2/models/SegmentDataSource.ts new file mode 100644 index 000000000000..2004fa1f31e4 --- /dev/null +++ b/services/segments/src/v2/models/SegmentDataSource.ts @@ -0,0 +1,61 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +export class SegmentDataSource { + "handle": string; + "icon"?: string; + "id": string; + "name"?: string; + "uuid": string; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + handle: { + baseName: "handle", + type: "string", + required: true, + }, + icon: { + baseName: "icon", + type: "string", + }, + id: { + baseName: "id", + type: "string", + required: true, + }, + name: { + baseName: "name", + type: "string", + }, + uuid: { + baseName: "uuid", + type: "string", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SegmentDataSource.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/segments/src/v2/models/SegmentDataType.ts b/services/segments/src/v2/models/SegmentDataType.ts new file mode 100644 index 000000000000..596a07ebae16 --- /dev/null +++ b/services/segments/src/v2/models/SegmentDataType.ts @@ -0,0 +1,3 @@ +import { UnparsedObject } from "@datadog/datadog-api-client"; +export type SegmentDataType = typeof SEGMENT | UnparsedObject; +export const SEGMENT = "segment"; diff --git a/services/segments/src/v2/models/TypingInfo.ts b/services/segments/src/v2/models/TypingInfo.ts new file mode 100644 index 000000000000..9fc7cdd454fb --- /dev/null +++ b/services/segments/src/v2/models/TypingInfo.ts @@ -0,0 +1,43 @@ +import { ModelTypingInfo } from "@datadog/datadog-api-client"; + +import { APIErrorResponse } from "./APIErrorResponse"; +import { Segment } from "./Segment"; +import { SegmentArray } from "./SegmentArray"; +import { SegmentData } from "./SegmentData"; +import { SegmentDataAttributes } from "./SegmentDataAttributes"; +import { SegmentDataAttributesDataQuery } from "./SegmentDataAttributesDataQuery"; +import { SegmentDataAttributesDataQueryEventPlatformItems } from "./SegmentDataAttributesDataQueryEventPlatformItems"; +import { SegmentDataAttributesDataQueryReferenceTableItems } from "./SegmentDataAttributesDataQueryReferenceTableItems"; +import { SegmentDataAttributesDataQueryReferenceTableItemsColumnsItems } from "./SegmentDataAttributesDataQueryReferenceTableItemsColumnsItems"; +import { SegmentDataAttributesDataQueryReferenceTableItemsJoinCondition } from "./SegmentDataAttributesDataQueryReferenceTableItemsJoinCondition"; +import { SegmentDataAttributesDataQueryStaticItems } from "./SegmentDataAttributesDataQueryStaticItems"; +import { SegmentDataAttributesDataQueryUserStoreItems } from "./SegmentDataAttributesDataQueryUserStoreItems"; +import { SegmentDataSource } from "./SegmentDataSource"; + +export const TypingInfo: ModelTypingInfo = { + enumsMap: { + SegmentDataType: ["segment"], + }, + oneOfMap: {}, + typeMap: { + APIErrorResponse: APIErrorResponse, + Segment: Segment, + SegmentArray: SegmentArray, + SegmentData: SegmentData, + SegmentDataAttributes: SegmentDataAttributes, + SegmentDataAttributesDataQuery: SegmentDataAttributesDataQuery, + SegmentDataAttributesDataQueryEventPlatformItems: + SegmentDataAttributesDataQueryEventPlatformItems, + SegmentDataAttributesDataQueryReferenceTableItems: + SegmentDataAttributesDataQueryReferenceTableItems, + SegmentDataAttributesDataQueryReferenceTableItemsColumnsItems: + SegmentDataAttributesDataQueryReferenceTableItemsColumnsItems, + SegmentDataAttributesDataQueryReferenceTableItemsJoinCondition: + SegmentDataAttributesDataQueryReferenceTableItemsJoinCondition, + SegmentDataAttributesDataQueryStaticItems: + SegmentDataAttributesDataQueryStaticItems, + SegmentDataAttributesDataQueryUserStoreItems: + SegmentDataAttributesDataQueryUserStoreItems, + SegmentDataSource: SegmentDataSource, + }, +}; diff --git a/services/segments/tsconfig.json b/services/segments/tsconfig.json new file mode 100644 index 000000000000..d6c32bfb893c --- /dev/null +++ b/services/segments/tsconfig.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "strict": true, + /* Basic Options */ + "target": "es6", + "module": "commonjs", + "moduleResolution": "node", + "declaration": true, + + "esModuleInterop": true, + "resolveJsonModule": true, + + "noImplicitAny": true, + "noImplicitThis": true, + + /* Additional Checks */ + "noUnusedLocals": false /* Report errors on unused locals. */, // TODO: reenable (unused imports!) + "noUnusedParameters": false /* Report errors on unused parameters. */, // TODO: set to true again + "noImplicitReturns": true /* Report error when not all code paths in function return a value. */, + "noFallthroughCasesInSwitch": true /* Report errors for fallthrough cases in switch statement. */, + + "sourceMap": true, + "outDir": "./dist", + "lib": ["es6", "es7"] + }, + "exclude": ["dist", "node_modules", "tests"], + "include": ["src"] +} diff --git a/services/user_flow/.yarnrc.yml b/services/user_flow/.yarnrc.yml new file mode 100644 index 000000000000..3186f3f0795a --- /dev/null +++ b/services/user_flow/.yarnrc.yml @@ -0,0 +1 @@ +nodeLinker: node-modules diff --git a/services/user_flow/README.md b/services/user_flow/README.md new file mode 100644 index 000000000000..7af9bb51d6c5 --- /dev/null +++ b/services/user_flow/README.md @@ -0,0 +1,44 @@ +# @datadog/datadog-api-client-user-flow + +## Description + +API for user flow. + +## Navigation + +- [Installation](#installation) +- [Getting Started](#getting-started) + +## Installation + +```sh +# NPM +npm install @datadog/datadog-api-client-user-flow +# Yarn +yarn add @datadog/datadog-api-client-user-flow +``` + +## Getting Started +```ts +import { createConfiguration } from "@datadog/datadog-api-client"; +import { UserFlowApiV2 } from "@datadog/datadog-api-client-user-flow"; +import { v2 } from "@datadog/datadog-api-client-user-flow"; + +const configuration = createConfiguration(); +// Enable unstable operations +const configurationOpts = { + unstableOperations: { + "UserFlowApi.v2.getRumSankey": true + } +} + +const configuration = createConfiguration(configurationOpts); +const apiInstance = new UserFlowApiV2(configuration); +const params = {/* parameters */}; + +apiInstance.getRumSankey(params).then((data) => { + console.log("API called successfully. Returned data: " + JSON.stringify(data)); +}).catch((error) => { + console.error("Error calling API: " + error); +}); +``` \ No newline at end of file diff --git a/services/user_flow/package.json b/services/user_flow/package.json new file mode 100644 index 000000000000..d6829e9068ca --- /dev/null +++ b/services/user_flow/package.json @@ -0,0 +1,43 @@ +{ + "name": "@datadog/datadog-api-client-user-flow", + "description": "", + "author": "", + "keywords": [ + "api", + "fetch", + "typescript" + ], + "license": "Apache-2.0", + "licenses": [ + { + "type": "Apache-2.0", + "url": "http://www.apache.org/licenses/LICENSE-2.0" + } + ], + "repository": { + "type": "git", + "url": "https://github.com/DataDog/datadog-api-client-typescript.git", + "directory": "services/user-flow" + }, + "files": [ + "dist/**/*" + ], + "main": "./dist/index.js", + "typings": "./dist/index.d.ts", + "scripts": { + "prepack": "yarn workspace @datadog/datadog-api-client build && yarn build", + "build": "yarn generate-version-files && tsc", + "generate-version-files": "node -p \"'export const version = ' + JSON.stringify(require('./package.json').version)\" > src/version.ts" + }, + "dependencies": { + "@datadog/datadog-api-client": "^2.0.0-beta.0" + }, + "devDependencies": { + "typescript": "5.8.3" + }, + "engines": { + "node": ">=18.0.0" + }, + "version": "0.0.1", + "packageManager": "yarn@4.9.1" +} diff --git a/services/user_flow/src/index.ts b/services/user_flow/src/index.ts new file mode 100644 index 000000000000..225bb1a8e6e6 --- /dev/null +++ b/services/user_flow/src/index.ts @@ -0,0 +1,3 @@ +export * as v2 from "./v2"; + +export { UserFlowApi as UserFlowApiV2 } from "./v2/UserFlowApi"; diff --git a/services/user_flow/src/v2/UserFlowApi.ts b/services/user_flow/src/v2/UserFlowApi.ts new file mode 100644 index 000000000000..5d5a15c34c88 --- /dev/null +++ b/services/user_flow/src/v2/UserFlowApi.ts @@ -0,0 +1,193 @@ +import { + ApiException, + BaseAPIRequestFactory, + BaseServerConfiguration, + buildUserAgent, + Configuration, + createConfiguration, + deserialize, + getPreferredMediaType, + HttpMethod, + isBrowser, + logger, + normalizeMediaType, + parse, + RequiredError, + RequestContext, + ResponseContext, + serialize, + ServerConfiguration, + stringify, +} from "@datadog/datadog-api-client"; + +import { TypingInfo } from "./models/TypingInfo"; +import { APIErrorResponse } from "./models/APIErrorResponse"; +import { SankeyRequest } from "./models/SankeyRequest"; +import { SankeyResponse } from "./models/SankeyResponse"; +import { version } from "../version"; + +export class UserFlowApiRequestFactory extends BaseAPIRequestFactory { + public userAgent: string | undefined; + + public constructor(configuration: Configuration) { + super(configuration); + if (!isBrowser) { + this.userAgent = buildUserAgent("user-flow", version); + } + } + public async getRumSankey( + body: SankeyRequest, + _options?: Configuration, + ): Promise { + const _config = _options || this.configuration; + + if (!_config.unstableOperations["UserFlowApi.v2.getRumSankey"]) { + throw new Error( + "Unstable operation 'getRumSankey' is disabled. Enable it by setting `configuration.unstableOperations['UserFlowApi.v2.getRumSankey'] = true`", + ); + } + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError("body", "getRumSankey"); + } + + // Path Params + const localVarPath = "/api/v2/rum/sankey"; + + // Make Request Context + const { server, overrides } = _config.getServerAndOverrides( + "UserFlowApi.v2.getRumSankey", + UserFlowApi.operationServers, + ); + const requestContext = server.makeRequestContext( + localVarPath, + HttpMethod.POST, + overrides, + ); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Set User-Agent + if (this.userAgent) { + requestContext.setHeaderParam("User-Agent", this.userAgent); + } + + // Body Params + const contentType = getPreferredMediaType(["application/json"]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = stringify( + serialize(body, TypingInfo, "SankeyRequest", ""), + contentType, + ); + requestContext.setBody(serializedBody); + + return requestContext; + } +} + +export class UserFlowApiResponseProcessor { + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to getRumSankey + * @throws ApiException if the response code was not in [200, 299] + */ + public async getRumSankey( + response: ResponseContext, + ): Promise { + const contentType = normalizeMediaType(response.headers["content-type"]); + if (response.httpStatusCode === 200) { + const body: SankeyResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "SankeyResponse", + ) as SankeyResponse; + return body; + } + if (response.httpStatusCode === 429) { + const bodyText = parse(await response.body.text(), contentType); + let body: APIErrorResponse; + try { + body = deserialize( + bodyText, + TypingInfo, + "APIErrorResponse", + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText, + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: SankeyResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "SankeyResponse", + "", + ) as SankeyResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"', + ); + } +} + +export interface UserFlowApiGetRumSankeyRequest { + /** + * @type SankeyRequest + */ + body: SankeyRequest; +} + +export class UserFlowApi { + private requestFactory: UserFlowApiRequestFactory; + private responseProcessor: UserFlowApiResponseProcessor; + private configuration: Configuration; + + static operationServers: { [key: string]: BaseServerConfiguration[] } = {}; + + public constructor( + configuration?: Configuration, + requestFactory?: UserFlowApiRequestFactory, + responseProcessor?: UserFlowApiResponseProcessor, + ) { + this.configuration = configuration || createConfiguration(); + this.requestFactory = + requestFactory || new UserFlowApiRequestFactory(this.configuration); + this.responseProcessor = + responseProcessor || new UserFlowApiResponseProcessor(); + } + + /** + * Generate Sankey diagrams to visualize user flow paths and drop-off points + * @param param The request object + */ + public getRumSankey( + param: UserFlowApiGetRumSankeyRequest, + options?: Configuration, + ): Promise { + const requestContextPromise = this.requestFactory.getRumSankey( + param.body, + options, + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.getRumSankey(responseContext); + }); + }); + } +} diff --git a/services/user_flow/src/v2/index.ts b/services/user_flow/src/v2/index.ts new file mode 100644 index 000000000000..2c7545714e38 --- /dev/null +++ b/services/user_flow/src/v2/index.ts @@ -0,0 +1,23 @@ +export { UserFlowApiGetRumSankeyRequest, UserFlowApi } from "./UserFlowApi"; + +export { APIErrorResponse } from "./models/APIErrorResponse"; +export { SankeyRequest } from "./models/SankeyRequest"; +export { SankeyRequestData } from "./models/SankeyRequestData"; +export { SankeyRequestDataAttributes } from "./models/SankeyRequestDataAttributes"; +export { SankeyRequestDataAttributesDefinition } from "./models/SankeyRequestDataAttributesDefinition"; +export { SankeyRequestDataAttributesSampling } from "./models/SankeyRequestDataAttributesSampling"; +export { SankeyRequestDataAttributesSearch } from "./models/SankeyRequestDataAttributesSearch"; +export { SankeyRequestDataAttributesSearchAudienceFilters } from "./models/SankeyRequestDataAttributesSearchAudienceFilters"; +export { SankeyRequestDataAttributesSearchAudienceFiltersAccountsItems } from "./models/SankeyRequestDataAttributesSearchAudienceFiltersAccountsItems"; +export { SankeyRequestDataAttributesSearchAudienceFiltersSegmentsItems } from "./models/SankeyRequestDataAttributesSearchAudienceFiltersSegmentsItems"; +export { SankeyRequestDataAttributesSearchAudienceFiltersUsersItems } from "./models/SankeyRequestDataAttributesSearchAudienceFiltersUsersItems"; +export { SankeyRequestDataAttributesSearchOccurrences } from "./models/SankeyRequestDataAttributesSearchOccurrences"; +export { SankeyRequestDataAttributesTime } from "./models/SankeyRequestDataAttributesTime"; +export { SankeyRequestDataType } from "./models/SankeyRequestDataType"; +export { SankeyResponse } from "./models/SankeyResponse"; +export { SankeyResponseData } from "./models/SankeyResponseData"; +export { SankeyResponseDataAttributes } from "./models/SankeyResponseDataAttributes"; +export { SankeyResponseDataAttributesLinksItems } from "./models/SankeyResponseDataAttributesLinksItems"; +export { SankeyResponseDataAttributesNodesItems } from "./models/SankeyResponseDataAttributesNodesItems"; +export { SankeyResponseDataAttributesNodesItemsAggregatedNodesItems } from "./models/SankeyResponseDataAttributesNodesItemsAggregatedNodesItems"; +export { SankeyResponseDataType } from "./models/SankeyResponseDataType"; diff --git a/services/user_flow/src/v2/models/APIErrorResponse.ts b/services/user_flow/src/v2/models/APIErrorResponse.ts new file mode 100644 index 000000000000..58d6c35b80f0 --- /dev/null +++ b/services/user_flow/src/v2/models/APIErrorResponse.ts @@ -0,0 +1,45 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +/** + * API error response. + */ +export class APIErrorResponse { + /** + * A list of errors. + */ + "errors": Array; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + errors: { + baseName: "errors", + type: "Array", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return APIErrorResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/user_flow/src/v2/models/SankeyRequest.ts b/services/user_flow/src/v2/models/SankeyRequest.ts new file mode 100644 index 000000000000..ddb64880fea0 --- /dev/null +++ b/services/user_flow/src/v2/models/SankeyRequest.ts @@ -0,0 +1,40 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { SankeyRequestData } from "./SankeyRequestData"; + +export class SankeyRequest { + "data"?: SankeyRequestData; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "SankeyRequestData", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SankeyRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/user_flow/src/v2/models/SankeyRequestData.ts b/services/user_flow/src/v2/models/SankeyRequestData.ts new file mode 100644 index 000000000000..0fa98ec30eaf --- /dev/null +++ b/services/user_flow/src/v2/models/SankeyRequestData.ts @@ -0,0 +1,52 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { SankeyRequestDataAttributes } from "./SankeyRequestDataAttributes"; +import { SankeyRequestDataType } from "./SankeyRequestDataType"; + +export class SankeyRequestData { + "attributes"?: SankeyRequestDataAttributes; + "id"?: string; + "type": SankeyRequestDataType; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "SankeyRequestDataAttributes", + }, + id: { + baseName: "id", + type: "string", + }, + type: { + baseName: "type", + type: "SankeyRequestDataType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SankeyRequestData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/user_flow/src/v2/models/SankeyRequestDataAttributes.ts b/services/user_flow/src/v2/models/SankeyRequestDataAttributes.ts new file mode 100644 index 000000000000..a3e5f24234ed --- /dev/null +++ b/services/user_flow/src/v2/models/SankeyRequestDataAttributes.ts @@ -0,0 +1,73 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { SankeyRequestDataAttributesDefinition } from "./SankeyRequestDataAttributesDefinition"; +import { SankeyRequestDataAttributesSampling } from "./SankeyRequestDataAttributesSampling"; +import { SankeyRequestDataAttributesSearch } from "./SankeyRequestDataAttributesSearch"; +import { SankeyRequestDataAttributesTime } from "./SankeyRequestDataAttributesTime"; + +export class SankeyRequestDataAttributes { + "dataSource"?: string; + "definition"?: SankeyRequestDataAttributesDefinition; + "enforcedExecutionType"?: string; + "requestId"?: string; + "sampling"?: SankeyRequestDataAttributesSampling; + "search"?: SankeyRequestDataAttributesSearch; + "time"?: SankeyRequestDataAttributesTime; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + dataSource: { + baseName: "data_source", + type: "string", + }, + definition: { + baseName: "definition", + type: "SankeyRequestDataAttributesDefinition", + }, + enforcedExecutionType: { + baseName: "enforced_execution_type", + type: "string", + }, + requestId: { + baseName: "request_id", + type: "string", + }, + sampling: { + baseName: "sampling", + type: "SankeyRequestDataAttributesSampling", + }, + search: { + baseName: "search", + type: "SankeyRequestDataAttributesSearch", + }, + time: { + baseName: "time", + type: "SankeyRequestDataAttributesTime", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SankeyRequestDataAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/user_flow/src/v2/models/SankeyRequestDataAttributesDefinition.ts b/services/user_flow/src/v2/models/SankeyRequestDataAttributesDefinition.ts new file mode 100644 index 000000000000..70089907e2e1 --- /dev/null +++ b/services/user_flow/src/v2/models/SankeyRequestDataAttributesDefinition.ts @@ -0,0 +1,55 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +export class SankeyRequestDataAttributesDefinition { + "entriesPerStep"?: number; + "numberOfSteps"?: number; + "source"?: string; + "target"?: string; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + entriesPerStep: { + baseName: "entries_per_step", + type: "number", + format: "int64", + }, + numberOfSteps: { + baseName: "number_of_steps", + type: "number", + format: "int64", + }, + source: { + baseName: "source", + type: "string", + }, + target: { + baseName: "target", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SankeyRequestDataAttributesDefinition.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/user_flow/src/v2/models/SankeyRequestDataAttributesSampling.ts b/services/user_flow/src/v2/models/SankeyRequestDataAttributesSampling.ts new file mode 100644 index 000000000000..5aa0b0deea48 --- /dev/null +++ b/services/user_flow/src/v2/models/SankeyRequestDataAttributesSampling.ts @@ -0,0 +1,41 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +export class SankeyRequestDataAttributesSampling { + /** + * The `sampling` `enabled`. + */ + "enabled"?: boolean; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + enabled: { + baseName: "enabled", + type: "boolean", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SankeyRequestDataAttributesSampling.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/user_flow/src/v2/models/SankeyRequestDataAttributesSearch.ts b/services/user_flow/src/v2/models/SankeyRequestDataAttributesSearch.ts new file mode 100644 index 000000000000..980b50a52fdf --- /dev/null +++ b/services/user_flow/src/v2/models/SankeyRequestDataAttributesSearch.ts @@ -0,0 +1,56 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { SankeyRequestDataAttributesSearchAudienceFilters } from "./SankeyRequestDataAttributesSearchAudienceFilters"; +import { SankeyRequestDataAttributesSearchOccurrences } from "./SankeyRequestDataAttributesSearchOccurrences"; + +export class SankeyRequestDataAttributesSearch { + "audienceFilters"?: SankeyRequestDataAttributesSearchAudienceFilters; + "occurrences"?: SankeyRequestDataAttributesSearchOccurrences; + "query"?: string; + "subqueryId"?: string; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + audienceFilters: { + baseName: "audience_filters", + type: "SankeyRequestDataAttributesSearchAudienceFilters", + }, + occurrences: { + baseName: "occurrences", + type: "SankeyRequestDataAttributesSearchOccurrences", + }, + query: { + baseName: "query", + type: "string", + }, + subqueryId: { + baseName: "subquery_id", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SankeyRequestDataAttributesSearch.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/user_flow/src/v2/models/SankeyRequestDataAttributesSearchAudienceFilters.ts b/services/user_flow/src/v2/models/SankeyRequestDataAttributesSearchAudienceFilters.ts new file mode 100644 index 000000000000..650bc9b36fa1 --- /dev/null +++ b/services/user_flow/src/v2/models/SankeyRequestDataAttributesSearchAudienceFilters.ts @@ -0,0 +1,57 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { SankeyRequestDataAttributesSearchAudienceFiltersAccountsItems } from "./SankeyRequestDataAttributesSearchAudienceFiltersAccountsItems"; +import { SankeyRequestDataAttributesSearchAudienceFiltersSegmentsItems } from "./SankeyRequestDataAttributesSearchAudienceFiltersSegmentsItems"; +import { SankeyRequestDataAttributesSearchAudienceFiltersUsersItems } from "./SankeyRequestDataAttributesSearchAudienceFiltersUsersItems"; + +export class SankeyRequestDataAttributesSearchAudienceFilters { + "accounts"?: Array; + "formula"?: string; + "segments"?: Array; + "users"?: Array; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + accounts: { + baseName: "accounts", + type: "Array", + }, + formula: { + baseName: "formula", + type: "string", + }, + segments: { + baseName: "segments", + type: "Array", + }, + users: { + baseName: "users", + type: "Array", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SankeyRequestDataAttributesSearchAudienceFilters.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/user_flow/src/v2/models/SankeyRequestDataAttributesSearchAudienceFiltersAccountsItems.ts b/services/user_flow/src/v2/models/SankeyRequestDataAttributesSearchAudienceFiltersAccountsItems.ts new file mode 100644 index 000000000000..4f48d1f4592e --- /dev/null +++ b/services/user_flow/src/v2/models/SankeyRequestDataAttributesSearchAudienceFiltersAccountsItems.ts @@ -0,0 +1,44 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +export class SankeyRequestDataAttributesSearchAudienceFiltersAccountsItems { + "name": string; + "query"?: string; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + name: { + baseName: "name", + type: "string", + required: true, + }, + query: { + baseName: "query", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SankeyRequestDataAttributesSearchAudienceFiltersAccountsItems.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/user_flow/src/v2/models/SankeyRequestDataAttributesSearchAudienceFiltersSegmentsItems.ts b/services/user_flow/src/v2/models/SankeyRequestDataAttributesSearchAudienceFiltersSegmentsItems.ts new file mode 100644 index 000000000000..7fd7206988ae --- /dev/null +++ b/services/user_flow/src/v2/models/SankeyRequestDataAttributesSearchAudienceFiltersSegmentsItems.ts @@ -0,0 +1,45 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +export class SankeyRequestDataAttributesSearchAudienceFiltersSegmentsItems { + "name": string; + "segmentId": string; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + name: { + baseName: "name", + type: "string", + required: true, + }, + segmentId: { + baseName: "segment_id", + type: "string", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SankeyRequestDataAttributesSearchAudienceFiltersSegmentsItems.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/user_flow/src/v2/models/SankeyRequestDataAttributesSearchAudienceFiltersUsersItems.ts b/services/user_flow/src/v2/models/SankeyRequestDataAttributesSearchAudienceFiltersUsersItems.ts new file mode 100644 index 000000000000..6b7936620cde --- /dev/null +++ b/services/user_flow/src/v2/models/SankeyRequestDataAttributesSearchAudienceFiltersUsersItems.ts @@ -0,0 +1,44 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +export class SankeyRequestDataAttributesSearchAudienceFiltersUsersItems { + "name": string; + "query"?: string; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + name: { + baseName: "name", + type: "string", + required: true, + }, + query: { + baseName: "query", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SankeyRequestDataAttributesSearchAudienceFiltersUsersItems.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/user_flow/src/v2/models/SankeyRequestDataAttributesSearchOccurrences.ts b/services/user_flow/src/v2/models/SankeyRequestDataAttributesSearchOccurrences.ts new file mode 100644 index 000000000000..814789fd6e96 --- /dev/null +++ b/services/user_flow/src/v2/models/SankeyRequestDataAttributesSearchOccurrences.ts @@ -0,0 +1,50 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +export class SankeyRequestDataAttributesSearchOccurrences { + "meta"?: { [key: string]: string }; + "operator": string; + "value": string; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + meta: { + baseName: "meta", + type: "{ [key: string]: string; }", + }, + operator: { + baseName: "operator", + type: "string", + required: true, + }, + value: { + baseName: "value", + type: "string", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SankeyRequestDataAttributesSearchOccurrences.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/user_flow/src/v2/models/SankeyRequestDataAttributesTime.ts b/services/user_flow/src/v2/models/SankeyRequestDataAttributesTime.ts new file mode 100644 index 000000000000..b7b0ba1f50ee --- /dev/null +++ b/services/user_flow/src/v2/models/SankeyRequestDataAttributesTime.ts @@ -0,0 +1,45 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +export class SankeyRequestDataAttributesTime { + "from"?: number; + "to"?: number; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + from: { + baseName: "from", + type: "number", + format: "int64", + }, + to: { + baseName: "to", + type: "number", + format: "int64", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SankeyRequestDataAttributesTime.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/user_flow/src/v2/models/SankeyRequestDataType.ts b/services/user_flow/src/v2/models/SankeyRequestDataType.ts new file mode 100644 index 000000000000..52c63a2cb564 --- /dev/null +++ b/services/user_flow/src/v2/models/SankeyRequestDataType.ts @@ -0,0 +1,3 @@ +import { UnparsedObject } from "@datadog/datadog-api-client"; +export type SankeyRequestDataType = typeof SANKEY_REQUEST | UnparsedObject; +export const SANKEY_REQUEST = "sankey_request"; diff --git a/services/user_flow/src/v2/models/SankeyResponse.ts b/services/user_flow/src/v2/models/SankeyResponse.ts new file mode 100644 index 000000000000..469488c0b7bf --- /dev/null +++ b/services/user_flow/src/v2/models/SankeyResponse.ts @@ -0,0 +1,40 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { SankeyResponseData } from "./SankeyResponseData"; + +export class SankeyResponse { + "data"?: SankeyResponseData; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "SankeyResponseData", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SankeyResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/user_flow/src/v2/models/SankeyResponseData.ts b/services/user_flow/src/v2/models/SankeyResponseData.ts new file mode 100644 index 000000000000..8cc0880dbd46 --- /dev/null +++ b/services/user_flow/src/v2/models/SankeyResponseData.ts @@ -0,0 +1,52 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { SankeyResponseDataAttributes } from "./SankeyResponseDataAttributes"; +import { SankeyResponseDataType } from "./SankeyResponseDataType"; + +export class SankeyResponseData { + "attributes"?: SankeyResponseDataAttributes; + "id"?: string; + "type": SankeyResponseDataType; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "SankeyResponseDataAttributes", + }, + id: { + baseName: "id", + type: "string", + }, + type: { + baseName: "type", + type: "SankeyResponseDataType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SankeyResponseData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/user_flow/src/v2/models/SankeyResponseDataAttributes.ts b/services/user_flow/src/v2/models/SankeyResponseDataAttributes.ts new file mode 100644 index 000000000000..b626489bf2fd --- /dev/null +++ b/services/user_flow/src/v2/models/SankeyResponseDataAttributes.ts @@ -0,0 +1,46 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { SankeyResponseDataAttributesLinksItems } from "./SankeyResponseDataAttributesLinksItems"; +import { SankeyResponseDataAttributesNodesItems } from "./SankeyResponseDataAttributesNodesItems"; + +export class SankeyResponseDataAttributes { + "links"?: Array; + "nodes"?: Array; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + links: { + baseName: "links", + type: "Array", + }, + nodes: { + baseName: "nodes", + type: "Array", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SankeyResponseDataAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/user_flow/src/v2/models/SankeyResponseDataAttributesLinksItems.ts b/services/user_flow/src/v2/models/SankeyResponseDataAttributesLinksItems.ts new file mode 100644 index 000000000000..e7a8a19e56f7 --- /dev/null +++ b/services/user_flow/src/v2/models/SankeyResponseDataAttributesLinksItems.ts @@ -0,0 +1,60 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +export class SankeyResponseDataAttributesLinksItems { + "column"?: number; + "id"?: string; + "source"?: string; + "target"?: string; + "value"?: number; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + column: { + baseName: "column", + type: "number", + format: "int64", + }, + id: { + baseName: "id", + type: "string", + }, + source: { + baseName: "source", + type: "string", + }, + target: { + baseName: "target", + type: "string", + }, + value: { + baseName: "value", + type: "number", + format: "int64", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SankeyResponseDataAttributesLinksItems.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/user_flow/src/v2/models/SankeyResponseDataAttributesNodesItems.ts b/services/user_flow/src/v2/models/SankeyResponseDataAttributesNodesItems.ts new file mode 100644 index 000000000000..5fd22448277c --- /dev/null +++ b/services/user_flow/src/v2/models/SankeyResponseDataAttributesNodesItems.ts @@ -0,0 +1,79 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { SankeyResponseDataAttributesNodesItemsAggregatedNodesItems } from "./SankeyResponseDataAttributesNodesItemsAggregatedNodesItems"; + +export class SankeyResponseDataAttributesNodesItems { + "aggregatedNodes"?: Array; + "column"?: number; + "id"?: string; + "incomingValue"?: number; + "name"?: string; + "outgoingValue"?: number; + "type"?: string; + "value"?: number; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + aggregatedNodes: { + baseName: "aggregated_nodes", + type: "Array", + }, + column: { + baseName: "column", + type: "number", + format: "int64", + }, + id: { + baseName: "id", + type: "string", + }, + incomingValue: { + baseName: "incoming_value", + type: "number", + format: "int64", + }, + name: { + baseName: "name", + type: "string", + }, + outgoingValue: { + baseName: "outgoing_value", + type: "number", + format: "int64", + }, + type: { + baseName: "type", + type: "string", + }, + value: { + baseName: "value", + type: "number", + format: "int64", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SankeyResponseDataAttributesNodesItems.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/user_flow/src/v2/models/SankeyResponseDataAttributesNodesItemsAggregatedNodesItems.ts b/services/user_flow/src/v2/models/SankeyResponseDataAttributesNodesItemsAggregatedNodesItems.ts new file mode 100644 index 000000000000..698bfdcb62a6 --- /dev/null +++ b/services/user_flow/src/v2/models/SankeyResponseDataAttributesNodesItemsAggregatedNodesItems.ts @@ -0,0 +1,66 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +export class SankeyResponseDataAttributesNodesItemsAggregatedNodesItems { + "id"?: string; + "incomingValue"?: number; + "name"?: string; + "outgoingValue"?: number; + "type"?: string; + "value"?: number; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + id: { + baseName: "id", + type: "string", + }, + incomingValue: { + baseName: "incoming_value", + type: "number", + format: "int64", + }, + name: { + baseName: "name", + type: "string", + }, + outgoingValue: { + baseName: "outgoing_value", + type: "number", + format: "int64", + }, + type: { + baseName: "type", + type: "string", + }, + value: { + baseName: "value", + type: "number", + format: "int64", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SankeyResponseDataAttributesNodesItemsAggregatedNodesItems.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/user_flow/src/v2/models/SankeyResponseDataType.ts b/services/user_flow/src/v2/models/SankeyResponseDataType.ts new file mode 100644 index 000000000000..ef9241d1f9f7 --- /dev/null +++ b/services/user_flow/src/v2/models/SankeyResponseDataType.ts @@ -0,0 +1,3 @@ +import { UnparsedObject } from "@datadog/datadog-api-client"; +export type SankeyResponseDataType = typeof SANKEY_RESPONSE | UnparsedObject; +export const SANKEY_RESPONSE = "sankey_response"; diff --git a/services/user_flow/src/v2/models/TypingInfo.ts b/services/user_flow/src/v2/models/TypingInfo.ts new file mode 100644 index 000000000000..5b1c2894220c --- /dev/null +++ b/services/user_flow/src/v2/models/TypingInfo.ts @@ -0,0 +1,59 @@ +import { ModelTypingInfo } from "@datadog/datadog-api-client"; + +import { APIErrorResponse } from "./APIErrorResponse"; +import { SankeyRequest } from "./SankeyRequest"; +import { SankeyRequestData } from "./SankeyRequestData"; +import { SankeyRequestDataAttributes } from "./SankeyRequestDataAttributes"; +import { SankeyRequestDataAttributesDefinition } from "./SankeyRequestDataAttributesDefinition"; +import { SankeyRequestDataAttributesSampling } from "./SankeyRequestDataAttributesSampling"; +import { SankeyRequestDataAttributesSearch } from "./SankeyRequestDataAttributesSearch"; +import { SankeyRequestDataAttributesSearchAudienceFilters } from "./SankeyRequestDataAttributesSearchAudienceFilters"; +import { SankeyRequestDataAttributesSearchAudienceFiltersAccountsItems } from "./SankeyRequestDataAttributesSearchAudienceFiltersAccountsItems"; +import { SankeyRequestDataAttributesSearchAudienceFiltersSegmentsItems } from "./SankeyRequestDataAttributesSearchAudienceFiltersSegmentsItems"; +import { SankeyRequestDataAttributesSearchAudienceFiltersUsersItems } from "./SankeyRequestDataAttributesSearchAudienceFiltersUsersItems"; +import { SankeyRequestDataAttributesSearchOccurrences } from "./SankeyRequestDataAttributesSearchOccurrences"; +import { SankeyRequestDataAttributesTime } from "./SankeyRequestDataAttributesTime"; +import { SankeyResponse } from "./SankeyResponse"; +import { SankeyResponseData } from "./SankeyResponseData"; +import { SankeyResponseDataAttributes } from "./SankeyResponseDataAttributes"; +import { SankeyResponseDataAttributesLinksItems } from "./SankeyResponseDataAttributesLinksItems"; +import { SankeyResponseDataAttributesNodesItems } from "./SankeyResponseDataAttributesNodesItems"; +import { SankeyResponseDataAttributesNodesItemsAggregatedNodesItems } from "./SankeyResponseDataAttributesNodesItemsAggregatedNodesItems"; + +export const TypingInfo: ModelTypingInfo = { + enumsMap: { + SankeyRequestDataType: ["sankey_request"], + SankeyResponseDataType: ["sankey_response"], + }, + oneOfMap: {}, + typeMap: { + APIErrorResponse: APIErrorResponse, + SankeyRequest: SankeyRequest, + SankeyRequestData: SankeyRequestData, + SankeyRequestDataAttributes: SankeyRequestDataAttributes, + SankeyRequestDataAttributesDefinition: + SankeyRequestDataAttributesDefinition, + SankeyRequestDataAttributesSampling: SankeyRequestDataAttributesSampling, + SankeyRequestDataAttributesSearch: SankeyRequestDataAttributesSearch, + SankeyRequestDataAttributesSearchAudienceFilters: + SankeyRequestDataAttributesSearchAudienceFilters, + SankeyRequestDataAttributesSearchAudienceFiltersAccountsItems: + SankeyRequestDataAttributesSearchAudienceFiltersAccountsItems, + SankeyRequestDataAttributesSearchAudienceFiltersSegmentsItems: + SankeyRequestDataAttributesSearchAudienceFiltersSegmentsItems, + SankeyRequestDataAttributesSearchAudienceFiltersUsersItems: + SankeyRequestDataAttributesSearchAudienceFiltersUsersItems, + SankeyRequestDataAttributesSearchOccurrences: + SankeyRequestDataAttributesSearchOccurrences, + SankeyRequestDataAttributesTime: SankeyRequestDataAttributesTime, + SankeyResponse: SankeyResponse, + SankeyResponseData: SankeyResponseData, + SankeyResponseDataAttributes: SankeyResponseDataAttributes, + SankeyResponseDataAttributesLinksItems: + SankeyResponseDataAttributesLinksItems, + SankeyResponseDataAttributesNodesItems: + SankeyResponseDataAttributesNodesItems, + SankeyResponseDataAttributesNodesItemsAggregatedNodesItems: + SankeyResponseDataAttributesNodesItemsAggregatedNodesItems, + }, +}; diff --git a/services/user_flow/tsconfig.json b/services/user_flow/tsconfig.json new file mode 100644 index 000000000000..d6c32bfb893c --- /dev/null +++ b/services/user_flow/tsconfig.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "strict": true, + /* Basic Options */ + "target": "es6", + "module": "commonjs", + "moduleResolution": "node", + "declaration": true, + + "esModuleInterop": true, + "resolveJsonModule": true, + + "noImplicitAny": true, + "noImplicitThis": true, + + /* Additional Checks */ + "noUnusedLocals": false /* Report errors on unused locals. */, // TODO: reenable (unused imports!) + "noUnusedParameters": false /* Report errors on unused parameters. */, // TODO: set to true again + "noImplicitReturns": true /* Report error when not all code paths in function return a value. */, + "noFallthroughCasesInSwitch": true /* Report errors for fallthrough cases in switch statement. */, + + "sourceMap": true, + "outDir": "./dist", + "lib": ["es6", "es7"] + }, + "exclude": ["dist", "node_modules", "tests"], + "include": ["src"] +} diff --git a/yarn.lock b/yarn.lock index e9fa478d10f8..787f8e775bc1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -442,6 +442,15 @@ __metadata: languageName: unknown linkType: soft +"@datadog/datadog-api-client-cohort@workspace:services/cohort": + version: 0.0.0-use.local + resolution: "@datadog/datadog-api-client-cohort@workspace:services/cohort" + dependencies: + "@datadog/datadog-api-client": "npm:^2.0.0-beta.0" + typescript: "npm:5.8.3" + languageName: unknown + linkType: soft + "@datadog/datadog-api-client-confluent-cloud@workspace:services/confluent_cloud": version: 0.0.0-use.local resolution: "@datadog/datadog-api-client-confluent-cloud@workspace:services/confluent_cloud" @@ -595,6 +604,15 @@ __metadata: languageName: unknown linkType: soft +"@datadog/datadog-api-client-funnel@workspace:services/funnel": + version: 0.0.0-use.local + resolution: "@datadog/datadog-api-client-funnel@workspace:services/funnel" + dependencies: + "@datadog/datadog-api-client": "npm:^2.0.0-beta.0" + typescript: "npm:5.8.3" + languageName: unknown + linkType: soft + "@datadog/datadog-api-client-gcp-integration@workspace:services/gcp_integration": version: 0.0.0-use.local resolution: "@datadog/datadog-api-client-gcp-integration@workspace:services/gcp_integration" @@ -919,6 +937,15 @@ __metadata: languageName: unknown linkType: soft +"@datadog/datadog-api-client-segments@workspace:services/segments": + version: 0.0.0-use.local + resolution: "@datadog/datadog-api-client-segments@workspace:services/segments" + dependencies: + "@datadog/datadog-api-client": "npm:^2.0.0-beta.0" + typescript: "npm:5.8.3" + languageName: unknown + linkType: soft + "@datadog/datadog-api-client-sensitive-data-scanner@workspace:services/sensitive_data_scanner": version: 0.0.0-use.local resolution: "@datadog/datadog-api-client-sensitive-data-scanner@workspace:services/sensitive_data_scanner" @@ -1090,6 +1117,15 @@ __metadata: languageName: unknown linkType: soft +"@datadog/datadog-api-client-user-flow@workspace:services/user_flow": + version: 0.0.0-use.local + resolution: "@datadog/datadog-api-client-user-flow@workspace:services/user_flow" + dependencies: + "@datadog/datadog-api-client": "npm:^2.0.0-beta.0" + typescript: "npm:5.8.3" + languageName: unknown + linkType: soft + "@datadog/datadog-api-client-users@workspace:services/users": version: 0.0.0-use.local resolution: "@datadog/datadog-api-client-users@workspace:services/users"