diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index b9a63afce0a1..59e19780a684 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -51317,6 +51317,713 @@ components: $ref: '#/components/schemas/RumRetentionFilterData' type: array type: object + RumSegmentCreateAttributes: + description: Attributes for creating a new segment. + properties: + data_query: + $ref: '#/components/schemas/RumSegmentDataQuery' + description: + description: A description of the segment. + example: Users who visited the homepage. + type: string + name: + description: The name of the segment. + example: My Segment + type: string + tags: + description: A list of tags for the segment. + example: + - team:frontend + items: + type: string + type: array + required: + - name + - data_query + type: object + RumSegmentCreateData: + description: Data object for a segment creation request. + properties: + attributes: + $ref: '#/components/schemas/RumSegmentCreateAttributes' + type: + $ref: '#/components/schemas/RumSegmentResourceType' + required: + - type + - attributes + type: object + RumSegmentCreateRequest: + description: Request body for creating a new segment. + properties: + data: + $ref: '#/components/schemas/RumSegmentCreateData' + required: + - data + type: object + RumSegmentDataQuery: + description: Query definition for the segment. Contains one or more query blocks + and an optional combination formula. + properties: + combination: + description: Boolean expression combining multiple query blocks. + example: (logs && apm_home) && NOT(apm_trace) + type: string + event_platforms: + description: List of event platform query blocks. + items: + $ref: '#/components/schemas/RumSegmentEventPlatform' + type: array + journeys: + description: List of journey-based query blocks. + items: + $ref: '#/components/schemas/RumSegmentJourney' + type: array + reference_tables: + description: List of reference table query blocks. + items: + $ref: '#/components/schemas/RumSegmentReferenceTable' + type: array + static: + description: List of static user list blocks. + items: + $ref: '#/components/schemas/RumSegmentStaticEntry' + type: array + templates: + description: List of template-based query blocks. + items: + $ref: '#/components/schemas/RumSegmentTemplateInstance' + type: array + type: object + RumSegmentDeleteAttributes: + description: Attributes of a deleted segment response. + properties: + disabled_at: + description: The timestamp when the segment was disabled in RFC 3339 format. + example: '2024-03-15T10:30:00Z' + format: date-time + type: string + disabled_by: + $ref: '#/components/schemas/RumSegmentUser' + name: + description: The name of the deleted segment. + example: My Segment + type: string + uuid: + description: The unique identifier of the deleted segment. + example: a1b2c3d4-1234-5678-9abc-123456789abc + type: string + required: + - uuid + - name + - disabled_at + - disabled_by + type: object + RumSegmentDeleteData: + description: Data object for a deleted segment response. + properties: + attributes: + $ref: '#/components/schemas/RumSegmentDeleteAttributes' + id: + description: Unique identifier for the deleted segment. + example: a1b2c3d4-1234-5678-9abc-123456789abc + type: string + type: + $ref: '#/components/schemas/RumSegmentDeleteType' + required: + - id + - type + - attributes + type: object + RumSegmentDeleteResponse: + description: Response for a segment deletion. + properties: + data: + $ref: '#/components/schemas/RumSegmentDeleteData' + required: + - data + type: object + RumSegmentDeleteType: + description: Type of the deleted segment resource. + enum: + - deleted_segment + example: deleted_segment + type: string + x-enum-varnames: + - DELETED_SEGMENT + RumSegmentEventPlatform: + description: An event platform query block within a segment data query. + properties: + facet: + description: The facet to extract user identifiers from. + example: '@usr.id' + type: string + from: + description: The start of the time range in milliseconds since epoch. + example: 1709888355000 + format: int64 + type: integer + name: + description: The name of this query block. + example: logs + type: string + query: + description: The search query for filtering events. + example: '@type:view @view.url_path:/logs' + type: string + to: + description: The end of the time range in milliseconds since epoch. + example: 1710493155000 + format: int64 + type: integer + required: + - name + - query + - facet + type: object + RumSegmentJourney: + description: A journey-based query block within a segment data query. + properties: + conversion_type: + description: The type of conversion to track. + example: any + type: string + group_by: + description: The facet to group journey results by. + example: '@usr.id' + type: string + name: + description: The name of this journey query block. + example: my_journey + type: string + search: + description: The search query for filtering events. + example: '@type:view' + type: string + type: object + RumSegmentListResponse: + description: Response for listing segments. + properties: + data: + description: The list of segments. + items: + $ref: '#/components/schemas/RumSegmentResponseData' + type: array + required: + - data + type: object + RumSegmentReferenceTable: + description: A reference table query block within a segment data query. + properties: + columns: + description: The columns to include from the reference table. + items: + $ref: '#/components/schemas/RumSegmentReferenceTableColumn' + type: array + filter_query: + description: An optional filter query for the reference table data. + example: '' + type: string + join_condition: + $ref: '#/components/schemas/RumSegmentReferenceTableJoinCondition' + name: + description: The name of this query block. + example: my_ref_table + type: string + table_name: + description: The name of the reference table. + example: my_table + type: string + required: + - name + - table_name + - columns + - join_condition + type: object + RumSegmentReferenceTableColumn: + description: A column definition in a reference table query block. + properties: + name: + description: The name of the column. + example: user_id + type: string + required: + - name + type: object + RumSegmentReferenceTableJoinCondition: + description: The join condition for a reference table query block. + properties: + column_name: + description: The reference table column to join on. + example: user_id + type: string + facet: + description: The RUM facet to join on. + example: '@usr.id' + type: string + required: + - facet + - column_name + type: object + RumSegmentResourceType: + description: Type of the segment resource. + enum: + - segment + example: segment + type: string + x-enum-varnames: + - SEGMENT + RumSegmentResponse: + description: Response containing a single segment. + properties: + data: + $ref: '#/components/schemas/RumSegmentResponseData' + required: + - data + type: object + RumSegmentResponseAttributes: + description: Attributes of a segment in a response. + properties: + created_at: + description: The creation timestamp in RFC 3339 format. + example: '2024-03-15T10:30:00Z' + format: date-time + type: string + created_by: + $ref: '#/components/schemas/RumSegmentUser' + data_query: + $ref: '#/components/schemas/RumSegmentDataQuery' + description: + description: A description of the segment. + example: Users who visited the homepage. + type: string + modified_at: + description: The last modification timestamp in RFC 3339 format. + example: '2024-03-15T10:30:00Z' + format: date-time + type: string + modified_by: + $ref: '#/components/schemas/RumSegmentUser' + name: + description: The name of the segment. + example: My Segment + type: string + org_id: + description: The organization identifier. + example: 123456 + format: int64 + type: integer + row_count: + description: The number of users in the segment. + example: 500 + format: int64 + type: integer + source: + $ref: '#/components/schemas/RumSegmentSource' + tags: + description: A list of tags for the segment. + example: + - team:frontend + items: + type: string + type: array + type: + $ref: '#/components/schemas/RumSegmentSegmentType' + uuid: + description: The unique identifier of the segment. + example: a1b2c3d4-1234-5678-9abc-123456789abc + type: string + version: + description: The version number of the segment. + example: 1 + format: int64 + type: integer + required: + - uuid + - org_id + - name + - description + - data_query + - created_by + - modified_by + - created_at + - modified_at + - row_count + - version + - tags + - type + - source + type: object + RumSegmentResponseData: + description: Data object for a segment in a response. + properties: + attributes: + $ref: '#/components/schemas/RumSegmentResponseAttributes' + id: + description: The unique identifier of the segment. + example: a1b2c3d4-1234-5678-9abc-123456789abc + type: string + type: + $ref: '#/components/schemas/RumSegmentResourceType' + required: + - id + - type + - attributes + type: object + RumSegmentSegmentType: + description: The type of a segment based on its data query configuration. + enum: + - static + - event_platform + - combination + - journeys + - reference_table + - templates + example: event_platform + type: string + x-enum-varnames: + - STATIC + - EVENT_PLATFORM + - COMBINATION + - JOURNEYS + - REFERENCE_TABLE + - TEMPLATES + RumSegmentSource: + description: The source of a segment. + enum: + - user_created + - initial + example: user_created + type: string + x-enum-varnames: + - USER_CREATED + - INITIAL + RumSegmentStaticEntry: + description: A static user list entry within a segment data query. + properties: + id: + description: The identifier of the static list. + example: static-list-1 + type: string + name: + description: The name of the static list. + example: My Static List + type: string + user_count: + description: The number of users in the static list. + example: 500 + format: int64 + type: integer + required: + - id + - name + - user_count + type: object + RumSegmentTemplateInstance: + description: A template-based query block within a segment data query. + properties: + from: + description: The start of the time range in milliseconds since epoch. + example: 1709888355000 + format: int64 + type: integer + parameters: + additionalProperties: + type: string + description: The template parameters as key-value pairs. + example: + threshold: '5' + type: object + template_id: + description: The identifier of the template. + example: stickiness-v1 + type: string + to: + description: The end of the time range in milliseconds since epoch. + example: 1710493155000 + format: int64 + type: integer + required: + - template_id + type: object + RumSegmentTemplateListResponse: + description: Response for listing segment templates. + properties: + data: + description: The list of segment templates. + items: + $ref: '#/components/schemas/RumSegmentTemplateResponseData' + type: array + required: + - data + type: object + RumSegmentTemplateParameterDef: + description: A parameter definition for a segment template. + properties: + default: + description: The default value for the parameter. + example: '5' + type: string + description: + description: A description of the parameter. + example: The minimum number of sessions. + type: string + validate: + description: Validation rules for the parameter. + example: required + type: string + required: + - description + - default + - validate + type: object + RumSegmentTemplateResourceType: + description: Type of the segment template resource. + enum: + - template_metadata + example: template_metadata + type: string + x-enum-varnames: + - TEMPLATE_METADATA + RumSegmentTemplateResponseAttributes: + description: Attributes of a segment template in a response. + properties: + category: + description: The category of the template. + example: engagement + type: string + created_at: + description: The creation timestamp in RFC 3339 format. + example: '2024-01-01T00:00:00Z' + format: date-time + type: string + description: + description: A description of the template. + example: Users who visited at least N times. + type: string + modified_at: + description: The last modification timestamp in RFC 3339 format. + example: '2024-01-01T00:00:00Z' + format: date-time + type: string + name: + description: The name of the template. + example: stickiness-v1 + type: string + parameters: + additionalProperties: + $ref: '#/components/schemas/RumSegmentTemplateParameterDef' + description: The template parameter definitions. + type: object + status: + $ref: '#/components/schemas/RumSegmentTemplateStatus' + version: + description: The version number of the template. + example: 1 + format: int64 + type: integer + required: + - name + - description + - category + - parameters + - status + - version + - created_at + - modified_at + type: object + RumSegmentTemplateResponseData: + description: Data object for a segment template in a response. + properties: + attributes: + $ref: '#/components/schemas/RumSegmentTemplateResponseAttributes' + id: + description: The unique identifier of the template. + example: stickiness-v1 + type: string + type: + $ref: '#/components/schemas/RumSegmentTemplateResourceType' + required: + - id + - type + - attributes + type: object + RumSegmentTemplateStatus: + description: The status of a segment template. + enum: + - active + - deprecated + - archived + example: active + type: string + x-enum-varnames: + - ACTIVE + - DEPRECATED + - ARCHIVED + RumSegmentUpdateAttributes: + description: Attributes for updating a segment. All fields are optional. + properties: + data_query: + $ref: '#/components/schemas/RumSegmentDataQuery' + description: + description: The updated description of the segment. + example: Updated description. + type: string + name: + description: The updated name of the segment. + example: Updated Segment Name + type: string + tags: + description: The updated list of tags for the segment. + example: + - team:backend + items: + type: string + type: array + type: object + RumSegmentUpdateData: + description: Data object for a segment update request. + properties: + attributes: + $ref: '#/components/schemas/RumSegmentUpdateAttributes' + id: + description: The identifier of the segment to update. + example: a1b2c3d4-1234-5678-9abc-123456789abc + type: string + type: + $ref: '#/components/schemas/RumSegmentResourceType' + required: + - id + - type + - attributes + type: object + RumSegmentUpdateRequest: + description: Request body for updating a segment. + properties: + data: + $ref: '#/components/schemas/RumSegmentUpdateData' + required: + - data + type: object + RumSegmentUser: + description: A user who performed an action on a segment. + properties: + handle: + description: The email handle of the user. + example: john.doe@example.com + type: string + icon: + description: The URL of the user icon. + example: https://example.com/icon.png + type: string + id: + description: The numeric identifier of the user. + example: '12' + type: string + name: + description: The display name of the user. + example: John Doe + type: string + uuid: + description: The unique identifier of the user. + example: user-uuid-123 + type: string + required: + - id + - uuid + - name + - handle + - icon + type: object + RumStaticSegmentCreateAttributes: + description: Attributes for creating a new static segment. + properties: + description: + description: A description of the static segment. + example: Users from a specific journey. + type: string + journey_query_object: + $ref: '#/components/schemas/RumStaticSegmentJourneyQueryObject' + name: + description: The name of the static segment. + example: My Static Segment + type: string + tags: + description: A list of tags for the static segment. + example: + - team:frontend + items: + type: string + type: array + required: + - name + - description + - journey_query_object + type: object + RumStaticSegmentCreateData: + description: Data object for a static segment creation request. + properties: + attributes: + $ref: '#/components/schemas/RumStaticSegmentCreateAttributes' + type: + $ref: '#/components/schemas/RumStaticSegmentRequestType' + required: + - type + - attributes + type: object + RumStaticSegmentCreateRequest: + description: Request body for creating a new static segment. + properties: + data: + $ref: '#/components/schemas/RumStaticSegmentCreateData' + required: + - data + type: object + RumStaticSegmentJourneyFilter: + description: A filter within a journey query node. + properties: + attribute: + description: The attribute to filter on. + example: '@type' + type: string + value: + description: The value to match. + example: view + type: string + required: + - attribute + - value + type: object + RumStaticSegmentJourneyNode: + description: A node in a journey query object. + properties: + filters: + description: The list of filters for this node. + items: + $ref: '#/components/schemas/RumStaticSegmentJourneyFilter' + type: array + required: + - filters + type: object + RumStaticSegmentJourneyQueryObject: + description: The journey query object used to compute the static segment user + list. + properties: + nodes: + description: The list of journey nodes defining the query. + items: + $ref: '#/components/schemas/RumStaticSegmentJourneyNode' + type: array + required: + - nodes + type: object + RumStaticSegmentRequestType: + description: Type of the static segment creation request resource. + enum: + - create_static_segment_request + example: create_static_segment_request + type: string + x-enum-varnames: + - CREATE_STATIC_SEGMENT_REQUEST RunRetentionFilterName: description: The name of a RUM retention filter. example: Retention filter for session @@ -93185,6 +93892,329 @@ paths: summary: List rum replay viewership history sessions tags: - Rum Replay Viewership + /api/v2/rum/segment: + get: + description: List all user segments for the current organization. Supports sorting + and pagination. + operationId: ListRumSegments + parameters: + - description: Sort order for the segments list. + in: query + name: sort + required: false + schema: + example: name + type: string + - description: Maximum number of segments to return. + in: query + name: limit + required: false + schema: + example: 25 + type: integer + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/RumSegmentListResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: List all RUM segments + tags: + - RUM User Segments + x-unstable: '**Note**: This endpoint is in preview and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + post: + description: Create a new user segment for the current organization. + operationId: CreateRumSegment + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RumSegmentCreateRequest' + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/RumSegmentResponse' + description: Created + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Conflict + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Create a RUM segment + tags: + - RUM User Segments + x-unstable: '**Note**: This endpoint is in preview and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/rum/segment/initialize: + post: + description: Initialize default segments for the current organization. This + creates a set of predefined segments if they do not already exist. + operationId: InitializeRumSegments + responses: + '200': + description: OK + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Initialize RUM segments + tags: + - RUM User Segments + x-unstable: '**Note**: This endpoint is in preview and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/rum/segment/static: + post: + description: Create a new static user segment from a journey query. Static segments + contain a fixed list of users computed from the query at creation time. + operationId: CreateRumStaticSegment + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RumStaticSegmentCreateRequest' + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/RumSegmentResponse' + description: Created + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Conflict + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Create a static RUM segment + tags: + - RUM User Segments + x-unstable: '**Note**: This endpoint is in preview and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/rum/segment/templates: + get: + description: List all available segment templates. Templates provide predefined + segment configurations that can be customized with parameters. + operationId: ListRumSegmentTemplates + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/RumSegmentTemplateListResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: List RUM segment templates + tags: + - RUM User Segments + x-unstable: '**Note**: This endpoint is in preview and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/rum/segment/{segment_id}: + delete: + description: Delete a user segment by its identifier. + operationId: DeleteRumSegment + parameters: + - description: The identifier of the segment. + in: path + name: segment_id + required: true + schema: + example: a1b2c3d4-1234-5678-9abc-123456789abc + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/RumSegmentDeleteResponse' + description: OK + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Delete a RUM segment + tags: + - RUM User Segments + x-unstable: '**Note**: This endpoint is in preview and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + get: + description: Get a specific user segment by its identifier. + operationId: GetRumSegment + parameters: + - description: The identifier of the segment. + in: path + name: segment_id + required: true + schema: + example: a1b2c3d4-1234-5678-9abc-123456789abc + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/RumSegmentResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Get a RUM segment + tags: + - RUM User Segments + x-unstable: '**Note**: This endpoint is in preview and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + put: + description: Update an existing user segment. All fields in the request body + are optional. + operationId: UpdateRumSegment + parameters: + - description: The identifier of the segment. + in: path + name: segment_id + required: true + schema: + example: a1b2c3d4-1234-5678-9abc-123456789abc + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RumSegmentUpdateRequest' + required: true + responses: + '204': + description: No Content + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not Found + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Conflict + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Update a RUM segment + tags: + - RUM User Segments + x-unstable: '**Note**: This endpoint is in preview and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/saml_configurations/idp_metadata: post: description: 'Endpoint for uploading IdP metadata for SAML setup. @@ -104793,6 +105823,8 @@ tags: aggregate your RUM events over HTTP. See the [RUM & Session Replay page](https://docs.datadoghq.com/real_user_monitoring/) for more information name: RUM +- description: Manage RUM user segments for audience targeting and analysis. + name: RUM User Segments - description: View and manage Reference Tables in your organization. name: Reference Tables - description: 'A restriction policy defines the access control rules for a resource, diff --git a/examples/v2/rum-user-segments/CreateRumSegment.ts b/examples/v2/rum-user-segments/CreateRumSegment.ts new file mode 100644 index 000000000000..521473d2619e --- /dev/null +++ b/examples/v2/rum-user-segments/CreateRumSegment.ts @@ -0,0 +1,84 @@ +/** + * Create a RUM segment returns "Created" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +configuration.unstableOperations["v2.createRumSegment"] = true; +const apiInstance = new v2.RUMUserSegmentsApi(configuration); + +const params: v2.RUMUserSegmentsApiCreateRumSegmentRequest = { + body: { + data: { + attributes: { + dataQuery: { + combination: "(logs && apm_home) && NOT(apm_trace)", + eventPlatforms: [ + { + facet: "@usr.id", + from: 1709888355000, + name: "logs", + query: "@type:view @view.url_path:/logs", + to: 1710493155000, + }, + ], + journeys: [ + { + conversionType: "any", + groupBy: "@usr.id", + name: "my_journey", + search: "@type:view", + }, + ], + referenceTables: [ + { + columns: [ + { + name: "user_id", + }, + ], + filterQuery: "", + joinCondition: { + columnName: "user_id", + facet: "@usr.id", + }, + name: "my_ref_table", + tableName: "my_table", + }, + ], + _static: [ + { + id: "static-list-1", + name: "My Static List", + userCount: 500, + }, + ], + templates: [ + { + from: 1709888355000, + parameters: { + threshold: "5", + }, + templateId: "stickiness-v1", + to: 1710493155000, + }, + ], + }, + description: "Users who visited the homepage.", + name: "My Segment", + tags: ["team:frontend"], + }, + type: "segment", + }, + }, +}; + +apiInstance + .createRumSegment(params) + .then((data: v2.RumSegmentResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/rum-user-segments/CreateRumStaticSegment.ts b/examples/v2/rum-user-segments/CreateRumStaticSegment.ts new file mode 100644 index 000000000000..151562e8e40d --- /dev/null +++ b/examples/v2/rum-user-segments/CreateRumStaticSegment.ts @@ -0,0 +1,43 @@ +/** + * Create a static RUM segment returns "Created" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +configuration.unstableOperations["v2.createRumStaticSegment"] = true; +const apiInstance = new v2.RUMUserSegmentsApi(configuration); + +const params: v2.RUMUserSegmentsApiCreateRumStaticSegmentRequest = { + body: { + data: { + attributes: { + description: "Users from a specific journey.", + journeyQueryObject: { + nodes: [ + { + filters: [ + { + attribute: "@type", + value: "view", + }, + ], + }, + ], + }, + name: "My Static Segment", + tags: ["team:frontend"], + }, + type: "create_static_segment_request", + }, + }, +}; + +apiInstance + .createRumStaticSegment(params) + .then((data: v2.RumSegmentResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/rum-user-segments/DeleteRumSegment.ts b/examples/v2/rum-user-segments/DeleteRumSegment.ts new file mode 100644 index 000000000000..397e30a44b60 --- /dev/null +++ b/examples/v2/rum-user-segments/DeleteRumSegment.ts @@ -0,0 +1,22 @@ +/** + * Delete a RUM segment returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +configuration.unstableOperations["v2.deleteRumSegment"] = true; +const apiInstance = new v2.RUMUserSegmentsApi(configuration); + +const params: v2.RUMUserSegmentsApiDeleteRumSegmentRequest = { + segmentId: "a1b2c3d4-1234-5678-9abc-123456789abc", +}; + +apiInstance + .deleteRumSegment(params) + .then((data: v2.RumSegmentDeleteResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/rum-user-segments/GetRumSegment.ts b/examples/v2/rum-user-segments/GetRumSegment.ts new file mode 100644 index 000000000000..76dd9483abd0 --- /dev/null +++ b/examples/v2/rum-user-segments/GetRumSegment.ts @@ -0,0 +1,22 @@ +/** + * Get a RUM segment returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +configuration.unstableOperations["v2.getRumSegment"] = true; +const apiInstance = new v2.RUMUserSegmentsApi(configuration); + +const params: v2.RUMUserSegmentsApiGetRumSegmentRequest = { + segmentId: "a1b2c3d4-1234-5678-9abc-123456789abc", +}; + +apiInstance + .getRumSegment(params) + .then((data: v2.RumSegmentResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/rum-user-segments/InitializeRumSegments.ts b/examples/v2/rum-user-segments/InitializeRumSegments.ts new file mode 100644 index 000000000000..fee31fa0949f --- /dev/null +++ b/examples/v2/rum-user-segments/InitializeRumSegments.ts @@ -0,0 +1,18 @@ +/** + * Initialize RUM segments returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +configuration.unstableOperations["v2.initializeRumSegments"] = true; +const apiInstance = new v2.RUMUserSegmentsApi(configuration); + +apiInstance + .initializeRumSegments() + .then((data: any) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/rum-user-segments/ListRumSegmentTemplates.ts b/examples/v2/rum-user-segments/ListRumSegmentTemplates.ts new file mode 100644 index 000000000000..3f06c55e6b76 --- /dev/null +++ b/examples/v2/rum-user-segments/ListRumSegmentTemplates.ts @@ -0,0 +1,18 @@ +/** + * List RUM segment templates returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +configuration.unstableOperations["v2.listRumSegmentTemplates"] = true; +const apiInstance = new v2.RUMUserSegmentsApi(configuration); + +apiInstance + .listRumSegmentTemplates() + .then((data: v2.RumSegmentTemplateListResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/rum-user-segments/ListRumSegments.ts b/examples/v2/rum-user-segments/ListRumSegments.ts new file mode 100644 index 000000000000..28ae2fa2545f --- /dev/null +++ b/examples/v2/rum-user-segments/ListRumSegments.ts @@ -0,0 +1,18 @@ +/** + * List all RUM segments returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +configuration.unstableOperations["v2.listRumSegments"] = true; +const apiInstance = new v2.RUMUserSegmentsApi(configuration); + +apiInstance + .listRumSegments() + .then((data: v2.RumSegmentListResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/rum-user-segments/UpdateRumSegment.ts b/examples/v2/rum-user-segments/UpdateRumSegment.ts new file mode 100644 index 000000000000..afbcea32e472 --- /dev/null +++ b/examples/v2/rum-user-segments/UpdateRumSegment.ts @@ -0,0 +1,86 @@ +/** + * Update a RUM segment returns "No Content" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +configuration.unstableOperations["v2.updateRumSegment"] = true; +const apiInstance = new v2.RUMUserSegmentsApi(configuration); + +const params: v2.RUMUserSegmentsApiUpdateRumSegmentRequest = { + body: { + data: { + attributes: { + dataQuery: { + combination: "(logs && apm_home) && NOT(apm_trace)", + eventPlatforms: [ + { + facet: "@usr.id", + from: 1709888355000, + name: "logs", + query: "@type:view @view.url_path:/logs", + to: 1710493155000, + }, + ], + journeys: [ + { + conversionType: "any", + groupBy: "@usr.id", + name: "my_journey", + search: "@type:view", + }, + ], + referenceTables: [ + { + columns: [ + { + name: "user_id", + }, + ], + filterQuery: "", + joinCondition: { + columnName: "user_id", + facet: "@usr.id", + }, + name: "my_ref_table", + tableName: "my_table", + }, + ], + _static: [ + { + id: "static-list-1", + name: "My Static List", + userCount: 500, + }, + ], + templates: [ + { + from: 1709888355000, + parameters: { + threshold: "5", + }, + templateId: "stickiness-v1", + to: 1710493155000, + }, + ], + }, + description: "Updated description.", + name: "Updated Segment Name", + tags: ["team:backend"], + }, + id: "a1b2c3d4-1234-5678-9abc-123456789abc", + type: "segment", + }, + }, + segmentId: "a1b2c3d4-1234-5678-9abc-123456789abc", +}; + +apiInstance + .updateRumSegment(params) + .then((data: any) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/features/support/scenarios_model_mapping.ts b/features/support/scenarios_model_mapping.ts index 0f3268160926..669fffc4714f 100644 --- a/features/support/scenarios_model_mapping.ts +++ b/features/support/scenarios_model_mapping.ts @@ -9450,6 +9450,62 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = { }, "operationResponseType": "ViewershipHistorySessionArray", }, + "v2.ListRumSegments": { + "sort": { + "type": "string", + "format": "", + }, + "limit": { + "type": "number", + "format": "", + }, + "operationResponseType": "RumSegmentListResponse", + }, + "v2.CreateRumSegment": { + "body": { + "type": "RumSegmentCreateRequest", + "format": "", + }, + "operationResponseType": "RumSegmentResponse", + }, + "v2.InitializeRumSegments": { + "operationResponseType": "{}", + }, + "v2.CreateRumStaticSegment": { + "body": { + "type": "RumStaticSegmentCreateRequest", + "format": "", + }, + "operationResponseType": "RumSegmentResponse", + }, + "v2.ListRumSegmentTemplates": { + "operationResponseType": "RumSegmentTemplateListResponse", + }, + "v2.GetRumSegment": { + "segmentId": { + "type": "string", + "format": "", + }, + "operationResponseType": "RumSegmentResponse", + }, + "v2.UpdateRumSegment": { + "segmentId": { + "type": "string", + "format": "", + }, + "body": { + "type": "RumSegmentUpdateRequest", + "format": "", + }, + "operationResponseType": "{}", + }, + "v2.DeleteRumSegment": { + "segmentId": { + "type": "string", + "format": "", + }, + "operationResponseType": "RumSegmentDeleteResponse", + }, "v2.ListScorecardOutcomes": { "pageSize": { "type": "number", diff --git a/features/v2/rum_user_segments.feature b/features/v2/rum_user_segments.feature new file mode 100644 index 000000000000..7a6305c6e00f --- /dev/null +++ b/features/v2/rum_user_segments.feature @@ -0,0 +1,167 @@ +@endpoint(rum-user-segments) @endpoint(rum-user-segments-v2) +Feature: RUM User Segments + Manage RUM user segments for audience targeting and analysis. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "RUMUserSegments" API + + @generated @skip @team:DataDog/product-analytics-backend + Scenario: Create a RUM segment returns "Bad Request" response + Given operation "CreateRumSegment" enabled + And new "CreateRumSegment" request + And body with value {"data": {"attributes": {"data_query": {"combination": "(logs && apm_home) && NOT(apm_trace)", "event_platforms": [{"facet": "@usr.id", "from": 1709888355000, "name": "logs", "query": "@type:view @view.url_path:/logs", "to": 1710493155000}], "journeys": [{"conversion_type": "any", "group_by": "@usr.id", "name": "my_journey", "search": "@type:view"}], "reference_tables": [{"columns": [{"name": "user_id"}], "filter_query": "", "join_condition": {"column_name": "user_id", "facet": "@usr.id"}, "name": "my_ref_table", "table_name": "my_table"}], "static": [{"id": "static-list-1", "name": "My Static List", "user_count": 500}], "templates": [{"from": 1709888355000, "parameters": {"threshold": "5"}, "template_id": "stickiness-v1", "to": 1710493155000}]}, "description": "Users who visited the homepage.", "name": "My Segment", "tags": ["team:frontend"]}, "type": "segment"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/product-analytics-backend + Scenario: Create a RUM segment returns "Conflict" response + Given operation "CreateRumSegment" enabled + And new "CreateRumSegment" request + And body with value {"data": {"attributes": {"data_query": {"combination": "(logs && apm_home) && NOT(apm_trace)", "event_platforms": [{"facet": "@usr.id", "from": 1709888355000, "name": "logs", "query": "@type:view @view.url_path:/logs", "to": 1710493155000}], "journeys": [{"conversion_type": "any", "group_by": "@usr.id", "name": "my_journey", "search": "@type:view"}], "reference_tables": [{"columns": [{"name": "user_id"}], "filter_query": "", "join_condition": {"column_name": "user_id", "facet": "@usr.id"}, "name": "my_ref_table", "table_name": "my_table"}], "static": [{"id": "static-list-1", "name": "My Static List", "user_count": 500}], "templates": [{"from": 1709888355000, "parameters": {"threshold": "5"}, "template_id": "stickiness-v1", "to": 1710493155000}]}, "description": "Users who visited the homepage.", "name": "My Segment", "tags": ["team:frontend"]}, "type": "segment"}} + When the request is sent + Then the response status is 409 Conflict + + @generated @skip @team:DataDog/product-analytics-backend + Scenario: Create a RUM segment returns "Created" response + Given operation "CreateRumSegment" enabled + And new "CreateRumSegment" request + And body with value {"data": {"attributes": {"data_query": {"combination": "(logs && apm_home) && NOT(apm_trace)", "event_platforms": [{"facet": "@usr.id", "from": 1709888355000, "name": "logs", "query": "@type:view @view.url_path:/logs", "to": 1710493155000}], "journeys": [{"conversion_type": "any", "group_by": "@usr.id", "name": "my_journey", "search": "@type:view"}], "reference_tables": [{"columns": [{"name": "user_id"}], "filter_query": "", "join_condition": {"column_name": "user_id", "facet": "@usr.id"}, "name": "my_ref_table", "table_name": "my_table"}], "static": [{"id": "static-list-1", "name": "My Static List", "user_count": 500}], "templates": [{"from": 1709888355000, "parameters": {"threshold": "5"}, "template_id": "stickiness-v1", "to": 1710493155000}]}, "description": "Users who visited the homepage.", "name": "My Segment", "tags": ["team:frontend"]}, "type": "segment"}} + When the request is sent + Then the response status is 201 Created + + @generated @skip @team:DataDog/product-analytics-backend + Scenario: Create a static RUM segment returns "Bad Request" response + Given operation "CreateRumStaticSegment" enabled + And new "CreateRumStaticSegment" request + And body with value {"data": {"attributes": {"description": "Users from a specific journey.", "journey_query_object": {"nodes": [{"filters": [{"attribute": "@type", "value": "view"}]}]}, "name": "My Static Segment", "tags": ["team:frontend"]}, "type": "create_static_segment_request"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/product-analytics-backend + Scenario: Create a static RUM segment returns "Conflict" response + Given operation "CreateRumStaticSegment" enabled + And new "CreateRumStaticSegment" request + And body with value {"data": {"attributes": {"description": "Users from a specific journey.", "journey_query_object": {"nodes": [{"filters": [{"attribute": "@type", "value": "view"}]}]}, "name": "My Static Segment", "tags": ["team:frontend"]}, "type": "create_static_segment_request"}} + When the request is sent + Then the response status is 409 Conflict + + @generated @skip @team:DataDog/product-analytics-backend + Scenario: Create a static RUM segment returns "Created" response + Given operation "CreateRumStaticSegment" enabled + And new "CreateRumStaticSegment" request + And body with value {"data": {"attributes": {"description": "Users from a specific journey.", "journey_query_object": {"nodes": [{"filters": [{"attribute": "@type", "value": "view"}]}]}, "name": "My Static Segment", "tags": ["team:frontend"]}, "type": "create_static_segment_request"}} + When the request is sent + Then the response status is 201 Created + + @generated @skip @team:DataDog/product-analytics-backend + Scenario: Delete a RUM segment returns "Not Found" response + Given operation "DeleteRumSegment" enabled + And new "DeleteRumSegment" request + And request contains "segment_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/product-analytics-backend + Scenario: Delete a RUM segment returns "OK" response + Given operation "DeleteRumSegment" enabled + And new "DeleteRumSegment" request + And request contains "segment_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/product-analytics-backend + Scenario: Get a RUM segment returns "Bad Request" response + Given operation "GetRumSegment" enabled + And new "GetRumSegment" request + And request contains "segment_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/product-analytics-backend + Scenario: Get a RUM segment returns "Not Found" response + Given operation "GetRumSegment" enabled + And new "GetRumSegment" request + And request contains "segment_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/product-analytics-backend + Scenario: Get a RUM segment returns "OK" response + Given operation "GetRumSegment" enabled + And new "GetRumSegment" request + And request contains "segment_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/product-analytics-backend + Scenario: Initialize RUM segments returns "OK" response + Given operation "InitializeRumSegments" enabled + And new "InitializeRumSegments" request + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/product-analytics-backend + Scenario: List RUM segment templates returns "Bad Request" response + Given operation "ListRumSegmentTemplates" enabled + And new "ListRumSegmentTemplates" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/product-analytics-backend + Scenario: List RUM segment templates returns "OK" response + Given operation "ListRumSegmentTemplates" enabled + And new "ListRumSegmentTemplates" request + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/product-analytics-backend + Scenario: List all RUM segments returns "Bad Request" response + Given operation "ListRumSegments" enabled + And new "ListRumSegments" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/product-analytics-backend + Scenario: List all RUM segments returns "OK" response + Given operation "ListRumSegments" enabled + And new "ListRumSegments" request + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/product-analytics-backend + Scenario: Update a RUM segment returns "Bad Request" response + Given operation "UpdateRumSegment" enabled + And new "UpdateRumSegment" request + And request contains "segment_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"data_query": {"combination": "(logs && apm_home) && NOT(apm_trace)", "event_platforms": [{"facet": "@usr.id", "from": 1709888355000, "name": "logs", "query": "@type:view @view.url_path:/logs", "to": 1710493155000}], "journeys": [{"conversion_type": "any", "group_by": "@usr.id", "name": "my_journey", "search": "@type:view"}], "reference_tables": [{"columns": [{"name": "user_id"}], "filter_query": "", "join_condition": {"column_name": "user_id", "facet": "@usr.id"}, "name": "my_ref_table", "table_name": "my_table"}], "static": [{"id": "static-list-1", "name": "My Static List", "user_count": 500}], "templates": [{"from": 1709888355000, "parameters": {"threshold": "5"}, "template_id": "stickiness-v1", "to": 1710493155000}]}, "description": "Updated description.", "name": "Updated Segment Name", "tags": ["team:backend"]}, "id": "a1b2c3d4-1234-5678-9abc-123456789abc", "type": "segment"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/product-analytics-backend + Scenario: Update a RUM segment returns "Conflict" response + Given operation "UpdateRumSegment" enabled + And new "UpdateRumSegment" request + And request contains "segment_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"data_query": {"combination": "(logs && apm_home) && NOT(apm_trace)", "event_platforms": [{"facet": "@usr.id", "from": 1709888355000, "name": "logs", "query": "@type:view @view.url_path:/logs", "to": 1710493155000}], "journeys": [{"conversion_type": "any", "group_by": "@usr.id", "name": "my_journey", "search": "@type:view"}], "reference_tables": [{"columns": [{"name": "user_id"}], "filter_query": "", "join_condition": {"column_name": "user_id", "facet": "@usr.id"}, "name": "my_ref_table", "table_name": "my_table"}], "static": [{"id": "static-list-1", "name": "My Static List", "user_count": 500}], "templates": [{"from": 1709888355000, "parameters": {"threshold": "5"}, "template_id": "stickiness-v1", "to": 1710493155000}]}, "description": "Updated description.", "name": "Updated Segment Name", "tags": ["team:backend"]}, "id": "a1b2c3d4-1234-5678-9abc-123456789abc", "type": "segment"}} + When the request is sent + Then the response status is 409 Conflict + + @generated @skip @team:DataDog/product-analytics-backend + Scenario: Update a RUM segment returns "No Content" response + Given operation "UpdateRumSegment" enabled + And new "UpdateRumSegment" request + And request contains "segment_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"data_query": {"combination": "(logs && apm_home) && NOT(apm_trace)", "event_platforms": [{"facet": "@usr.id", "from": 1709888355000, "name": "logs", "query": "@type:view @view.url_path:/logs", "to": 1710493155000}], "journeys": [{"conversion_type": "any", "group_by": "@usr.id", "name": "my_journey", "search": "@type:view"}], "reference_tables": [{"columns": [{"name": "user_id"}], "filter_query": "", "join_condition": {"column_name": "user_id", "facet": "@usr.id"}, "name": "my_ref_table", "table_name": "my_table"}], "static": [{"id": "static-list-1", "name": "My Static List", "user_count": 500}], "templates": [{"from": 1709888355000, "parameters": {"threshold": "5"}, "template_id": "stickiness-v1", "to": 1710493155000}]}, "description": "Updated description.", "name": "Updated Segment Name", "tags": ["team:backend"]}, "id": "a1b2c3d4-1234-5678-9abc-123456789abc", "type": "segment"}} + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:DataDog/product-analytics-backend + Scenario: Update a RUM segment returns "Not Found" response + Given operation "UpdateRumSegment" enabled + And new "UpdateRumSegment" request + And request contains "segment_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"data_query": {"combination": "(logs && apm_home) && NOT(apm_trace)", "event_platforms": [{"facet": "@usr.id", "from": 1709888355000, "name": "logs", "query": "@type:view @view.url_path:/logs", "to": 1710493155000}], "journeys": [{"conversion_type": "any", "group_by": "@usr.id", "name": "my_journey", "search": "@type:view"}], "reference_tables": [{"columns": [{"name": "user_id"}], "filter_query": "", "join_condition": {"column_name": "user_id", "facet": "@usr.id"}, "name": "my_ref_table", "table_name": "my_table"}], "static": [{"id": "static-list-1", "name": "My Static List", "user_count": 500}], "templates": [{"from": 1709888355000, "parameters": {"threshold": "5"}, "template_id": "stickiness-v1", "to": 1710493155000}]}, "description": "Updated description.", "name": "Updated Segment Name", "tags": ["team:backend"]}, "id": "a1b2c3d4-1234-5678-9abc-123456789abc", "type": "segment"}} + When the request is sent + Then the response status is 404 Not Found diff --git a/features/v2/undo.json b/features/v2/undo.json index 2f0af9dca771..6514777da204 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -4249,6 +4249,68 @@ "type": "safe" } }, + "ListRumSegments": { + "tag": "RUM User Segments", + "undo": { + "type": "safe" + } + }, + "CreateRumSegment": { + "tag": "RUM User Segments", + "undo": { + "operationId": "DeleteRumSegment", + "parameters": [ + { + "name": "segment_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "InitializeRumSegments": { + "tag": "RUM User Segments", + "undo": { + "type": "idempotent" + } + }, + "CreateRumStaticSegment": { + "tag": "RUM User Segments", + "undo": { + "operationId": "DeleteRumSegment", + "parameters": [ + { + "name": "segment_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "ListRumSegmentTemplates": { + "tag": "RUM User Segments", + "undo": { + "type": "safe" + } + }, + "DeleteRumSegment": { + "tag": "RUM User Segments", + "undo": { + "type": "idempotent" + } + }, + "GetRumSegment": { + "tag": "RUM User Segments", + "undo": { + "type": "safe" + } + }, + "UpdateRumSegment": { + "tag": "RUM User Segments", + "undo": { + "type": "idempotent" + } + }, "UploadIdPMetadata": { "tag": "Organizations", "undo": { diff --git a/packages/datadog-api-client-common/configuration.ts b/packages/datadog-api-client-common/configuration.ts index 276f1255c419..cbc1e74ae901 100644 --- a/packages/datadog-api-client-common/configuration.ts +++ b/packages/datadog-api-client-common/configuration.ts @@ -386,6 +386,14 @@ export function createConfiguration( "v2.queryEventFilteredUsers": false, "v2.queryUsers": false, "v2.updateConnection": false, + "v2.createRumSegment": false, + "v2.createRumStaticSegment": false, + "v2.deleteRumSegment": false, + "v2.getRumSegment": false, + "v2.initializeRumSegments": false, + "v2.listRumSegments": false, + "v2.listRumSegmentTemplates": false, + "v2.updateRumSegment": false, "v2.createScorecardOutcomesBatch": false, "v2.createScorecardRule": false, "v2.deleteScorecardRule": false, diff --git a/packages/datadog-api-client-v2/apis/RUMUserSegmentsApi.ts b/packages/datadog-api-client-v2/apis/RUMUserSegmentsApi.ts new file mode 100644 index 000000000000..f253dc3326b0 --- /dev/null +++ b/packages/datadog-api-client-v2/apis/RUMUserSegmentsApi.ts @@ -0,0 +1,1243 @@ +import { + BaseAPIRequestFactory, + RequiredError, +} from "../../datadog-api-client-common/baseapi"; +import { + Configuration, + applySecurityAuthentication, +} from "../../datadog-api-client-common/configuration"; +import { + RequestContext, + HttpMethod, + ResponseContext, +} from "../../datadog-api-client-common/http/http"; + +import { logger } from "../../../logger"; +import { ObjectSerializer } from "../models/ObjectSerializer"; +import { ApiException } from "../../datadog-api-client-common/exception"; + +import { APIErrorResponse } from "../models/APIErrorResponse"; +import { JSONAPIErrorResponse } from "../models/JSONAPIErrorResponse"; +import { RumSegmentCreateRequest } from "../models/RumSegmentCreateRequest"; +import { RumSegmentDeleteResponse } from "../models/RumSegmentDeleteResponse"; +import { RumSegmentListResponse } from "../models/RumSegmentListResponse"; +import { RumSegmentResponse } from "../models/RumSegmentResponse"; +import { RumSegmentTemplateListResponse } from "../models/RumSegmentTemplateListResponse"; +import { RumSegmentUpdateRequest } from "../models/RumSegmentUpdateRequest"; +import { RumStaticSegmentCreateRequest } from "../models/RumStaticSegmentCreateRequest"; + +export class RUMUserSegmentsApiRequestFactory extends BaseAPIRequestFactory { + public async createRumSegment( + body: RumSegmentCreateRequest, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + logger.warn("Using unstable operation 'createRumSegment'"); + if (!_config.unstableOperations["v2.createRumSegment"]) { + throw new Error("Unstable operation 'createRumSegment' is disabled"); + } + + // 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 requestContext = _config + .getServer("v2.RUMUserSegmentsApi.createRumSegment") + .makeRequestContext(localVarPath, HttpMethod.POST); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Body Params + const contentType = ObjectSerializer.getPreferredMediaType([ + "application/json", + ]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = ObjectSerializer.stringify( + ObjectSerializer.serialize(body, "RumSegmentCreateRequest", ""), + contentType + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + + public async createRumStaticSegment( + body: RumStaticSegmentCreateRequest, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + logger.warn("Using unstable operation 'createRumStaticSegment'"); + if (!_config.unstableOperations["v2.createRumStaticSegment"]) { + throw new Error( + "Unstable operation 'createRumStaticSegment' is disabled" + ); + } + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError("body", "createRumStaticSegment"); + } + + // Path Params + const localVarPath = "/api/v2/rum/segment/static"; + + // Make Request Context + const requestContext = _config + .getServer("v2.RUMUserSegmentsApi.createRumStaticSegment") + .makeRequestContext(localVarPath, HttpMethod.POST); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Body Params + const contentType = ObjectSerializer.getPreferredMediaType([ + "application/json", + ]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = ObjectSerializer.stringify( + ObjectSerializer.serialize(body, "RumStaticSegmentCreateRequest", ""), + contentType + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + + public async deleteRumSegment( + segmentId: string, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + logger.warn("Using unstable operation 'deleteRumSegment'"); + if (!_config.unstableOperations["v2.deleteRumSegment"]) { + throw new Error("Unstable operation 'deleteRumSegment' is disabled"); + } + + // verify required parameter 'segmentId' is not null or undefined + if (segmentId === null || segmentId === undefined) { + throw new RequiredError("segmentId", "deleteRumSegment"); + } + + // Path Params + const localVarPath = "/api/v2/rum/segment/{segment_id}".replace( + "{segment_id}", + encodeURIComponent(String(segmentId)) + ); + + // Make Request Context + const requestContext = _config + .getServer("v2.RUMUserSegmentsApi.deleteRumSegment") + .makeRequestContext(localVarPath, HttpMethod.DELETE); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + + public async getRumSegment( + segmentId: string, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + logger.warn("Using unstable operation 'getRumSegment'"); + if (!_config.unstableOperations["v2.getRumSegment"]) { + throw new Error("Unstable operation 'getRumSegment' is disabled"); + } + + // verify required parameter 'segmentId' is not null or undefined + if (segmentId === null || segmentId === undefined) { + throw new RequiredError("segmentId", "getRumSegment"); + } + + // Path Params + const localVarPath = "/api/v2/rum/segment/{segment_id}".replace( + "{segment_id}", + encodeURIComponent(String(segmentId)) + ); + + // Make Request Context + const requestContext = _config + .getServer("v2.RUMUserSegmentsApi.getRumSegment") + .makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + + public async initializeRumSegments( + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + logger.warn("Using unstable operation 'initializeRumSegments'"); + if (!_config.unstableOperations["v2.initializeRumSegments"]) { + throw new Error("Unstable operation 'initializeRumSegments' is disabled"); + } + + // Path Params + const localVarPath = "/api/v2/rum/segment/initialize"; + + // Make Request Context + const requestContext = _config + .getServer("v2.RUMUserSegmentsApi.initializeRumSegments") + .makeRequestContext(localVarPath, HttpMethod.POST); + requestContext.setHeaderParam("Accept", "*/*"); + requestContext.setHttpConfig(_config.httpConfig); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + + public async listRumSegments( + sort?: string, + limit?: number, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + logger.warn("Using unstable operation 'listRumSegments'"); + if (!_config.unstableOperations["v2.listRumSegments"]) { + throw new Error("Unstable operation 'listRumSegments' is disabled"); + } + + // Path Params + const localVarPath = "/api/v2/rum/segment"; + + // Make Request Context + const requestContext = _config + .getServer("v2.RUMUserSegmentsApi.listRumSegments") + .makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Query Params + if (sort !== undefined) { + requestContext.setQueryParam( + "sort", + ObjectSerializer.serialize(sort, "string", ""), + "" + ); + } + if (limit !== undefined) { + requestContext.setQueryParam( + "limit", + ObjectSerializer.serialize(limit, "number", ""), + "" + ); + } + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + + public async listRumSegmentTemplates( + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + logger.warn("Using unstable operation 'listRumSegmentTemplates'"); + if (!_config.unstableOperations["v2.listRumSegmentTemplates"]) { + throw new Error( + "Unstable operation 'listRumSegmentTemplates' is disabled" + ); + } + + // Path Params + const localVarPath = "/api/v2/rum/segment/templates"; + + // Make Request Context + const requestContext = _config + .getServer("v2.RUMUserSegmentsApi.listRumSegmentTemplates") + .makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + + public async updateRumSegment( + segmentId: string, + body: RumSegmentUpdateRequest, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + logger.warn("Using unstable operation 'updateRumSegment'"); + if (!_config.unstableOperations["v2.updateRumSegment"]) { + throw new Error("Unstable operation 'updateRumSegment' is disabled"); + } + + // verify required parameter 'segmentId' is not null or undefined + if (segmentId === null || segmentId === undefined) { + throw new RequiredError("segmentId", "updateRumSegment"); + } + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError("body", "updateRumSegment"); + } + + // Path Params + const localVarPath = "/api/v2/rum/segment/{segment_id}".replace( + "{segment_id}", + encodeURIComponent(String(segmentId)) + ); + + // Make Request Context + const requestContext = _config + .getServer("v2.RUMUserSegmentsApi.updateRumSegment") + .makeRequestContext(localVarPath, HttpMethod.PUT); + requestContext.setHeaderParam("Accept", "*/*"); + requestContext.setHttpConfig(_config.httpConfig); + + // Body Params + const contentType = ObjectSerializer.getPreferredMediaType([ + "application/json", + ]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = ObjectSerializer.stringify( + ObjectSerializer.serialize(body, "RumSegmentUpdateRequest", ""), + contentType + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } +} + +export class RUMUserSegmentsApiResponseProcessor { + /** + * 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 = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 201) { + const body: RumSegmentResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "RumSegmentResponse" + ) as RumSegmentResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 403 || + response.httpStatusCode === 409 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: JSONAPIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "JSONAPIErrorResponse" + ) as JSONAPIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException( + response.httpStatusCode, + body + ); + } + if (response.httpStatusCode === 429) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "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: RumSegmentResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "RumSegmentResponse", + "" + ) as RumSegmentResponse; + 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 createRumStaticSegment + * @throws ApiException if the response code was not in [200, 299] + */ + public async createRumStaticSegment( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 201) { + const body: RumSegmentResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "RumSegmentResponse" + ) as RumSegmentResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 403 || + response.httpStatusCode === 409 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: JSONAPIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "JSONAPIErrorResponse" + ) as JSONAPIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException( + response.httpStatusCode, + body + ); + } + if (response.httpStatusCode === 429) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "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: RumSegmentResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "RumSegmentResponse", + "" + ) as RumSegmentResponse; + 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 deleteRumSegment + * @throws ApiException if the response code was not in [200, 299] + */ + public async deleteRumSegment( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: RumSegmentDeleteResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "RumSegmentDeleteResponse" + ) as RumSegmentDeleteResponse; + return body; + } + if (response.httpStatusCode === 403 || response.httpStatusCode === 404) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: JSONAPIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "JSONAPIErrorResponse" + ) as JSONAPIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException( + response.httpStatusCode, + body + ); + } + if (response.httpStatusCode === 429) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "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: RumSegmentDeleteResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "RumSegmentDeleteResponse", + "" + ) as RumSegmentDeleteResponse; + 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 getRumSegment + * @throws ApiException if the response code was not in [200, 299] + */ + public async getRumSegment( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: RumSegmentResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "RumSegmentResponse" + ) as RumSegmentResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 403 || + response.httpStatusCode === 404 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: JSONAPIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "JSONAPIErrorResponse" + ) as JSONAPIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException( + response.httpStatusCode, + body + ); + } + if (response.httpStatusCode === 429) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "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: RumSegmentResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "RumSegmentResponse", + "" + ) as RumSegmentResponse; + 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 = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + return; + } + if (response.httpStatusCode === 403) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: JSONAPIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "JSONAPIErrorResponse" + ) as JSONAPIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException( + response.httpStatusCode, + body + ); + } + if (response.httpStatusCode === 429) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "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 = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: RumSegmentListResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "RumSegmentListResponse" + ) as RumSegmentListResponse; + return body; + } + if (response.httpStatusCode === 400 || response.httpStatusCode === 403) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: JSONAPIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "JSONAPIErrorResponse" + ) as JSONAPIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException( + response.httpStatusCode, + body + ); + } + if (response.httpStatusCode === 429) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "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: RumSegmentListResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "RumSegmentListResponse", + "" + ) as RumSegmentListResponse; + 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 listRumSegmentTemplates + * @throws ApiException if the response code was not in [200, 299] + */ + public async listRumSegmentTemplates( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: RumSegmentTemplateListResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "RumSegmentTemplateListResponse" + ) as RumSegmentTemplateListResponse; + return body; + } + if (response.httpStatusCode === 400 || response.httpStatusCode === 403) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: JSONAPIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "JSONAPIErrorResponse" + ) as JSONAPIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException( + response.httpStatusCode, + body + ); + } + if (response.httpStatusCode === 429) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "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: RumSegmentTemplateListResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "RumSegmentTemplateListResponse", + "" + ) as RumSegmentTemplateListResponse; + 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 updateRumSegment + * @throws ApiException if the response code was not in [200, 299] + */ + public async updateRumSegment(response: ResponseContext): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 204) { + return; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 403 || + response.httpStatusCode === 404 || + response.httpStatusCode === 409 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: JSONAPIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "JSONAPIErrorResponse" + ) as JSONAPIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException( + response.httpStatusCode, + body + ); + } + if (response.httpStatusCode === 429) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "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 + '"' + ); + } +} + +export interface RUMUserSegmentsApiCreateRumSegmentRequest { + /** + * @type RumSegmentCreateRequest + */ + body: RumSegmentCreateRequest; +} + +export interface RUMUserSegmentsApiCreateRumStaticSegmentRequest { + /** + * @type RumStaticSegmentCreateRequest + */ + body: RumStaticSegmentCreateRequest; +} + +export interface RUMUserSegmentsApiDeleteRumSegmentRequest { + /** + * The identifier of the segment. + * @type string + */ + segmentId: string; +} + +export interface RUMUserSegmentsApiGetRumSegmentRequest { + /** + * The identifier of the segment. + * @type string + */ + segmentId: string; +} + +export interface RUMUserSegmentsApiListRumSegmentsRequest { + /** + * Sort order for the segments list. + * @type string + */ + sort?: string; + /** + * Maximum number of segments to return. + * @type number + */ + limit?: number; +} + +export interface RUMUserSegmentsApiUpdateRumSegmentRequest { + /** + * The identifier of the segment. + * @type string + */ + segmentId: string; + /** + * @type RumSegmentUpdateRequest + */ + body: RumSegmentUpdateRequest; +} + +export class RUMUserSegmentsApi { + private requestFactory: RUMUserSegmentsApiRequestFactory; + private responseProcessor: RUMUserSegmentsApiResponseProcessor; + private configuration: Configuration; + + public constructor( + configuration: Configuration, + requestFactory?: RUMUserSegmentsApiRequestFactory, + responseProcessor?: RUMUserSegmentsApiResponseProcessor + ) { + this.configuration = configuration; + this.requestFactory = + requestFactory || new RUMUserSegmentsApiRequestFactory(configuration); + this.responseProcessor = + responseProcessor || new RUMUserSegmentsApiResponseProcessor(); + } + + /** + * Create a new user segment for the current organization. + * @param param The request object + */ + public createRumSegment( + param: RUMUserSegmentsApiCreateRumSegmentRequest, + 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); + }); + }); + } + + /** + * Create a new static user segment from a journey query. Static segments contain a fixed list of users computed from the query at creation time. + * @param param The request object + */ + public createRumStaticSegment( + param: RUMUserSegmentsApiCreateRumStaticSegmentRequest, + options?: Configuration + ): Promise { + const requestContextPromise = this.requestFactory.createRumStaticSegment( + param.body, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.createRumStaticSegment(responseContext); + }); + }); + } + + /** + * Delete a user segment by its identifier. + * @param param The request object + */ + public deleteRumSegment( + param: RUMUserSegmentsApiDeleteRumSegmentRequest, + options?: Configuration + ): Promise { + const requestContextPromise = this.requestFactory.deleteRumSegment( + param.segmentId, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.deleteRumSegment(responseContext); + }); + }); + } + + /** + * Get a specific user segment by its identifier. + * @param param The request object + */ + public getRumSegment( + param: RUMUserSegmentsApiGetRumSegmentRequest, + options?: Configuration + ): Promise { + const requestContextPromise = this.requestFactory.getRumSegment( + param.segmentId, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.getRumSegment(responseContext); + }); + }); + } + + /** + * Initialize default segments for the current organization. This creates a set of predefined segments if they do not already exist. + * @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 user segments for the current organization. Supports sorting and pagination. + * @param param The request object + */ + public listRumSegments( + param: RUMUserSegmentsApiListRumSegmentsRequest = {}, + options?: Configuration + ): Promise { + const requestContextPromise = this.requestFactory.listRumSegments( + param.sort, + param.limit, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.listRumSegments(responseContext); + }); + }); + } + + /** + * List all available segment templates. Templates provide predefined segment configurations that can be customized with parameters. + * @param param The request object + */ + public listRumSegmentTemplates( + options?: Configuration + ): Promise { + const requestContextPromise = + this.requestFactory.listRumSegmentTemplates(options); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.listRumSegmentTemplates( + responseContext + ); + }); + }); + } + + /** + * Update an existing user segment. All fields in the request body are optional. + * @param param The request object + */ + public updateRumSegment( + param: RUMUserSegmentsApiUpdateRumSegmentRequest, + options?: Configuration + ): Promise { + const requestContextPromise = this.requestFactory.updateRumSegment( + param.segmentId, + param.body, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.updateRumSegment(responseContext); + }); + }); + } +} diff --git a/packages/datadog-api-client-v2/index.ts b/packages/datadog-api-client-v2/index.ts index 5747013f4f30..1010e580da2f 100644 --- a/packages/datadog-api-client-v2/index.ts +++ b/packages/datadog-api-client-v2/index.ts @@ -740,6 +740,16 @@ export { RUMApi, } from "./apis/RUMApi"; +export { + RUMUserSegmentsApiCreateRumSegmentRequest, + RUMUserSegmentsApiCreateRumStaticSegmentRequest, + RUMUserSegmentsApiDeleteRumSegmentRequest, + RUMUserSegmentsApiGetRumSegmentRequest, + RUMUserSegmentsApiListRumSegmentsRequest, + RUMUserSegmentsApiUpdateRumSegmentRequest, + RUMUserSegmentsApi, +} from "./apis/RUMUserSegmentsApi"; + export { ReferenceTablesApiCreateReferenceTableRequest, ReferenceTablesApiCreateReferenceTableUploadRequest, @@ -4368,8 +4378,47 @@ export { RumRetentionFilterUpdateAttributes } from "./models/RumRetentionFilterU export { RumRetentionFilterUpdateData } from "./models/RumRetentionFilterUpdateData"; export { RumRetentionFilterUpdateRequest } from "./models/RumRetentionFilterUpdateRequest"; export { RUMSearchEventsRequest } from "./models/RUMSearchEventsRequest"; +export { RumSegmentCreateAttributes } from "./models/RumSegmentCreateAttributes"; +export { RumSegmentCreateData } from "./models/RumSegmentCreateData"; +export { RumSegmentCreateRequest } from "./models/RumSegmentCreateRequest"; +export { RumSegmentDataQuery } from "./models/RumSegmentDataQuery"; +export { RumSegmentDeleteAttributes } from "./models/RumSegmentDeleteAttributes"; +export { RumSegmentDeleteData } from "./models/RumSegmentDeleteData"; +export { RumSegmentDeleteResponse } from "./models/RumSegmentDeleteResponse"; +export { RumSegmentDeleteType } from "./models/RumSegmentDeleteType"; +export { RumSegmentEventPlatform } from "./models/RumSegmentEventPlatform"; +export { RumSegmentJourney } from "./models/RumSegmentJourney"; +export { RumSegmentListResponse } from "./models/RumSegmentListResponse"; +export { RumSegmentReferenceTable } from "./models/RumSegmentReferenceTable"; +export { RumSegmentReferenceTableColumn } from "./models/RumSegmentReferenceTableColumn"; +export { RumSegmentReferenceTableJoinCondition } from "./models/RumSegmentReferenceTableJoinCondition"; +export { RumSegmentResourceType } from "./models/RumSegmentResourceType"; +export { RumSegmentResponse } from "./models/RumSegmentResponse"; +export { RumSegmentResponseAttributes } from "./models/RumSegmentResponseAttributes"; +export { RumSegmentResponseData } from "./models/RumSegmentResponseData"; +export { RumSegmentSegmentType } from "./models/RumSegmentSegmentType"; +export { RumSegmentSource } from "./models/RumSegmentSource"; +export { RumSegmentStaticEntry } from "./models/RumSegmentStaticEntry"; +export { RumSegmentTemplateInstance } from "./models/RumSegmentTemplateInstance"; +export { RumSegmentTemplateListResponse } from "./models/RumSegmentTemplateListResponse"; +export { RumSegmentTemplateParameterDef } from "./models/RumSegmentTemplateParameterDef"; +export { RumSegmentTemplateResourceType } from "./models/RumSegmentTemplateResourceType"; +export { RumSegmentTemplateResponseAttributes } from "./models/RumSegmentTemplateResponseAttributes"; +export { RumSegmentTemplateResponseData } from "./models/RumSegmentTemplateResponseData"; +export { RumSegmentTemplateStatus } from "./models/RumSegmentTemplateStatus"; +export { RumSegmentUpdateAttributes } from "./models/RumSegmentUpdateAttributes"; +export { RumSegmentUpdateData } from "./models/RumSegmentUpdateData"; +export { RumSegmentUpdateRequest } from "./models/RumSegmentUpdateRequest"; +export { RumSegmentUser } from "./models/RumSegmentUser"; export { RUMSort } from "./models/RUMSort"; export { RUMSortOrder } from "./models/RUMSortOrder"; +export { RumStaticSegmentCreateAttributes } from "./models/RumStaticSegmentCreateAttributes"; +export { RumStaticSegmentCreateData } from "./models/RumStaticSegmentCreateData"; +export { RumStaticSegmentCreateRequest } from "./models/RumStaticSegmentCreateRequest"; +export { RumStaticSegmentJourneyFilter } from "./models/RumStaticSegmentJourneyFilter"; +export { RumStaticSegmentJourneyNode } from "./models/RumStaticSegmentJourneyNode"; +export { RumStaticSegmentJourneyQueryObject } from "./models/RumStaticSegmentJourneyQueryObject"; +export { RumStaticSegmentRequestType } from "./models/RumStaticSegmentRequestType"; export { RUMWarning } from "./models/RUMWarning"; export { RunThreatHuntingJobRequest } from "./models/RunThreatHuntingJobRequest"; export { RunThreatHuntingJobRequestAttributes } from "./models/RunThreatHuntingJobRequestAttributes"; diff --git a/packages/datadog-api-client-v2/models/ObjectSerializer.ts b/packages/datadog-api-client-v2/models/ObjectSerializer.ts index 2511a346bc27..7ec301ae5a1f 100644 --- a/packages/datadog-api-client-v2/models/ObjectSerializer.ts +++ b/packages/datadog-api-client-v2/models/ObjectSerializer.ts @@ -2437,6 +2437,38 @@ import { RumRetentionFiltersOrderData } from "./RumRetentionFiltersOrderData"; import { RumRetentionFiltersOrderRequest } from "./RumRetentionFiltersOrderRequest"; import { RumRetentionFiltersOrderResponse } from "./RumRetentionFiltersOrderResponse"; import { RumRetentionFiltersResponse } from "./RumRetentionFiltersResponse"; +import { RumSegmentCreateAttributes } from "./RumSegmentCreateAttributes"; +import { RumSegmentCreateData } from "./RumSegmentCreateData"; +import { RumSegmentCreateRequest } from "./RumSegmentCreateRequest"; +import { RumSegmentDataQuery } from "./RumSegmentDataQuery"; +import { RumSegmentDeleteAttributes } from "./RumSegmentDeleteAttributes"; +import { RumSegmentDeleteData } from "./RumSegmentDeleteData"; +import { RumSegmentDeleteResponse } from "./RumSegmentDeleteResponse"; +import { RumSegmentEventPlatform } from "./RumSegmentEventPlatform"; +import { RumSegmentJourney } from "./RumSegmentJourney"; +import { RumSegmentListResponse } from "./RumSegmentListResponse"; +import { RumSegmentReferenceTable } from "./RumSegmentReferenceTable"; +import { RumSegmentReferenceTableColumn } from "./RumSegmentReferenceTableColumn"; +import { RumSegmentReferenceTableJoinCondition } from "./RumSegmentReferenceTableJoinCondition"; +import { RumSegmentResponse } from "./RumSegmentResponse"; +import { RumSegmentResponseAttributes } from "./RumSegmentResponseAttributes"; +import { RumSegmentResponseData } from "./RumSegmentResponseData"; +import { RumSegmentStaticEntry } from "./RumSegmentStaticEntry"; +import { RumSegmentTemplateInstance } from "./RumSegmentTemplateInstance"; +import { RumSegmentTemplateListResponse } from "./RumSegmentTemplateListResponse"; +import { RumSegmentTemplateParameterDef } from "./RumSegmentTemplateParameterDef"; +import { RumSegmentTemplateResponseAttributes } from "./RumSegmentTemplateResponseAttributes"; +import { RumSegmentTemplateResponseData } from "./RumSegmentTemplateResponseData"; +import { RumSegmentUpdateAttributes } from "./RumSegmentUpdateAttributes"; +import { RumSegmentUpdateData } from "./RumSegmentUpdateData"; +import { RumSegmentUpdateRequest } from "./RumSegmentUpdateRequest"; +import { RumSegmentUser } from "./RumSegmentUser"; +import { RumStaticSegmentCreateAttributes } from "./RumStaticSegmentCreateAttributes"; +import { RumStaticSegmentCreateData } from "./RumStaticSegmentCreateData"; +import { RumStaticSegmentCreateRequest } from "./RumStaticSegmentCreateRequest"; +import { RumStaticSegmentJourneyFilter } from "./RumStaticSegmentJourneyFilter"; +import { RumStaticSegmentJourneyNode } from "./RumStaticSegmentJourneyNode"; +import { RumStaticSegmentJourneyQueryObject } from "./RumStaticSegmentJourneyQueryObject"; import { RunThreatHuntingJobRequest } from "./RunThreatHuntingJobRequest"; import { RunThreatHuntingJobRequestAttributes } from "./RunThreatHuntingJobRequestAttributes"; import { RunThreatHuntingJobRequestData } from "./RunThreatHuntingJobRequestData"; @@ -4583,6 +4615,20 @@ const enumsMap: { [key: string]: any[] } = { "vital", ], RumRetentionFilterType: ["retention_filters"], + RumSegmentDeleteType: ["deleted_segment"], + RumSegmentResourceType: ["segment"], + RumSegmentSegmentType: [ + "static", + "event_platform", + "combination", + "journeys", + "reference_table", + "templates", + ], + RumSegmentSource: ["user_created", "initial"], + RumSegmentTemplateResourceType: ["template_metadata"], + RumSegmentTemplateStatus: ["active", "deprecated", "archived"], + RumStaticSegmentRequestType: ["create_static_segment_request"], RunThreatHuntingJobRequestDataType: ["historicalDetectionsJobCreate"], SAMLAssertionAttributesType: ["saml_assertion_attributes"], SBOMComponentLicenseType: [ @@ -8069,6 +8115,38 @@ const typeMap: { [index: string]: any } = { RumRetentionFiltersOrderRequest: RumRetentionFiltersOrderRequest, RumRetentionFiltersOrderResponse: RumRetentionFiltersOrderResponse, RumRetentionFiltersResponse: RumRetentionFiltersResponse, + RumSegmentCreateAttributes: RumSegmentCreateAttributes, + RumSegmentCreateData: RumSegmentCreateData, + RumSegmentCreateRequest: RumSegmentCreateRequest, + RumSegmentDataQuery: RumSegmentDataQuery, + RumSegmentDeleteAttributes: RumSegmentDeleteAttributes, + RumSegmentDeleteData: RumSegmentDeleteData, + RumSegmentDeleteResponse: RumSegmentDeleteResponse, + RumSegmentEventPlatform: RumSegmentEventPlatform, + RumSegmentJourney: RumSegmentJourney, + RumSegmentListResponse: RumSegmentListResponse, + RumSegmentReferenceTable: RumSegmentReferenceTable, + RumSegmentReferenceTableColumn: RumSegmentReferenceTableColumn, + RumSegmentReferenceTableJoinCondition: RumSegmentReferenceTableJoinCondition, + RumSegmentResponse: RumSegmentResponse, + RumSegmentResponseAttributes: RumSegmentResponseAttributes, + RumSegmentResponseData: RumSegmentResponseData, + RumSegmentStaticEntry: RumSegmentStaticEntry, + RumSegmentTemplateInstance: RumSegmentTemplateInstance, + RumSegmentTemplateListResponse: RumSegmentTemplateListResponse, + RumSegmentTemplateParameterDef: RumSegmentTemplateParameterDef, + RumSegmentTemplateResponseAttributes: RumSegmentTemplateResponseAttributes, + RumSegmentTemplateResponseData: RumSegmentTemplateResponseData, + RumSegmentUpdateAttributes: RumSegmentUpdateAttributes, + RumSegmentUpdateData: RumSegmentUpdateData, + RumSegmentUpdateRequest: RumSegmentUpdateRequest, + RumSegmentUser: RumSegmentUser, + RumStaticSegmentCreateAttributes: RumStaticSegmentCreateAttributes, + RumStaticSegmentCreateData: RumStaticSegmentCreateData, + RumStaticSegmentCreateRequest: RumStaticSegmentCreateRequest, + RumStaticSegmentJourneyFilter: RumStaticSegmentJourneyFilter, + RumStaticSegmentJourneyNode: RumStaticSegmentJourneyNode, + RumStaticSegmentJourneyQueryObject: RumStaticSegmentJourneyQueryObject, RunThreatHuntingJobRequest: RunThreatHuntingJobRequest, RunThreatHuntingJobRequestAttributes: RunThreatHuntingJobRequestAttributes, RunThreatHuntingJobRequestData: RunThreatHuntingJobRequestData, diff --git a/packages/datadog-api-client-v2/models/RumSegmentCreateAttributes.ts b/packages/datadog-api-client-v2/models/RumSegmentCreateAttributes.ts new file mode 100644 index 000000000000..51c275f14cec --- /dev/null +++ b/packages/datadog-api-client-v2/models/RumSegmentCreateAttributes.ts @@ -0,0 +1,79 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { RumSegmentDataQuery } from "./RumSegmentDataQuery"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Attributes for creating a new segment. + */ +export class RumSegmentCreateAttributes { + /** + * Query definition for the segment. Contains one or more query blocks and an optional combination formula. + */ + "dataQuery": RumSegmentDataQuery; + /** + * A description of the segment. + */ + "description"?: string; + /** + * The name of the segment. + */ + "name": string; + /** + * A list of tags for the segment. + */ + "tags"?: 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 = { + dataQuery: { + baseName: "data_query", + type: "RumSegmentDataQuery", + required: true, + }, + description: { + baseName: "description", + type: "string", + }, + name: { + baseName: "name", + type: "string", + required: true, + }, + tags: { + baseName: "tags", + type: "Array", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return RumSegmentCreateAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/RumSegmentCreateData.ts b/packages/datadog-api-client-v2/models/RumSegmentCreateData.ts new file mode 100644 index 000000000000..5290c1a8bc75 --- /dev/null +++ b/packages/datadog-api-client-v2/models/RumSegmentCreateData.ts @@ -0,0 +1,64 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { RumSegmentCreateAttributes } from "./RumSegmentCreateAttributes"; +import { RumSegmentResourceType } from "./RumSegmentResourceType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Data object for a segment creation request. + */ +export class RumSegmentCreateData { + /** + * Attributes for creating a new segment. + */ + "attributes": RumSegmentCreateAttributes; + /** + * Type of the segment resource. + */ + "type": RumSegmentResourceType; + + /** + * 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: "RumSegmentCreateAttributes", + required: true, + }, + type: { + baseName: "type", + type: "RumSegmentResourceType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return RumSegmentCreateData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/RumSegmentCreateRequest.ts b/packages/datadog-api-client-v2/models/RumSegmentCreateRequest.ts new file mode 100644 index 000000000000..20613badb4b0 --- /dev/null +++ b/packages/datadog-api-client-v2/models/RumSegmentCreateRequest.ts @@ -0,0 +1,54 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { RumSegmentCreateData } from "./RumSegmentCreateData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Request body for creating a new segment. + */ +export class RumSegmentCreateRequest { + /** + * Data object for a segment creation request. + */ + "data": RumSegmentCreateData; + + /** + * 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: "RumSegmentCreateData", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return RumSegmentCreateRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/RumSegmentDataQuery.ts b/packages/datadog-api-client-v2/models/RumSegmentDataQuery.ts new file mode 100644 index 000000000000..345f23bc0afd --- /dev/null +++ b/packages/datadog-api-client-v2/models/RumSegmentDataQuery.ts @@ -0,0 +1,97 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { RumSegmentEventPlatform } from "./RumSegmentEventPlatform"; +import { RumSegmentJourney } from "./RumSegmentJourney"; +import { RumSegmentReferenceTable } from "./RumSegmentReferenceTable"; +import { RumSegmentStaticEntry } from "./RumSegmentStaticEntry"; +import { RumSegmentTemplateInstance } from "./RumSegmentTemplateInstance"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Query definition for the segment. Contains one or more query blocks and an optional combination formula. + */ +export class RumSegmentDataQuery { + /** + * Boolean expression combining multiple query blocks. + */ + "combination"?: string; + /** + * List of event platform query blocks. + */ + "eventPlatforms"?: Array; + /** + * List of journey-based query blocks. + */ + "journeys"?: Array; + /** + * List of reference table query blocks. + */ + "referenceTables"?: Array; + /** + * List of static user list blocks. + */ + "_static"?: Array; + /** + * List of template-based query blocks. + */ + "templates"?: 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", + }, + eventPlatforms: { + baseName: "event_platforms", + type: "Array", + }, + journeys: { + baseName: "journeys", + type: "Array", + }, + referenceTables: { + baseName: "reference_tables", + type: "Array", + }, + _static: { + baseName: "static", + type: "Array", + }, + templates: { + baseName: "templates", + type: "Array", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return RumSegmentDataQuery.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/RumSegmentDeleteAttributes.ts b/packages/datadog-api-client-v2/models/RumSegmentDeleteAttributes.ts new file mode 100644 index 000000000000..333b3b9fe9d8 --- /dev/null +++ b/packages/datadog-api-client-v2/models/RumSegmentDeleteAttributes.ts @@ -0,0 +1,82 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { RumSegmentUser } from "./RumSegmentUser"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Attributes of a deleted segment response. + */ +export class RumSegmentDeleteAttributes { + /** + * The timestamp when the segment was disabled in RFC 3339 format. + */ + "disabledAt": Date; + /** + * A user who performed an action on a segment. + */ + "disabledBy": RumSegmentUser; + /** + * The name of the deleted segment. + */ + "name": string; + /** + * The unique identifier of the deleted segment. + */ + "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 = { + disabledAt: { + baseName: "disabled_at", + type: "Date", + required: true, + format: "date-time", + }, + disabledBy: { + baseName: "disabled_by", + type: "RumSegmentUser", + required: true, + }, + name: { + baseName: "name", + type: "string", + required: true, + }, + uuid: { + baseName: "uuid", + type: "string", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return RumSegmentDeleteAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/RumSegmentDeleteData.ts b/packages/datadog-api-client-v2/models/RumSegmentDeleteData.ts new file mode 100644 index 000000000000..a724049848a8 --- /dev/null +++ b/packages/datadog-api-client-v2/models/RumSegmentDeleteData.ts @@ -0,0 +1,73 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { RumSegmentDeleteAttributes } from "./RumSegmentDeleteAttributes"; +import { RumSegmentDeleteType } from "./RumSegmentDeleteType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Data object for a deleted segment response. + */ +export class RumSegmentDeleteData { + /** + * Attributes of a deleted segment response. + */ + "attributes": RumSegmentDeleteAttributes; + /** + * Unique identifier for the deleted segment. + */ + "id": string; + /** + * Type of the deleted segment resource. + */ + "type": RumSegmentDeleteType; + + /** + * 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: "RumSegmentDeleteAttributes", + required: true, + }, + id: { + baseName: "id", + type: "string", + required: true, + }, + type: { + baseName: "type", + type: "RumSegmentDeleteType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return RumSegmentDeleteData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/RumSegmentDeleteResponse.ts b/packages/datadog-api-client-v2/models/RumSegmentDeleteResponse.ts new file mode 100644 index 000000000000..bfab71b375da --- /dev/null +++ b/packages/datadog-api-client-v2/models/RumSegmentDeleteResponse.ts @@ -0,0 +1,54 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { RumSegmentDeleteData } from "./RumSegmentDeleteData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Response for a segment deletion. + */ +export class RumSegmentDeleteResponse { + /** + * Data object for a deleted segment response. + */ + "data": RumSegmentDeleteData; + + /** + * 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: "RumSegmentDeleteData", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return RumSegmentDeleteResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/RumSegmentDeleteType.ts b/packages/datadog-api-client-v2/models/RumSegmentDeleteType.ts new file mode 100644 index 000000000000..6f035521c2f3 --- /dev/null +++ b/packages/datadog-api-client-v2/models/RumSegmentDeleteType.ts @@ -0,0 +1,14 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * Type of the deleted segment resource. + */ + +export type RumSegmentDeleteType = typeof DELETED_SEGMENT | UnparsedObject; +export const DELETED_SEGMENT = "deleted_segment"; diff --git a/packages/datadog-api-client-v2/models/RumSegmentEventPlatform.ts b/packages/datadog-api-client-v2/models/RumSegmentEventPlatform.ts new file mode 100644 index 000000000000..177d6913408e --- /dev/null +++ b/packages/datadog-api-client-v2/models/RumSegmentEventPlatform.ts @@ -0,0 +1,89 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * An event platform query block within a segment data query. + */ +export class RumSegmentEventPlatform { + /** + * The facet to extract user identifiers from. + */ + "facet": string; + /** + * The start of the time range in milliseconds since epoch. + */ + "from"?: number; + /** + * The name of this query block. + */ + "name": string; + /** + * The search query for filtering events. + */ + "query": string; + /** + * The end of the time range in milliseconds since epoch. + */ + "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 = { + facet: { + baseName: "facet", + type: "string", + required: true, + }, + from: { + baseName: "from", + type: "number", + format: "int64", + }, + name: { + baseName: "name", + type: "string", + required: true, + }, + query: { + baseName: "query", + type: "string", + required: true, + }, + to: { + baseName: "to", + type: "number", + format: "int64", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return RumSegmentEventPlatform.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/RumSegmentJourney.ts b/packages/datadog-api-client-v2/models/RumSegmentJourney.ts new file mode 100644 index 000000000000..fe1563854b54 --- /dev/null +++ b/packages/datadog-api-client-v2/models/RumSegmentJourney.ts @@ -0,0 +1,76 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * A journey-based query block within a segment data query. + */ +export class RumSegmentJourney { + /** + * The type of conversion to track. + */ + "conversionType"?: string; + /** + * The facet to group journey results by. + */ + "groupBy"?: string; + /** + * The name of this journey query block. + */ + "name"?: string; + /** + * The search query for filtering events. + */ + "search"?: 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 = { + conversionType: { + baseName: "conversion_type", + type: "string", + }, + groupBy: { + baseName: "group_by", + type: "string", + }, + name: { + baseName: "name", + type: "string", + }, + search: { + baseName: "search", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return RumSegmentJourney.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/RumSegmentListResponse.ts b/packages/datadog-api-client-v2/models/RumSegmentListResponse.ts new file mode 100644 index 000000000000..91aa5dc98868 --- /dev/null +++ b/packages/datadog-api-client-v2/models/RumSegmentListResponse.ts @@ -0,0 +1,54 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { RumSegmentResponseData } from "./RumSegmentResponseData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Response for listing segments. + */ +export class RumSegmentListResponse { + /** + * The list of segments. + */ + "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 RumSegmentListResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/RumSegmentReferenceTable.ts b/packages/datadog-api-client-v2/models/RumSegmentReferenceTable.ts new file mode 100644 index 000000000000..368cd6894434 --- /dev/null +++ b/packages/datadog-api-client-v2/models/RumSegmentReferenceTable.ts @@ -0,0 +1,90 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { RumSegmentReferenceTableColumn } from "./RumSegmentReferenceTableColumn"; +import { RumSegmentReferenceTableJoinCondition } from "./RumSegmentReferenceTableJoinCondition"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * A reference table query block within a segment data query. + */ +export class RumSegmentReferenceTable { + /** + * The columns to include from the reference table. + */ + "columns": Array; + /** + * An optional filter query for the reference table data. + */ + "filterQuery"?: string; + /** + * The join condition for a reference table query block. + */ + "joinCondition": RumSegmentReferenceTableJoinCondition; + /** + * The name of this query block. + */ + "name": string; + /** + * The name of the reference table. + */ + "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", + required: true, + }, + filterQuery: { + baseName: "filter_query", + type: "string", + }, + joinCondition: { + baseName: "join_condition", + type: "RumSegmentReferenceTableJoinCondition", + required: true, + }, + name: { + baseName: "name", + type: "string", + required: true, + }, + tableName: { + baseName: "table_name", + type: "string", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return RumSegmentReferenceTable.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/RumSegmentReferenceTableColumn.ts b/packages/datadog-api-client-v2/models/RumSegmentReferenceTableColumn.ts new file mode 100644 index 000000000000..7a3b65898881 --- /dev/null +++ b/packages/datadog-api-client-v2/models/RumSegmentReferenceTableColumn.ts @@ -0,0 +1,53 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * A column definition in a reference table query block. + */ +export class RumSegmentReferenceTableColumn { + /** + * The name of the column. + */ + "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", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return RumSegmentReferenceTableColumn.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/RumSegmentReferenceTableJoinCondition.ts b/packages/datadog-api-client-v2/models/RumSegmentReferenceTableJoinCondition.ts new file mode 100644 index 000000000000..f122daa98ee5 --- /dev/null +++ b/packages/datadog-api-client-v2/models/RumSegmentReferenceTableJoinCondition.ts @@ -0,0 +1,62 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * The join condition for a reference table query block. + */ +export class RumSegmentReferenceTableJoinCondition { + /** + * The reference table column to join on. + */ + "columnName": string; + /** + * The RUM facet to join on. + */ + "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", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return RumSegmentReferenceTableJoinCondition.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/RumSegmentResourceType.ts b/packages/datadog-api-client-v2/models/RumSegmentResourceType.ts new file mode 100644 index 000000000000..f5a8762c51a5 --- /dev/null +++ b/packages/datadog-api-client-v2/models/RumSegmentResourceType.ts @@ -0,0 +1,14 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * Type of the segment resource. + */ + +export type RumSegmentResourceType = typeof SEGMENT | UnparsedObject; +export const SEGMENT = "segment"; diff --git a/packages/datadog-api-client-v2/models/RumSegmentResponse.ts b/packages/datadog-api-client-v2/models/RumSegmentResponse.ts new file mode 100644 index 000000000000..0c095f9c90b4 --- /dev/null +++ b/packages/datadog-api-client-v2/models/RumSegmentResponse.ts @@ -0,0 +1,54 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { RumSegmentResponseData } from "./RumSegmentResponseData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Response containing a single segment. + */ +export class RumSegmentResponse { + /** + * Data object for a segment in a response. + */ + "data": RumSegmentResponseData; + + /** + * 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: "RumSegmentResponseData", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return RumSegmentResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/RumSegmentResponseAttributes.ts b/packages/datadog-api-client-v2/models/RumSegmentResponseAttributes.ts new file mode 100644 index 000000000000..8bf4b481a779 --- /dev/null +++ b/packages/datadog-api-client-v2/models/RumSegmentResponseAttributes.ts @@ -0,0 +1,179 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { RumSegmentDataQuery } from "./RumSegmentDataQuery"; +import { RumSegmentSegmentType } from "./RumSegmentSegmentType"; +import { RumSegmentSource } from "./RumSegmentSource"; +import { RumSegmentUser } from "./RumSegmentUser"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Attributes of a segment in a response. + */ +export class RumSegmentResponseAttributes { + /** + * The creation timestamp in RFC 3339 format. + */ + "createdAt": Date; + /** + * A user who performed an action on a segment. + */ + "createdBy": RumSegmentUser; + /** + * Query definition for the segment. Contains one or more query blocks and an optional combination formula. + */ + "dataQuery": RumSegmentDataQuery; + /** + * A description of the segment. + */ + "description": string; + /** + * The last modification timestamp in RFC 3339 format. + */ + "modifiedAt": Date; + /** + * A user who performed an action on a segment. + */ + "modifiedBy": RumSegmentUser; + /** + * The name of the segment. + */ + "name": string; + /** + * The organization identifier. + */ + "orgId": number; + /** + * The number of users in the segment. + */ + "rowCount": number; + /** + * The source of a segment. + */ + "source": RumSegmentSource; + /** + * A list of tags for the segment. + */ + "tags": Array; + /** + * The type of a segment based on its data query configuration. + */ + "type": RumSegmentSegmentType; + /** + * The unique identifier of the segment. + */ + "uuid": string; + /** + * The version number of the segment. + */ + "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", + required: true, + format: "date-time", + }, + createdBy: { + baseName: "created_by", + type: "RumSegmentUser", + required: true, + }, + dataQuery: { + baseName: "data_query", + type: "RumSegmentDataQuery", + required: true, + }, + description: { + baseName: "description", + type: "string", + required: true, + }, + modifiedAt: { + baseName: "modified_at", + type: "Date", + required: true, + format: "date-time", + }, + modifiedBy: { + baseName: "modified_by", + type: "RumSegmentUser", + required: true, + }, + name: { + baseName: "name", + type: "string", + required: true, + }, + orgId: { + baseName: "org_id", + type: "number", + required: true, + format: "int64", + }, + rowCount: { + baseName: "row_count", + type: "number", + required: true, + format: "int64", + }, + source: { + baseName: "source", + type: "RumSegmentSource", + required: true, + }, + tags: { + baseName: "tags", + type: "Array", + required: true, + }, + type: { + baseName: "type", + type: "RumSegmentSegmentType", + required: true, + }, + uuid: { + baseName: "uuid", + type: "string", + required: true, + }, + version: { + baseName: "version", + type: "number", + required: true, + format: "int64", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return RumSegmentResponseAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/RumSegmentResponseData.ts b/packages/datadog-api-client-v2/models/RumSegmentResponseData.ts new file mode 100644 index 000000000000..dfae86837e5f --- /dev/null +++ b/packages/datadog-api-client-v2/models/RumSegmentResponseData.ts @@ -0,0 +1,73 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { RumSegmentResourceType } from "./RumSegmentResourceType"; +import { RumSegmentResponseAttributes } from "./RumSegmentResponseAttributes"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Data object for a segment in a response. + */ +export class RumSegmentResponseData { + /** + * Attributes of a segment in a response. + */ + "attributes": RumSegmentResponseAttributes; + /** + * The unique identifier of the segment. + */ + "id": string; + /** + * Type of the segment resource. + */ + "type": RumSegmentResourceType; + + /** + * 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: "RumSegmentResponseAttributes", + required: true, + }, + id: { + baseName: "id", + type: "string", + required: true, + }, + type: { + baseName: "type", + type: "RumSegmentResourceType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return RumSegmentResponseData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/RumSegmentSegmentType.ts b/packages/datadog-api-client-v2/models/RumSegmentSegmentType.ts new file mode 100644 index 000000000000..e6a12401819b --- /dev/null +++ b/packages/datadog-api-client-v2/models/RumSegmentSegmentType.ts @@ -0,0 +1,26 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * The type of a segment based on its data query configuration. + */ + +export type RumSegmentSegmentType = + | typeof STATIC + | typeof EVENT_PLATFORM + | typeof COMBINATION + | typeof JOURNEYS + | typeof REFERENCE_TABLE + | typeof TEMPLATES + | UnparsedObject; +export const STATIC = "static"; +export const EVENT_PLATFORM = "event_platform"; +export const COMBINATION = "combination"; +export const JOURNEYS = "journeys"; +export const REFERENCE_TABLE = "reference_table"; +export const TEMPLATES = "templates"; diff --git a/packages/datadog-api-client-v2/models/RumSegmentSource.ts b/packages/datadog-api-client-v2/models/RumSegmentSource.ts new file mode 100644 index 000000000000..33cbd3e0a343 --- /dev/null +++ b/packages/datadog-api-client-v2/models/RumSegmentSource.ts @@ -0,0 +1,18 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * The source of a segment. + */ + +export type RumSegmentSource = + | typeof USER_CREATED + | typeof INITIAL + | UnparsedObject; +export const USER_CREATED = "user_created"; +export const INITIAL = "initial"; diff --git a/packages/datadog-api-client-v2/models/RumSegmentStaticEntry.ts b/packages/datadog-api-client-v2/models/RumSegmentStaticEntry.ts new file mode 100644 index 000000000000..5338ab318900 --- /dev/null +++ b/packages/datadog-api-client-v2/models/RumSegmentStaticEntry.ts @@ -0,0 +1,72 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * A static user list entry within a segment data query. + */ +export class RumSegmentStaticEntry { + /** + * The identifier of the static list. + */ + "id": string; + /** + * The name of the static list. + */ + "name": string; + /** + * The number of users in the static list. + */ + "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", + required: true, + }, + name: { + baseName: "name", + type: "string", + required: true, + }, + userCount: { + baseName: "user_count", + type: "number", + required: true, + format: "int64", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return RumSegmentStaticEntry.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/RumSegmentTemplateInstance.ts b/packages/datadog-api-client-v2/models/RumSegmentTemplateInstance.ts new file mode 100644 index 000000000000..dc20ee9a327b --- /dev/null +++ b/packages/datadog-api-client-v2/models/RumSegmentTemplateInstance.ts @@ -0,0 +1,79 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * A template-based query block within a segment data query. + */ +export class RumSegmentTemplateInstance { + /** + * The start of the time range in milliseconds since epoch. + */ + "from"?: number; + /** + * The template parameters as key-value pairs. + */ + "parameters"?: { [key: string]: string }; + /** + * The identifier of the template. + */ + "templateId": string; + /** + * The end of the time range in milliseconds since epoch. + */ + "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", + }, + parameters: { + baseName: "parameters", + type: "{ [key: string]: string; }", + }, + templateId: { + baseName: "template_id", + type: "string", + required: true, + }, + to: { + baseName: "to", + type: "number", + format: "int64", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return RumSegmentTemplateInstance.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/RumSegmentTemplateListResponse.ts b/packages/datadog-api-client-v2/models/RumSegmentTemplateListResponse.ts new file mode 100644 index 000000000000..9123f1f274af --- /dev/null +++ b/packages/datadog-api-client-v2/models/RumSegmentTemplateListResponse.ts @@ -0,0 +1,54 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { RumSegmentTemplateResponseData } from "./RumSegmentTemplateResponseData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Response for listing segment templates. + */ +export class RumSegmentTemplateListResponse { + /** + * The list of segment templates. + */ + "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 RumSegmentTemplateListResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/RumSegmentTemplateParameterDef.ts b/packages/datadog-api-client-v2/models/RumSegmentTemplateParameterDef.ts new file mode 100644 index 000000000000..2c2efe35e536 --- /dev/null +++ b/packages/datadog-api-client-v2/models/RumSegmentTemplateParameterDef.ts @@ -0,0 +1,71 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * A parameter definition for a segment template. + */ +export class RumSegmentTemplateParameterDef { + /** + * The default value for the parameter. + */ + "_default": string; + /** + * A description of the parameter. + */ + "description": string; + /** + * Validation rules for the parameter. + */ + "validate": 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 = { + _default: { + baseName: "default", + type: "string", + required: true, + }, + description: { + baseName: "description", + type: "string", + required: true, + }, + validate: { + baseName: "validate", + type: "string", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return RumSegmentTemplateParameterDef.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/RumSegmentTemplateResourceType.ts b/packages/datadog-api-client-v2/models/RumSegmentTemplateResourceType.ts new file mode 100644 index 000000000000..d6d50e1dbea9 --- /dev/null +++ b/packages/datadog-api-client-v2/models/RumSegmentTemplateResourceType.ts @@ -0,0 +1,16 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * Type of the segment template resource. + */ + +export type RumSegmentTemplateResourceType = + | typeof TEMPLATE_METADATA + | UnparsedObject; +export const TEMPLATE_METADATA = "template_metadata"; diff --git a/packages/datadog-api-client-v2/models/RumSegmentTemplateResponseAttributes.ts b/packages/datadog-api-client-v2/models/RumSegmentTemplateResponseAttributes.ts new file mode 100644 index 000000000000..c7e0549a34f7 --- /dev/null +++ b/packages/datadog-api-client-v2/models/RumSegmentTemplateResponseAttributes.ts @@ -0,0 +1,121 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { RumSegmentTemplateParameterDef } from "./RumSegmentTemplateParameterDef"; +import { RumSegmentTemplateStatus } from "./RumSegmentTemplateStatus"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Attributes of a segment template in a response. + */ +export class RumSegmentTemplateResponseAttributes { + /** + * The category of the template. + */ + "category": string; + /** + * The creation timestamp in RFC 3339 format. + */ + "createdAt": Date; + /** + * A description of the template. + */ + "description": string; + /** + * The last modification timestamp in RFC 3339 format. + */ + "modifiedAt": Date; + /** + * The name of the template. + */ + "name": string; + /** + * The template parameter definitions. + */ + "parameters": { [key: string]: RumSegmentTemplateParameterDef }; + /** + * The status of a segment template. + */ + "status": RumSegmentTemplateStatus; + /** + * The version number of the template. + */ + "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 = { + category: { + baseName: "category", + type: "string", + required: true, + }, + createdAt: { + baseName: "created_at", + type: "Date", + required: true, + format: "date-time", + }, + description: { + baseName: "description", + type: "string", + required: true, + }, + modifiedAt: { + baseName: "modified_at", + type: "Date", + required: true, + format: "date-time", + }, + name: { + baseName: "name", + type: "string", + required: true, + }, + parameters: { + baseName: "parameters", + type: "{ [key: string]: RumSegmentTemplateParameterDef; }", + required: true, + }, + status: { + baseName: "status", + type: "RumSegmentTemplateStatus", + required: true, + }, + version: { + baseName: "version", + type: "number", + required: true, + format: "int64", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return RumSegmentTemplateResponseAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/RumSegmentTemplateResponseData.ts b/packages/datadog-api-client-v2/models/RumSegmentTemplateResponseData.ts new file mode 100644 index 000000000000..4c5149e8fd9c --- /dev/null +++ b/packages/datadog-api-client-v2/models/RumSegmentTemplateResponseData.ts @@ -0,0 +1,73 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { RumSegmentTemplateResourceType } from "./RumSegmentTemplateResourceType"; +import { RumSegmentTemplateResponseAttributes } from "./RumSegmentTemplateResponseAttributes"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Data object for a segment template in a response. + */ +export class RumSegmentTemplateResponseData { + /** + * Attributes of a segment template in a response. + */ + "attributes": RumSegmentTemplateResponseAttributes; + /** + * The unique identifier of the template. + */ + "id": string; + /** + * Type of the segment template resource. + */ + "type": RumSegmentTemplateResourceType; + + /** + * 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: "RumSegmentTemplateResponseAttributes", + required: true, + }, + id: { + baseName: "id", + type: "string", + required: true, + }, + type: { + baseName: "type", + type: "RumSegmentTemplateResourceType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return RumSegmentTemplateResponseData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/RumSegmentTemplateStatus.ts b/packages/datadog-api-client-v2/models/RumSegmentTemplateStatus.ts new file mode 100644 index 000000000000..ee334010ca1d --- /dev/null +++ b/packages/datadog-api-client-v2/models/RumSegmentTemplateStatus.ts @@ -0,0 +1,20 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * The status of a segment template. + */ + +export type RumSegmentTemplateStatus = + | typeof ACTIVE + | typeof DEPRECATED + | typeof ARCHIVED + | UnparsedObject; +export const ACTIVE = "active"; +export const DEPRECATED = "deprecated"; +export const ARCHIVED = "archived"; diff --git a/packages/datadog-api-client-v2/models/RumSegmentUpdateAttributes.ts b/packages/datadog-api-client-v2/models/RumSegmentUpdateAttributes.ts new file mode 100644 index 000000000000..546ba564daef --- /dev/null +++ b/packages/datadog-api-client-v2/models/RumSegmentUpdateAttributes.ts @@ -0,0 +1,77 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { RumSegmentDataQuery } from "./RumSegmentDataQuery"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Attributes for updating a segment. All fields are optional. + */ +export class RumSegmentUpdateAttributes { + /** + * Query definition for the segment. Contains one or more query blocks and an optional combination formula. + */ + "dataQuery"?: RumSegmentDataQuery; + /** + * The updated description of the segment. + */ + "description"?: string; + /** + * The updated name of the segment. + */ + "name"?: string; + /** + * The updated list of tags for the segment. + */ + "tags"?: 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 = { + dataQuery: { + baseName: "data_query", + type: "RumSegmentDataQuery", + }, + description: { + baseName: "description", + type: "string", + }, + name: { + baseName: "name", + type: "string", + }, + tags: { + baseName: "tags", + type: "Array", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return RumSegmentUpdateAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/RumSegmentUpdateData.ts b/packages/datadog-api-client-v2/models/RumSegmentUpdateData.ts new file mode 100644 index 000000000000..7c361791a2bd --- /dev/null +++ b/packages/datadog-api-client-v2/models/RumSegmentUpdateData.ts @@ -0,0 +1,73 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { RumSegmentResourceType } from "./RumSegmentResourceType"; +import { RumSegmentUpdateAttributes } from "./RumSegmentUpdateAttributes"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Data object for a segment update request. + */ +export class RumSegmentUpdateData { + /** + * Attributes for updating a segment. All fields are optional. + */ + "attributes": RumSegmentUpdateAttributes; + /** + * The identifier of the segment to update. + */ + "id": string; + /** + * Type of the segment resource. + */ + "type": RumSegmentResourceType; + + /** + * 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: "RumSegmentUpdateAttributes", + required: true, + }, + id: { + baseName: "id", + type: "string", + required: true, + }, + type: { + baseName: "type", + type: "RumSegmentResourceType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return RumSegmentUpdateData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/RumSegmentUpdateRequest.ts b/packages/datadog-api-client-v2/models/RumSegmentUpdateRequest.ts new file mode 100644 index 000000000000..84d70738c79e --- /dev/null +++ b/packages/datadog-api-client-v2/models/RumSegmentUpdateRequest.ts @@ -0,0 +1,54 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { RumSegmentUpdateData } from "./RumSegmentUpdateData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Request body for updating a segment. + */ +export class RumSegmentUpdateRequest { + /** + * Data object for a segment update request. + */ + "data": RumSegmentUpdateData; + + /** + * 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: "RumSegmentUpdateData", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return RumSegmentUpdateRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/RumSegmentUser.ts b/packages/datadog-api-client-v2/models/RumSegmentUser.ts new file mode 100644 index 000000000000..66d6d6d93d0a --- /dev/null +++ b/packages/datadog-api-client-v2/models/RumSegmentUser.ts @@ -0,0 +1,89 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * A user who performed an action on a segment. + */ +export class RumSegmentUser { + /** + * The email handle of the user. + */ + "handle": string; + /** + * The URL of the user icon. + */ + "icon": string; + /** + * The numeric identifier of the user. + */ + "id": string; + /** + * The display name of the user. + */ + "name": string; + /** + * The unique identifier of the user. + */ + "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", + required: true, + }, + id: { + baseName: "id", + type: "string", + required: true, + }, + name: { + baseName: "name", + type: "string", + required: true, + }, + uuid: { + baseName: "uuid", + type: "string", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return RumSegmentUser.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/RumStaticSegmentCreateAttributes.ts b/packages/datadog-api-client-v2/models/RumStaticSegmentCreateAttributes.ts new file mode 100644 index 000000000000..36b478d46e9f --- /dev/null +++ b/packages/datadog-api-client-v2/models/RumStaticSegmentCreateAttributes.ts @@ -0,0 +1,80 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { RumStaticSegmentJourneyQueryObject } from "./RumStaticSegmentJourneyQueryObject"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Attributes for creating a new static segment. + */ +export class RumStaticSegmentCreateAttributes { + /** + * A description of the static segment. + */ + "description": string; + /** + * The journey query object used to compute the static segment user list. + */ + "journeyQueryObject": RumStaticSegmentJourneyQueryObject; + /** + * The name of the static segment. + */ + "name": string; + /** + * A list of tags for the static segment. + */ + "tags"?: 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 = { + description: { + baseName: "description", + type: "string", + required: true, + }, + journeyQueryObject: { + baseName: "journey_query_object", + type: "RumStaticSegmentJourneyQueryObject", + required: true, + }, + name: { + baseName: "name", + type: "string", + required: true, + }, + tags: { + baseName: "tags", + type: "Array", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return RumStaticSegmentCreateAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/RumStaticSegmentCreateData.ts b/packages/datadog-api-client-v2/models/RumStaticSegmentCreateData.ts new file mode 100644 index 000000000000..126ff9565d66 --- /dev/null +++ b/packages/datadog-api-client-v2/models/RumStaticSegmentCreateData.ts @@ -0,0 +1,64 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { RumStaticSegmentCreateAttributes } from "./RumStaticSegmentCreateAttributes"; +import { RumStaticSegmentRequestType } from "./RumStaticSegmentRequestType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Data object for a static segment creation request. + */ +export class RumStaticSegmentCreateData { + /** + * Attributes for creating a new static segment. + */ + "attributes": RumStaticSegmentCreateAttributes; + /** + * Type of the static segment creation request resource. + */ + "type": RumStaticSegmentRequestType; + + /** + * 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: "RumStaticSegmentCreateAttributes", + required: true, + }, + type: { + baseName: "type", + type: "RumStaticSegmentRequestType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return RumStaticSegmentCreateData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/RumStaticSegmentCreateRequest.ts b/packages/datadog-api-client-v2/models/RumStaticSegmentCreateRequest.ts new file mode 100644 index 000000000000..87a1c7a10352 --- /dev/null +++ b/packages/datadog-api-client-v2/models/RumStaticSegmentCreateRequest.ts @@ -0,0 +1,54 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { RumStaticSegmentCreateData } from "./RumStaticSegmentCreateData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Request body for creating a new static segment. + */ +export class RumStaticSegmentCreateRequest { + /** + * Data object for a static segment creation request. + */ + "data": RumStaticSegmentCreateData; + + /** + * 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: "RumStaticSegmentCreateData", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return RumStaticSegmentCreateRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/RumStaticSegmentJourneyFilter.ts b/packages/datadog-api-client-v2/models/RumStaticSegmentJourneyFilter.ts new file mode 100644 index 000000000000..73503773e18e --- /dev/null +++ b/packages/datadog-api-client-v2/models/RumStaticSegmentJourneyFilter.ts @@ -0,0 +1,62 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * A filter within a journey query node. + */ +export class RumStaticSegmentJourneyFilter { + /** + * The attribute to filter on. + */ + "attribute": string; + /** + * The value to match. + */ + "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 = { + attribute: { + baseName: "attribute", + type: "string", + required: true, + }, + value: { + baseName: "value", + type: "string", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return RumStaticSegmentJourneyFilter.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/RumStaticSegmentJourneyNode.ts b/packages/datadog-api-client-v2/models/RumStaticSegmentJourneyNode.ts new file mode 100644 index 000000000000..234f58d9fa60 --- /dev/null +++ b/packages/datadog-api-client-v2/models/RumStaticSegmentJourneyNode.ts @@ -0,0 +1,54 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { RumStaticSegmentJourneyFilter } from "./RumStaticSegmentJourneyFilter"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * A node in a journey query object. + */ +export class RumStaticSegmentJourneyNode { + /** + * The list of filters for this node. + */ + "filters": 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 = { + filters: { + baseName: "filters", + type: "Array", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return RumStaticSegmentJourneyNode.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/RumStaticSegmentJourneyQueryObject.ts b/packages/datadog-api-client-v2/models/RumStaticSegmentJourneyQueryObject.ts new file mode 100644 index 000000000000..9951b68f4235 --- /dev/null +++ b/packages/datadog-api-client-v2/models/RumStaticSegmentJourneyQueryObject.ts @@ -0,0 +1,54 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { RumStaticSegmentJourneyNode } from "./RumStaticSegmentJourneyNode"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * The journey query object used to compute the static segment user list. + */ +export class RumStaticSegmentJourneyQueryObject { + /** + * The list of journey nodes defining the query. + */ + "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 = { + nodes: { + baseName: "nodes", + type: "Array", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return RumStaticSegmentJourneyQueryObject.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/RumStaticSegmentRequestType.ts b/packages/datadog-api-client-v2/models/RumStaticSegmentRequestType.ts new file mode 100644 index 000000000000..62554a303286 --- /dev/null +++ b/packages/datadog-api-client-v2/models/RumStaticSegmentRequestType.ts @@ -0,0 +1,16 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * Type of the static segment creation request resource. + */ + +export type RumStaticSegmentRequestType = + | typeof CREATE_STATIC_SEGMENT_REQUEST + | UnparsedObject; +export const CREATE_STATIC_SEGMENT_REQUEST = "create_static_segment_request";