diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index b9a63afce0..59e19780a6 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/docs/datadog_api_client.v2.api.rst b/docs/datadog_api_client.v2.api.rst index 09298657ad..449c0eb2be 100644 --- a/docs/datadog_api_client.v2.api.rst +++ b/docs/datadog_api_client.v2.api.rst @@ -557,6 +557,13 @@ datadog\_api\_client.v2.api.rum\_retention\_filters\_api module :members: :show-inheritance: +datadog\_api\_client.v2.api.rum\_user\_segments\_api module +----------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.api.rum_user_segments_api + :members: + :show-inheritance: + datadog\_api\_client.v2.api.seats\_api module --------------------------------------------- diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index 06ddf5f818..036f7558cf 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -22642,6 +22642,230 @@ datadog\_api\_client.v2.model.rum\_search\_events\_request module :members: :show-inheritance: +datadog\_api\_client.v2.model.rum\_segment\_create\_attributes module +--------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.rum_segment_create_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.rum\_segment\_create\_data module +--------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.rum_segment_create_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.rum\_segment\_create\_request module +------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.rum_segment_create_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.rum\_segment\_data\_query module +-------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.rum_segment_data_query + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.rum\_segment\_delete\_attributes module +--------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.rum_segment_delete_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.rum\_segment\_delete\_data module +--------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.rum_segment_delete_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.rum\_segment\_delete\_response module +------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.rum_segment_delete_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.rum\_segment\_delete\_type module +--------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.rum_segment_delete_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.rum\_segment\_event\_platform module +------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.rum_segment_event_platform + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.rum\_segment\_journey module +---------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.rum_segment_journey + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.rum\_segment\_list\_response module +----------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.rum_segment_list_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.rum\_segment\_reference\_table module +------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.rum_segment_reference_table + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.rum\_segment\_reference\_table\_column module +--------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.rum_segment_reference_table_column + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.rum\_segment\_reference\_table\_join\_condition module +------------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.rum_segment_reference_table_join_condition + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.rum\_segment\_resource\_type module +----------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.rum_segment_resource_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.rum\_segment\_response module +----------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.rum_segment_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.rum\_segment\_response\_attributes module +----------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.rum_segment_response_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.rum\_segment\_response\_data module +----------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.rum_segment_response_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.rum\_segment\_segment\_type module +---------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.rum_segment_segment_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.rum\_segment\_source module +--------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.rum_segment_source + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.rum\_segment\_static\_entry module +---------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.rum_segment_static_entry + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.rum\_segment\_template\_instance module +--------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.rum_segment_template_instance + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.rum\_segment\_template\_list\_response module +--------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.rum_segment_template_list_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.rum\_segment\_template\_parameter\_def module +--------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.rum_segment_template_parameter_def + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.rum\_segment\_template\_resource\_type module +--------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.rum_segment_template_resource_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.rum\_segment\_template\_response\_attributes module +--------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.rum_segment_template_response_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.rum\_segment\_template\_response\_data module +--------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.rum_segment_template_response_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.rum\_segment\_template\_status module +------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.rum_segment_template_status + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.rum\_segment\_update\_attributes module +--------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.rum_segment_update_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.rum\_segment\_update\_data module +--------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.rum_segment_update_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.rum\_segment\_update\_request module +------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.rum_segment_update_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.rum\_segment\_user module +------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.rum_segment_user + :members: + :show-inheritance: + datadog\_api\_client.v2.model.rum\_sort module ---------------------------------------------- @@ -22656,6 +22880,55 @@ datadog\_api\_client.v2.model.rum\_sort\_order module :members: :show-inheritance: +datadog\_api\_client.v2.model.rum\_static\_segment\_create\_attributes module +----------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.rum_static_segment_create_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.rum\_static\_segment\_create\_data module +----------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.rum_static_segment_create_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.rum\_static\_segment\_create\_request module +-------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.rum_static_segment_create_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.rum\_static\_segment\_journey\_filter module +-------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.rum_static_segment_journey_filter + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.rum\_static\_segment\_journey\_node module +------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.rum_static_segment_journey_node + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.rum\_static\_segment\_journey\_query\_object module +--------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.rum_static_segment_journey_query_object + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.rum\_static\_segment\_request\_type module +------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.rum_static_segment_request_type + :members: + :show-inheritance: + datadog\_api\_client.v2.model.rum\_warning module ------------------------------------------------- diff --git a/examples/v2/rum-user-segments/CreateRumSegment.py b/examples/v2/rum-user-segments/CreateRumSegment.py new file mode 100644 index 0000000000..037d271f0b --- /dev/null +++ b/examples/v2/rum-user-segments/CreateRumSegment.py @@ -0,0 +1,92 @@ +""" +Create a RUM segment returns "Created" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.rum_user_segments_api import RUMUserSegmentsApi +from datadog_api_client.v2.model.rum_segment_create_attributes import RumSegmentCreateAttributes +from datadog_api_client.v2.model.rum_segment_create_data import RumSegmentCreateData +from datadog_api_client.v2.model.rum_segment_create_request import RumSegmentCreateRequest +from datadog_api_client.v2.model.rum_segment_data_query import RumSegmentDataQuery +from datadog_api_client.v2.model.rum_segment_event_platform import RumSegmentEventPlatform +from datadog_api_client.v2.model.rum_segment_journey import RumSegmentJourney +from datadog_api_client.v2.model.rum_segment_reference_table import RumSegmentReferenceTable +from datadog_api_client.v2.model.rum_segment_reference_table_column import RumSegmentReferenceTableColumn +from datadog_api_client.v2.model.rum_segment_reference_table_join_condition import RumSegmentReferenceTableJoinCondition +from datadog_api_client.v2.model.rum_segment_resource_type import RumSegmentResourceType +from datadog_api_client.v2.model.rum_segment_static_entry import RumSegmentStaticEntry +from datadog_api_client.v2.model.rum_segment_template_instance import RumSegmentTemplateInstance + +body = RumSegmentCreateRequest( + data=RumSegmentCreateData( + attributes=RumSegmentCreateAttributes( + data_query=RumSegmentDataQuery( + combination="(logs && apm_home) && NOT(apm_trace)", + event_platforms=[ + RumSegmentEventPlatform( + facet="@usr.id", + _from=1709888355000, + name="logs", + query="@type:view @view.url_path:/logs", + to=1710493155000, + ), + ], + journeys=[ + RumSegmentJourney( + conversion_type="any", + group_by="@usr.id", + name="my_journey", + search="@type:view", + ), + ], + reference_tables=[ + RumSegmentReferenceTable( + columns=[ + RumSegmentReferenceTableColumn( + name="user_id", + ), + ], + filter_query="", + join_condition=RumSegmentReferenceTableJoinCondition( + column_name="user_id", + facet="@usr.id", + ), + name="my_ref_table", + table_name="my_table", + ), + ], + static=[ + RumSegmentStaticEntry( + id="static-list-1", + name="My Static List", + user_count=500, + ), + ], + templates=[ + RumSegmentTemplateInstance( + _from=1709888355000, + parameters=dict( + threshold="5", + ), + template_id="stickiness-v1", + to=1710493155000, + ), + ], + ), + description="Users who visited the homepage.", + name="My Segment", + tags=[ + "team:frontend", + ], + ), + type=RumSegmentResourceType.SEGMENT, + ), +) + +configuration = Configuration() +configuration.unstable_operations["create_rum_segment"] = True +with ApiClient(configuration) as api_client: + api_instance = RUMUserSegmentsApi(api_client) + response = api_instance.create_rum_segment(body=body) + + print(response) diff --git a/examples/v2/rum-user-segments/CreateRumStaticSegment.py b/examples/v2/rum-user-segments/CreateRumStaticSegment.py new file mode 100644 index 0000000000..e471cc6667 --- /dev/null +++ b/examples/v2/rum-user-segments/CreateRumStaticSegment.py @@ -0,0 +1,46 @@ +""" +Create a static RUM segment returns "Created" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.rum_user_segments_api import RUMUserSegmentsApi +from datadog_api_client.v2.model.rum_static_segment_create_attributes import RumStaticSegmentCreateAttributes +from datadog_api_client.v2.model.rum_static_segment_create_data import RumStaticSegmentCreateData +from datadog_api_client.v2.model.rum_static_segment_create_request import RumStaticSegmentCreateRequest +from datadog_api_client.v2.model.rum_static_segment_journey_filter import RumStaticSegmentJourneyFilter +from datadog_api_client.v2.model.rum_static_segment_journey_node import RumStaticSegmentJourneyNode +from datadog_api_client.v2.model.rum_static_segment_journey_query_object import RumStaticSegmentJourneyQueryObject +from datadog_api_client.v2.model.rum_static_segment_request_type import RumStaticSegmentRequestType + +body = RumStaticSegmentCreateRequest( + data=RumStaticSegmentCreateData( + attributes=RumStaticSegmentCreateAttributes( + description="Users from a specific journey.", + journey_query_object=RumStaticSegmentJourneyQueryObject( + nodes=[ + RumStaticSegmentJourneyNode( + filters=[ + RumStaticSegmentJourneyFilter( + attribute="@type", + value="view", + ), + ], + ), + ], + ), + name="My Static Segment", + tags=[ + "team:frontend", + ], + ), + type=RumStaticSegmentRequestType.CREATE_STATIC_SEGMENT_REQUEST, + ), +) + +configuration = Configuration() +configuration.unstable_operations["create_rum_static_segment"] = True +with ApiClient(configuration) as api_client: + api_instance = RUMUserSegmentsApi(api_client) + response = api_instance.create_rum_static_segment(body=body) + + print(response) diff --git a/examples/v2/rum-user-segments/DeleteRumSegment.py b/examples/v2/rum-user-segments/DeleteRumSegment.py new file mode 100644 index 0000000000..7f00696af4 --- /dev/null +++ b/examples/v2/rum-user-segments/DeleteRumSegment.py @@ -0,0 +1,16 @@ +""" +Delete a RUM segment returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.rum_user_segments_api import RUMUserSegmentsApi + +configuration = Configuration() +configuration.unstable_operations["delete_rum_segment"] = True +with ApiClient(configuration) as api_client: + api_instance = RUMUserSegmentsApi(api_client) + response = api_instance.delete_rum_segment( + segment_id="a1b2c3d4-1234-5678-9abc-123456789abc", + ) + + print(response) diff --git a/examples/v2/rum-user-segments/GetRumSegment.py b/examples/v2/rum-user-segments/GetRumSegment.py new file mode 100644 index 0000000000..b0aa88e1a5 --- /dev/null +++ b/examples/v2/rum-user-segments/GetRumSegment.py @@ -0,0 +1,16 @@ +""" +Get a RUM segment returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.rum_user_segments_api import RUMUserSegmentsApi + +configuration = Configuration() +configuration.unstable_operations["get_rum_segment"] = True +with ApiClient(configuration) as api_client: + api_instance = RUMUserSegmentsApi(api_client) + response = api_instance.get_rum_segment( + segment_id="a1b2c3d4-1234-5678-9abc-123456789abc", + ) + + print(response) diff --git a/examples/v2/rum-user-segments/InitializeRumSegments.py b/examples/v2/rum-user-segments/InitializeRumSegments.py new file mode 100644 index 0000000000..04acb4ec80 --- /dev/null +++ b/examples/v2/rum-user-segments/InitializeRumSegments.py @@ -0,0 +1,12 @@ +""" +Initialize RUM segments returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.rum_user_segments_api import RUMUserSegmentsApi + +configuration = Configuration() +configuration.unstable_operations["initialize_rum_segments"] = True +with ApiClient(configuration) as api_client: + api_instance = RUMUserSegmentsApi(api_client) + api_instance.initialize_rum_segments() diff --git a/examples/v2/rum-user-segments/ListRumSegmentTemplates.py b/examples/v2/rum-user-segments/ListRumSegmentTemplates.py new file mode 100644 index 0000000000..6cd2bf91ba --- /dev/null +++ b/examples/v2/rum-user-segments/ListRumSegmentTemplates.py @@ -0,0 +1,14 @@ +""" +List RUM segment templates returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.rum_user_segments_api import RUMUserSegmentsApi + +configuration = Configuration() +configuration.unstable_operations["list_rum_segment_templates"] = True +with ApiClient(configuration) as api_client: + api_instance = RUMUserSegmentsApi(api_client) + response = api_instance.list_rum_segment_templates() + + print(response) diff --git a/examples/v2/rum-user-segments/ListRumSegments.py b/examples/v2/rum-user-segments/ListRumSegments.py new file mode 100644 index 0000000000..7b4cf2017e --- /dev/null +++ b/examples/v2/rum-user-segments/ListRumSegments.py @@ -0,0 +1,14 @@ +""" +List all RUM segments returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.rum_user_segments_api import RUMUserSegmentsApi + +configuration = Configuration() +configuration.unstable_operations["list_rum_segments"] = True +with ApiClient(configuration) as api_client: + api_instance = RUMUserSegmentsApi(api_client) + response = api_instance.list_rum_segments() + + print(response) diff --git a/examples/v2/rum-user-segments/UpdateRumSegment.py b/examples/v2/rum-user-segments/UpdateRumSegment.py new file mode 100644 index 0000000000..519d7986cf --- /dev/null +++ b/examples/v2/rum-user-segments/UpdateRumSegment.py @@ -0,0 +1,91 @@ +""" +Update a RUM segment returns "No Content" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.rum_user_segments_api import RUMUserSegmentsApi +from datadog_api_client.v2.model.rum_segment_data_query import RumSegmentDataQuery +from datadog_api_client.v2.model.rum_segment_event_platform import RumSegmentEventPlatform +from datadog_api_client.v2.model.rum_segment_journey import RumSegmentJourney +from datadog_api_client.v2.model.rum_segment_reference_table import RumSegmentReferenceTable +from datadog_api_client.v2.model.rum_segment_reference_table_column import RumSegmentReferenceTableColumn +from datadog_api_client.v2.model.rum_segment_reference_table_join_condition import RumSegmentReferenceTableJoinCondition +from datadog_api_client.v2.model.rum_segment_resource_type import RumSegmentResourceType +from datadog_api_client.v2.model.rum_segment_static_entry import RumSegmentStaticEntry +from datadog_api_client.v2.model.rum_segment_template_instance import RumSegmentTemplateInstance +from datadog_api_client.v2.model.rum_segment_update_attributes import RumSegmentUpdateAttributes +from datadog_api_client.v2.model.rum_segment_update_data import RumSegmentUpdateData +from datadog_api_client.v2.model.rum_segment_update_request import RumSegmentUpdateRequest + +body = RumSegmentUpdateRequest( + data=RumSegmentUpdateData( + attributes=RumSegmentUpdateAttributes( + data_query=RumSegmentDataQuery( + combination="(logs && apm_home) && NOT(apm_trace)", + event_platforms=[ + RumSegmentEventPlatform( + facet="@usr.id", + _from=1709888355000, + name="logs", + query="@type:view @view.url_path:/logs", + to=1710493155000, + ), + ], + journeys=[ + RumSegmentJourney( + conversion_type="any", + group_by="@usr.id", + name="my_journey", + search="@type:view", + ), + ], + reference_tables=[ + RumSegmentReferenceTable( + columns=[ + RumSegmentReferenceTableColumn( + name="user_id", + ), + ], + filter_query="", + join_condition=RumSegmentReferenceTableJoinCondition( + column_name="user_id", + facet="@usr.id", + ), + name="my_ref_table", + table_name="my_table", + ), + ], + static=[ + RumSegmentStaticEntry( + id="static-list-1", + name="My Static List", + user_count=500, + ), + ], + templates=[ + RumSegmentTemplateInstance( + _from=1709888355000, + parameters=dict( + 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=RumSegmentResourceType.SEGMENT, + ), +) + +configuration = Configuration() +configuration.unstable_operations["update_rum_segment"] = True +with ApiClient(configuration) as api_client: + api_instance = RUMUserSegmentsApi(api_client) + api_instance.update_rum_segment(segment_id="a1b2c3d4-1234-5678-9abc-123456789abc", body=body) diff --git a/src/datadog_api_client/configuration.py b/src/datadog_api_client/configuration.py index 21a039a1d8..d91506a238 100644 --- a/src/datadog_api_client/configuration.py +++ b/src/datadog_api_client/configuration.py @@ -411,6 +411,14 @@ def __init__( "v2.query_event_filtered_users": False, "v2.query_users": False, "v2.update_connection": False, + "v2.create_rum_segment": False, + "v2.create_rum_static_segment": False, + "v2.delete_rum_segment": False, + "v2.get_rum_segment": False, + "v2.initialize_rum_segments": False, + "v2.list_rum_segments": False, + "v2.list_rum_segment_templates": False, + "v2.update_rum_segment": False, "v2.create_scorecard_outcomes_batch": False, "v2.create_scorecard_rule": False, "v2.delete_scorecard_rule": False, diff --git a/src/datadog_api_client/v2/api/rum_user_segments_api.py b/src/datadog_api_client/v2/api/rum_user_segments_api.py new file mode 100644 index 0000000000..6115761e63 --- /dev/null +++ b/src/datadog_api_client/v2/api/rum_user_segments_api.py @@ -0,0 +1,338 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Any, Dict, Union + +from datadog_api_client.api_client import ApiClient, Endpoint as _Endpoint +from datadog_api_client.configuration import Configuration +from datadog_api_client.model_utils import ( + UnsetType, + unset, +) +from datadog_api_client.v2.model.rum_segment_list_response import RumSegmentListResponse +from datadog_api_client.v2.model.rum_segment_response import RumSegmentResponse +from datadog_api_client.v2.model.rum_segment_create_request import RumSegmentCreateRequest +from datadog_api_client.v2.model.rum_static_segment_create_request import RumStaticSegmentCreateRequest +from datadog_api_client.v2.model.rum_segment_template_list_response import RumSegmentTemplateListResponse +from datadog_api_client.v2.model.rum_segment_delete_response import RumSegmentDeleteResponse +from datadog_api_client.v2.model.rum_segment_update_request import RumSegmentUpdateRequest + + +class RUMUserSegmentsApi: + """ + Manage RUM user segments for audience targeting and analysis. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient(Configuration()) + self.api_client = api_client + + self._create_rum_segment_endpoint = _Endpoint( + settings={ + "response_type": (RumSegmentResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/rum/segment", + "operation_id": "create_rum_segment", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "body": { + "required": True, + "openapi_types": (RumSegmentCreateRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + self._create_rum_static_segment_endpoint = _Endpoint( + settings={ + "response_type": (RumSegmentResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/rum/segment/static", + "operation_id": "create_rum_static_segment", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "body": { + "required": True, + "openapi_types": (RumStaticSegmentCreateRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + self._delete_rum_segment_endpoint = _Endpoint( + settings={ + "response_type": (RumSegmentDeleteResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/rum/segment/{segment_id}", + "operation_id": "delete_rum_segment", + "http_method": "DELETE", + "version": "v2", + }, + params_map={ + "segment_id": { + "required": True, + "openapi_types": (str,), + "attribute": "segment_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._get_rum_segment_endpoint = _Endpoint( + settings={ + "response_type": (RumSegmentResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/rum/segment/{segment_id}", + "operation_id": "get_rum_segment", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "segment_id": { + "required": True, + "openapi_types": (str,), + "attribute": "segment_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._initialize_rum_segments_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/rum/segment/initialize", + "operation_id": "initialize_rum_segments", + "http_method": "POST", + "version": "v2", + }, + params_map={}, + headers_map={ + "accept": ["*/*"], + }, + api_client=api_client, + ) + + self._list_rum_segments_endpoint = _Endpoint( + settings={ + "response_type": (RumSegmentListResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/rum/segment", + "operation_id": "list_rum_segments", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "sort": { + "openapi_types": (str,), + "attribute": "sort", + "location": "query", + }, + "limit": { + "openapi_types": (int,), + "attribute": "limit", + "location": "query", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._list_rum_segment_templates_endpoint = _Endpoint( + settings={ + "response_type": (RumSegmentTemplateListResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/rum/segment/templates", + "operation_id": "list_rum_segment_templates", + "http_method": "GET", + "version": "v2", + }, + params_map={}, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._update_rum_segment_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/rum/segment/{segment_id}", + "operation_id": "update_rum_segment", + "http_method": "PUT", + "version": "v2", + }, + params_map={ + "segment_id": { + "required": True, + "openapi_types": (str,), + "attribute": "segment_id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (RumSegmentUpdateRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["*/*"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + def create_rum_segment( + self, + body: RumSegmentCreateRequest, + ) -> RumSegmentResponse: + """Create a RUM segment. + + Create a new user segment for the current organization. + + :type body: RumSegmentCreateRequest + :rtype: RumSegmentResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["body"] = body + + return self._create_rum_segment_endpoint.call_with_http_info(**kwargs) + + def create_rum_static_segment( + self, + body: RumStaticSegmentCreateRequest, + ) -> RumSegmentResponse: + """Create a static RUM segment. + + 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. + + :type body: RumStaticSegmentCreateRequest + :rtype: RumSegmentResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["body"] = body + + return self._create_rum_static_segment_endpoint.call_with_http_info(**kwargs) + + def delete_rum_segment( + self, + segment_id: str, + ) -> RumSegmentDeleteResponse: + """Delete a RUM segment. + + Delete a user segment by its identifier. + + :param segment_id: The identifier of the segment. + :type segment_id: str + :rtype: RumSegmentDeleteResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["segment_id"] = segment_id + + return self._delete_rum_segment_endpoint.call_with_http_info(**kwargs) + + def get_rum_segment( + self, + segment_id: str, + ) -> RumSegmentResponse: + """Get a RUM segment. + + Get a specific user segment by its identifier. + + :param segment_id: The identifier of the segment. + :type segment_id: str + :rtype: RumSegmentResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["segment_id"] = segment_id + + return self._get_rum_segment_endpoint.call_with_http_info(**kwargs) + + def initialize_rum_segments( + self, + ) -> None: + """Initialize RUM segments. + + Initialize default segments for the current organization. This creates a set of predefined segments if they do not already exist. + + :rtype: None + """ + kwargs: Dict[str, Any] = {} + return self._initialize_rum_segments_endpoint.call_with_http_info(**kwargs) + + def list_rum_segments( + self, + *, + sort: Union[str, UnsetType] = unset, + limit: Union[int, UnsetType] = unset, + ) -> RumSegmentListResponse: + """List all RUM segments. + + List all user segments for the current organization. Supports sorting and pagination. + + :param sort: Sort order for the segments list. + :type sort: str, optional + :param limit: Maximum number of segments to return. + :type limit: int, optional + :rtype: RumSegmentListResponse + """ + kwargs: Dict[str, Any] = {} + if sort is not unset: + kwargs["sort"] = sort + + if limit is not unset: + kwargs["limit"] = limit + + return self._list_rum_segments_endpoint.call_with_http_info(**kwargs) + + def list_rum_segment_templates( + self, + ) -> RumSegmentTemplateListResponse: + """List RUM segment templates. + + List all available segment templates. Templates provide predefined segment configurations that can be customized with parameters. + + :rtype: RumSegmentTemplateListResponse + """ + kwargs: Dict[str, Any] = {} + return self._list_rum_segment_templates_endpoint.call_with_http_info(**kwargs) + + def update_rum_segment( + self, + segment_id: str, + body: RumSegmentUpdateRequest, + ) -> None: + """Update a RUM segment. + + Update an existing user segment. All fields in the request body are optional. + + :param segment_id: The identifier of the segment. + :type segment_id: str + :type body: RumSegmentUpdateRequest + :rtype: None + """ + kwargs: Dict[str, Any] = {} + kwargs["segment_id"] = segment_id + + kwargs["body"] = body + + return self._update_rum_segment_endpoint.call_with_http_info(**kwargs) diff --git a/src/datadog_api_client/v2/apis/__init__.py b/src/datadog_api_client/v2/apis/__init__.py index c8272e85ae..ea5251e61c 100644 --- a/src/datadog_api_client/v2/apis/__init__.py +++ b/src/datadog_api_client/v2/apis/__init__.py @@ -67,6 +67,7 @@ from datadog_api_client.v2.api.processes_api import ProcessesApi from datadog_api_client.v2.api.product_analytics_api import ProductAnalyticsApi from datadog_api_client.v2.api.rum_api import RUMApi +from datadog_api_client.v2.api.rum_user_segments_api import RUMUserSegmentsApi from datadog_api_client.v2.api.reference_tables_api import ReferenceTablesApi from datadog_api_client.v2.api.restriction_policies_api import RestrictionPoliciesApi from datadog_api_client.v2.api.roles_api import RolesApi @@ -169,6 +170,7 @@ "ProcessesApi", "ProductAnalyticsApi", "RUMApi", + "RUMUserSegmentsApi", "ReferenceTablesApi", "RestrictionPoliciesApi", "RolesApi", diff --git a/src/datadog_api_client/v2/model/rum_segment_create_attributes.py b/src/datadog_api_client/v2/model/rum_segment_create_attributes.py new file mode 100644 index 0000000000..1160c76f31 --- /dev/null +++ b/src/datadog_api_client/v2/model/rum_segment_create_attributes.py @@ -0,0 +1,69 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.rum_segment_data_query import RumSegmentDataQuery + + +class RumSegmentCreateAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.rum_segment_data_query import RumSegmentDataQuery + + return { + "data_query": (RumSegmentDataQuery,), + "description": (str,), + "name": (str,), + "tags": ([str],), + } + + attribute_map = { + "data_query": "data_query", + "description": "description", + "name": "name", + "tags": "tags", + } + + def __init__( + self_, + data_query: RumSegmentDataQuery, + name: str, + description: Union[str, UnsetType] = unset, + tags: Union[List[str], UnsetType] = unset, + **kwargs, + ): + """ + Attributes for creating a new segment. + + :param data_query: Query definition for the segment. Contains one or more query blocks and an optional combination formula. + :type data_query: RumSegmentDataQuery + + :param description: A description of the segment. + :type description: str, optional + + :param name: The name of the segment. + :type name: str + + :param tags: A list of tags for the segment. + :type tags: [str], optional + """ + if description is not unset: + kwargs["description"] = description + if tags is not unset: + kwargs["tags"] = tags + super().__init__(kwargs) + + self_.data_query = data_query + self_.name = name diff --git a/src/datadog_api_client/v2/model/rum_segment_create_data.py b/src/datadog_api_client/v2/model/rum_segment_create_data.py new file mode 100644 index 0000000000..6fbf6dbcc8 --- /dev/null +++ b/src/datadog_api_client/v2/model/rum_segment_create_data.py @@ -0,0 +1,48 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.rum_segment_create_attributes import RumSegmentCreateAttributes + from datadog_api_client.v2.model.rum_segment_resource_type import RumSegmentResourceType + + +class RumSegmentCreateData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.rum_segment_create_attributes import RumSegmentCreateAttributes + from datadog_api_client.v2.model.rum_segment_resource_type import RumSegmentResourceType + + return { + "attributes": (RumSegmentCreateAttributes,), + "type": (RumSegmentResourceType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__(self_, attributes: RumSegmentCreateAttributes, type: RumSegmentResourceType, **kwargs): + """ + Data object for a segment creation request. + + :param attributes: Attributes for creating a new segment. + :type attributes: RumSegmentCreateAttributes + + :param type: Type of the segment resource. + :type type: RumSegmentResourceType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/model/rum_segment_create_request.py b/src/datadog_api_client/v2/model/rum_segment_create_request.py new file mode 100644 index 0000000000..4a08d635af --- /dev/null +++ b/src/datadog_api_client/v2/model/rum_segment_create_request.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.rum_segment_create_data import RumSegmentCreateData + + +class RumSegmentCreateRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.rum_segment_create_data import RumSegmentCreateData + + return { + "data": (RumSegmentCreateData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: RumSegmentCreateData, **kwargs): + """ + Request body for creating a new segment. + + :param data: Data object for a segment creation request. + :type data: RumSegmentCreateData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/rum_segment_data_query.py b/src/datadog_api_client/v2/model/rum_segment_data_query.py new file mode 100644 index 0000000000..d585527f1b --- /dev/null +++ b/src/datadog_api_client/v2/model/rum_segment_data_query.py @@ -0,0 +1,94 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.rum_segment_event_platform import RumSegmentEventPlatform + from datadog_api_client.v2.model.rum_segment_journey import RumSegmentJourney + from datadog_api_client.v2.model.rum_segment_reference_table import RumSegmentReferenceTable + from datadog_api_client.v2.model.rum_segment_static_entry import RumSegmentStaticEntry + from datadog_api_client.v2.model.rum_segment_template_instance import RumSegmentTemplateInstance + + +class RumSegmentDataQuery(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.rum_segment_event_platform import RumSegmentEventPlatform + from datadog_api_client.v2.model.rum_segment_journey import RumSegmentJourney + from datadog_api_client.v2.model.rum_segment_reference_table import RumSegmentReferenceTable + from datadog_api_client.v2.model.rum_segment_static_entry import RumSegmentStaticEntry + from datadog_api_client.v2.model.rum_segment_template_instance import RumSegmentTemplateInstance + + return { + "combination": (str,), + "event_platforms": ([RumSegmentEventPlatform],), + "journeys": ([RumSegmentJourney],), + "reference_tables": ([RumSegmentReferenceTable],), + "static": ([RumSegmentStaticEntry],), + "templates": ([RumSegmentTemplateInstance],), + } + + attribute_map = { + "combination": "combination", + "event_platforms": "event_platforms", + "journeys": "journeys", + "reference_tables": "reference_tables", + "static": "static", + "templates": "templates", + } + + def __init__( + self_, + combination: Union[str, UnsetType] = unset, + event_platforms: Union[List[RumSegmentEventPlatform], UnsetType] = unset, + journeys: Union[List[RumSegmentJourney], UnsetType] = unset, + reference_tables: Union[List[RumSegmentReferenceTable], UnsetType] = unset, + static: Union[List[RumSegmentStaticEntry], UnsetType] = unset, + templates: Union[List[RumSegmentTemplateInstance], UnsetType] = unset, + **kwargs, + ): + """ + Query definition for the segment. Contains one or more query blocks and an optional combination formula. + + :param combination: Boolean expression combining multiple query blocks. + :type combination: str, optional + + :param event_platforms: List of event platform query blocks. + :type event_platforms: [RumSegmentEventPlatform], optional + + :param journeys: List of journey-based query blocks. + :type journeys: [RumSegmentJourney], optional + + :param reference_tables: List of reference table query blocks. + :type reference_tables: [RumSegmentReferenceTable], optional + + :param static: List of static user list blocks. + :type static: [RumSegmentStaticEntry], optional + + :param templates: List of template-based query blocks. + :type templates: [RumSegmentTemplateInstance], optional + """ + if combination is not unset: + kwargs["combination"] = combination + if event_platforms is not unset: + kwargs["event_platforms"] = event_platforms + if journeys is not unset: + kwargs["journeys"] = journeys + if reference_tables is not unset: + kwargs["reference_tables"] = reference_tables + if static is not unset: + kwargs["static"] = static + if templates is not unset: + kwargs["templates"] = templates + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/rum_segment_delete_attributes.py b/src/datadog_api_client/v2/model/rum_segment_delete_attributes.py new file mode 100644 index 0000000000..62c06937de --- /dev/null +++ b/src/datadog_api_client/v2/model/rum_segment_delete_attributes.py @@ -0,0 +1,59 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + datetime, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.rum_segment_user import RumSegmentUser + + +class RumSegmentDeleteAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.rum_segment_user import RumSegmentUser + + return { + "disabled_at": (datetime,), + "disabled_by": (RumSegmentUser,), + "name": (str,), + "uuid": (str,), + } + + attribute_map = { + "disabled_at": "disabled_at", + "disabled_by": "disabled_by", + "name": "name", + "uuid": "uuid", + } + + def __init__(self_, disabled_at: datetime, disabled_by: RumSegmentUser, name: str, uuid: str, **kwargs): + """ + Attributes of a deleted segment response. + + :param disabled_at: The timestamp when the segment was disabled in RFC 3339 format. + :type disabled_at: datetime + + :param disabled_by: A user who performed an action on a segment. + :type disabled_by: RumSegmentUser + + :param name: The name of the deleted segment. + :type name: str + + :param uuid: The unique identifier of the deleted segment. + :type uuid: str + """ + super().__init__(kwargs) + + self_.disabled_at = disabled_at + self_.disabled_by = disabled_by + self_.name = name + self_.uuid = uuid diff --git a/src/datadog_api_client/v2/model/rum_segment_delete_data.py b/src/datadog_api_client/v2/model/rum_segment_delete_data.py new file mode 100644 index 0000000000..e2676141df --- /dev/null +++ b/src/datadog_api_client/v2/model/rum_segment_delete_data.py @@ -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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.rum_segment_delete_attributes import RumSegmentDeleteAttributes + from datadog_api_client.v2.model.rum_segment_delete_type import RumSegmentDeleteType + + +class RumSegmentDeleteData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.rum_segment_delete_attributes import RumSegmentDeleteAttributes + from datadog_api_client.v2.model.rum_segment_delete_type import RumSegmentDeleteType + + return { + "attributes": (RumSegmentDeleteAttributes,), + "id": (str,), + "type": (RumSegmentDeleteType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__(self_, attributes: RumSegmentDeleteAttributes, id: str, type: RumSegmentDeleteType, **kwargs): + """ + Data object for a deleted segment response. + + :param attributes: Attributes of a deleted segment response. + :type attributes: RumSegmentDeleteAttributes + + :param id: Unique identifier for the deleted segment. + :type id: str + + :param type: Type of the deleted segment resource. + :type type: RumSegmentDeleteType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/rum_segment_delete_response.py b/src/datadog_api_client/v2/model/rum_segment_delete_response.py new file mode 100644 index 0000000000..01ccce191c --- /dev/null +++ b/src/datadog_api_client/v2/model/rum_segment_delete_response.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.rum_segment_delete_data import RumSegmentDeleteData + + +class RumSegmentDeleteResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.rum_segment_delete_data import RumSegmentDeleteData + + return { + "data": (RumSegmentDeleteData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: RumSegmentDeleteData, **kwargs): + """ + Response for a segment deletion. + + :param data: Data object for a deleted segment response. + :type data: RumSegmentDeleteData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/rum_segment_delete_type.py b/src/datadog_api_client/v2/model/rum_segment_delete_type.py new file mode 100644 index 0000000000..307ca8cf91 --- /dev/null +++ b/src/datadog_api_client/v2/model/rum_segment_delete_type.py @@ -0,0 +1,35 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class RumSegmentDeleteType(ModelSimple): + """ + Type of the deleted segment resource. + + :param value: If omitted defaults to "deleted_segment". Must be one of ["deleted_segment"]. + :type value: str + """ + + allowed_values = { + "deleted_segment", + } + DELETED_SEGMENT: ClassVar["RumSegmentDeleteType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +RumSegmentDeleteType.DELETED_SEGMENT = RumSegmentDeleteType("deleted_segment") diff --git a/src/datadog_api_client/v2/model/rum_segment_event_platform.py b/src/datadog_api_client/v2/model/rum_segment_event_platform.py new file mode 100644 index 0000000000..991b1b35a7 --- /dev/null +++ b/src/datadog_api_client/v2/model/rum_segment_event_platform.py @@ -0,0 +1,70 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class RumSegmentEventPlatform(ModelNormal): + @cached_property + def openapi_types(_): + return { + "facet": (str,), + "_from": (int,), + "name": (str,), + "query": (str,), + "to": (int,), + } + + attribute_map = { + "facet": "facet", + "_from": "from", + "name": "name", + "query": "query", + "to": "to", + } + + def __init__( + self_, + facet: str, + name: str, + query: str, + _from: Union[int, UnsetType] = unset, + to: Union[int, UnsetType] = unset, + **kwargs, + ): + """ + An event platform query block within a segment data query. + + :param facet: The facet to extract user identifiers from. + :type facet: str + + :param _from: The start of the time range in milliseconds since epoch. + :type _from: int, optional + + :param name: The name of this query block. + :type name: str + + :param query: The search query for filtering events. + :type query: str + + :param to: The end of the time range in milliseconds since epoch. + :type to: int, optional + """ + if _from is not unset: + kwargs["_from"] = _from + if to is not unset: + kwargs["to"] = to + super().__init__(kwargs) + + self_.facet = facet + self_.name = name + self_.query = query diff --git a/src/datadog_api_client/v2/model/rum_segment_journey.py b/src/datadog_api_client/v2/model/rum_segment_journey.py new file mode 100644 index 0000000000..f8147804b7 --- /dev/null +++ b/src/datadog_api_client/v2/model/rum_segment_journey.py @@ -0,0 +1,64 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class RumSegmentJourney(ModelNormal): + @cached_property + def openapi_types(_): + return { + "conversion_type": (str,), + "group_by": (str,), + "name": (str,), + "search": (str,), + } + + attribute_map = { + "conversion_type": "conversion_type", + "group_by": "group_by", + "name": "name", + "search": "search", + } + + def __init__( + self_, + conversion_type: Union[str, UnsetType] = unset, + group_by: Union[str, UnsetType] = unset, + name: Union[str, UnsetType] = unset, + search: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + A journey-based query block within a segment data query. + + :param conversion_type: The type of conversion to track. + :type conversion_type: str, optional + + :param group_by: The facet to group journey results by. + :type group_by: str, optional + + :param name: The name of this journey query block. + :type name: str, optional + + :param search: The search query for filtering events. + :type search: str, optional + """ + if conversion_type is not unset: + kwargs["conversion_type"] = conversion_type + if group_by is not unset: + kwargs["group_by"] = group_by + if name is not unset: + kwargs["name"] = name + if search is not unset: + kwargs["search"] = search + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/rum_segment_list_response.py b/src/datadog_api_client/v2/model/rum_segment_list_response.py new file mode 100644 index 0000000000..e93ceccce1 --- /dev/null +++ b/src/datadog_api_client/v2/model/rum_segment_list_response.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.rum_segment_response_data import RumSegmentResponseData + + +class RumSegmentListResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.rum_segment_response_data import RumSegmentResponseData + + return { + "data": ([RumSegmentResponseData],), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: List[RumSegmentResponseData], **kwargs): + """ + Response for listing segments. + + :param data: The list of segments. + :type data: [RumSegmentResponseData] + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/rum_segment_reference_table.py b/src/datadog_api_client/v2/model/rum_segment_reference_table.py new file mode 100644 index 0000000000..8e9169cb4b --- /dev/null +++ b/src/datadog_api_client/v2/model/rum_segment_reference_table.py @@ -0,0 +1,81 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.rum_segment_reference_table_column import RumSegmentReferenceTableColumn + from datadog_api_client.v2.model.rum_segment_reference_table_join_condition import ( + RumSegmentReferenceTableJoinCondition, + ) + + +class RumSegmentReferenceTable(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.rum_segment_reference_table_column import RumSegmentReferenceTableColumn + from datadog_api_client.v2.model.rum_segment_reference_table_join_condition import ( + RumSegmentReferenceTableJoinCondition, + ) + + return { + "columns": ([RumSegmentReferenceTableColumn],), + "filter_query": (str,), + "join_condition": (RumSegmentReferenceTableJoinCondition,), + "name": (str,), + "table_name": (str,), + } + + attribute_map = { + "columns": "columns", + "filter_query": "filter_query", + "join_condition": "join_condition", + "name": "name", + "table_name": "table_name", + } + + def __init__( + self_, + columns: List[RumSegmentReferenceTableColumn], + join_condition: RumSegmentReferenceTableJoinCondition, + name: str, + table_name: str, + filter_query: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + A reference table query block within a segment data query. + + :param columns: The columns to include from the reference table. + :type columns: [RumSegmentReferenceTableColumn] + + :param filter_query: An optional filter query for the reference table data. + :type filter_query: str, optional + + :param join_condition: The join condition for a reference table query block. + :type join_condition: RumSegmentReferenceTableJoinCondition + + :param name: The name of this query block. + :type name: str + + :param table_name: The name of the reference table. + :type table_name: str + """ + if filter_query is not unset: + kwargs["filter_query"] = filter_query + super().__init__(kwargs) + + self_.columns = columns + self_.join_condition = join_condition + self_.name = name + self_.table_name = table_name diff --git a/src/datadog_api_client/v2/model/rum_segment_reference_table_column.py b/src/datadog_api_client/v2/model/rum_segment_reference_table_column.py new file mode 100644 index 0000000000..371c1276f7 --- /dev/null +++ b/src/datadog_api_client/v2/model/rum_segment_reference_table_column.py @@ -0,0 +1,33 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class RumSegmentReferenceTableColumn(ModelNormal): + @cached_property + def openapi_types(_): + return { + "name": (str,), + } + + attribute_map = { + "name": "name", + } + + def __init__(self_, name: str, **kwargs): + """ + A column definition in a reference table query block. + + :param name: The name of the column. + :type name: str + """ + super().__init__(kwargs) + + self_.name = name diff --git a/src/datadog_api_client/v2/model/rum_segment_reference_table_join_condition.py b/src/datadog_api_client/v2/model/rum_segment_reference_table_join_condition.py new file mode 100644 index 0000000000..9c0815f8d1 --- /dev/null +++ b/src/datadog_api_client/v2/model/rum_segment_reference_table_join_condition.py @@ -0,0 +1,39 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class RumSegmentReferenceTableJoinCondition(ModelNormal): + @cached_property + def openapi_types(_): + return { + "column_name": (str,), + "facet": (str,), + } + + attribute_map = { + "column_name": "column_name", + "facet": "facet", + } + + def __init__(self_, column_name: str, facet: str, **kwargs): + """ + The join condition for a reference table query block. + + :param column_name: The reference table column to join on. + :type column_name: str + + :param facet: The RUM facet to join on. + :type facet: str + """ + super().__init__(kwargs) + + self_.column_name = column_name + self_.facet = facet diff --git a/src/datadog_api_client/v2/model/rum_segment_resource_type.py b/src/datadog_api_client/v2/model/rum_segment_resource_type.py new file mode 100644 index 0000000000..11b1f6551f --- /dev/null +++ b/src/datadog_api_client/v2/model/rum_segment_resource_type.py @@ -0,0 +1,35 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class RumSegmentResourceType(ModelSimple): + """ + Type of the segment resource. + + :param value: If omitted defaults to "segment". Must be one of ["segment"]. + :type value: str + """ + + allowed_values = { + "segment", + } + SEGMENT: ClassVar["RumSegmentResourceType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +RumSegmentResourceType.SEGMENT = RumSegmentResourceType("segment") diff --git a/src/datadog_api_client/v2/model/rum_segment_response.py b/src/datadog_api_client/v2/model/rum_segment_response.py new file mode 100644 index 0000000000..f08e510296 --- /dev/null +++ b/src/datadog_api_client/v2/model/rum_segment_response.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.rum_segment_response_data import RumSegmentResponseData + + +class RumSegmentResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.rum_segment_response_data import RumSegmentResponseData + + return { + "data": (RumSegmentResponseData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: RumSegmentResponseData, **kwargs): + """ + Response containing a single segment. + + :param data: Data object for a segment in a response. + :type data: RumSegmentResponseData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/rum_segment_response_attributes.py b/src/datadog_api_client/v2/model/rum_segment_response_attributes.py new file mode 100644 index 0000000000..55bd37ac79 --- /dev/null +++ b/src/datadog_api_client/v2/model/rum_segment_response_attributes.py @@ -0,0 +1,142 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + datetime, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.rum_segment_user import RumSegmentUser + from datadog_api_client.v2.model.rum_segment_data_query import RumSegmentDataQuery + from datadog_api_client.v2.model.rum_segment_source import RumSegmentSource + from datadog_api_client.v2.model.rum_segment_segment_type import RumSegmentSegmentType + + +class RumSegmentResponseAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.rum_segment_user import RumSegmentUser + from datadog_api_client.v2.model.rum_segment_data_query import RumSegmentDataQuery + from datadog_api_client.v2.model.rum_segment_source import RumSegmentSource + from datadog_api_client.v2.model.rum_segment_segment_type import RumSegmentSegmentType + + return { + "created_at": (datetime,), + "created_by": (RumSegmentUser,), + "data_query": (RumSegmentDataQuery,), + "description": (str,), + "modified_at": (datetime,), + "modified_by": (RumSegmentUser,), + "name": (str,), + "org_id": (int,), + "row_count": (int,), + "source": (RumSegmentSource,), + "tags": ([str],), + "type": (RumSegmentSegmentType,), + "uuid": (str,), + "version": (int,), + } + + attribute_map = { + "created_at": "created_at", + "created_by": "created_by", + "data_query": "data_query", + "description": "description", + "modified_at": "modified_at", + "modified_by": "modified_by", + "name": "name", + "org_id": "org_id", + "row_count": "row_count", + "source": "source", + "tags": "tags", + "type": "type", + "uuid": "uuid", + "version": "version", + } + + def __init__( + self_, + created_at: datetime, + created_by: RumSegmentUser, + data_query: RumSegmentDataQuery, + description: str, + modified_at: datetime, + modified_by: RumSegmentUser, + name: str, + org_id: int, + row_count: int, + source: RumSegmentSource, + tags: List[str], + type: RumSegmentSegmentType, + uuid: str, + version: int, + **kwargs, + ): + """ + Attributes of a segment in a response. + + :param created_at: The creation timestamp in RFC 3339 format. + :type created_at: datetime + + :param created_by: A user who performed an action on a segment. + :type created_by: RumSegmentUser + + :param data_query: Query definition for the segment. Contains one or more query blocks and an optional combination formula. + :type data_query: RumSegmentDataQuery + + :param description: A description of the segment. + :type description: str + + :param modified_at: The last modification timestamp in RFC 3339 format. + :type modified_at: datetime + + :param modified_by: A user who performed an action on a segment. + :type modified_by: RumSegmentUser + + :param name: The name of the segment. + :type name: str + + :param org_id: The organization identifier. + :type org_id: int + + :param row_count: The number of users in the segment. + :type row_count: int + + :param source: The source of a segment. + :type source: RumSegmentSource + + :param tags: A list of tags for the segment. + :type tags: [str] + + :param type: The type of a segment based on its data query configuration. + :type type: RumSegmentSegmentType + + :param uuid: The unique identifier of the segment. + :type uuid: str + + :param version: The version number of the segment. + :type version: int + """ + super().__init__(kwargs) + + self_.created_at = created_at + self_.created_by = created_by + self_.data_query = data_query + self_.description = description + self_.modified_at = modified_at + self_.modified_by = modified_by + self_.name = name + self_.org_id = org_id + self_.row_count = row_count + self_.source = source + self_.tags = tags + self_.type = type + self_.uuid = uuid + self_.version = version diff --git a/src/datadog_api_client/v2/model/rum_segment_response_data.py b/src/datadog_api_client/v2/model/rum_segment_response_data.py new file mode 100644 index 0000000000..b9d7fef2cb --- /dev/null +++ b/src/datadog_api_client/v2/model/rum_segment_response_data.py @@ -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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.rum_segment_response_attributes import RumSegmentResponseAttributes + from datadog_api_client.v2.model.rum_segment_resource_type import RumSegmentResourceType + + +class RumSegmentResponseData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.rum_segment_response_attributes import RumSegmentResponseAttributes + from datadog_api_client.v2.model.rum_segment_resource_type import RumSegmentResourceType + + return { + "attributes": (RumSegmentResponseAttributes,), + "id": (str,), + "type": (RumSegmentResourceType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__(self_, attributes: RumSegmentResponseAttributes, id: str, type: RumSegmentResourceType, **kwargs): + """ + Data object for a segment in a response. + + :param attributes: Attributes of a segment in a response. + :type attributes: RumSegmentResponseAttributes + + :param id: The unique identifier of the segment. + :type id: str + + :param type: Type of the segment resource. + :type type: RumSegmentResourceType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/rum_segment_segment_type.py b/src/datadog_api_client/v2/model/rum_segment_segment_type.py new file mode 100644 index 0000000000..ea95851260 --- /dev/null +++ b/src/datadog_api_client/v2/model/rum_segment_segment_type.py @@ -0,0 +1,50 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class RumSegmentSegmentType(ModelSimple): + """ + The type of a segment based on its data query configuration. + + :param value: Must be one of ["static", "event_platform", "combination", "journeys", "reference_table", "templates"]. + :type value: str + """ + + allowed_values = { + "static", + "event_platform", + "combination", + "journeys", + "reference_table", + "templates", + } + STATIC: ClassVar["RumSegmentSegmentType"] + EVENT_PLATFORM: ClassVar["RumSegmentSegmentType"] + COMBINATION: ClassVar["RumSegmentSegmentType"] + JOURNEYS: ClassVar["RumSegmentSegmentType"] + REFERENCE_TABLE: ClassVar["RumSegmentSegmentType"] + TEMPLATES: ClassVar["RumSegmentSegmentType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +RumSegmentSegmentType.STATIC = RumSegmentSegmentType("static") +RumSegmentSegmentType.EVENT_PLATFORM = RumSegmentSegmentType("event_platform") +RumSegmentSegmentType.COMBINATION = RumSegmentSegmentType("combination") +RumSegmentSegmentType.JOURNEYS = RumSegmentSegmentType("journeys") +RumSegmentSegmentType.REFERENCE_TABLE = RumSegmentSegmentType("reference_table") +RumSegmentSegmentType.TEMPLATES = RumSegmentSegmentType("templates") diff --git a/src/datadog_api_client/v2/model/rum_segment_source.py b/src/datadog_api_client/v2/model/rum_segment_source.py new file mode 100644 index 0000000000..195b5c0efb --- /dev/null +++ b/src/datadog_api_client/v2/model/rum_segment_source.py @@ -0,0 +1,38 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class RumSegmentSource(ModelSimple): + """ + The source of a segment. + + :param value: Must be one of ["user_created", "initial"]. + :type value: str + """ + + allowed_values = { + "user_created", + "initial", + } + USER_CREATED: ClassVar["RumSegmentSource"] + INITIAL: ClassVar["RumSegmentSource"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +RumSegmentSource.USER_CREATED = RumSegmentSource("user_created") +RumSegmentSource.INITIAL = RumSegmentSource("initial") diff --git a/src/datadog_api_client/v2/model/rum_segment_static_entry.py b/src/datadog_api_client/v2/model/rum_segment_static_entry.py new file mode 100644 index 0000000000..9a7b703ecd --- /dev/null +++ b/src/datadog_api_client/v2/model/rum_segment_static_entry.py @@ -0,0 +1,45 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class RumSegmentStaticEntry(ModelNormal): + @cached_property + def openapi_types(_): + return { + "id": (str,), + "name": (str,), + "user_count": (int,), + } + + attribute_map = { + "id": "id", + "name": "name", + "user_count": "user_count", + } + + def __init__(self_, id: str, name: str, user_count: int, **kwargs): + """ + A static user list entry within a segment data query. + + :param id: The identifier of the static list. + :type id: str + + :param name: The name of the static list. + :type name: str + + :param user_count: The number of users in the static list. + :type user_count: int + """ + super().__init__(kwargs) + + self_.id = id + self_.name = name + self_.user_count = user_count diff --git a/src/datadog_api_client/v2/model/rum_segment_template_instance.py b/src/datadog_api_client/v2/model/rum_segment_template_instance.py new file mode 100644 index 0000000000..e3107228c6 --- /dev/null +++ b/src/datadog_api_client/v2/model/rum_segment_template_instance.py @@ -0,0 +1,64 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Dict, Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class RumSegmentTemplateInstance(ModelNormal): + @cached_property + def openapi_types(_): + return { + "_from": (int,), + "parameters": ({str: (str,)},), + "template_id": (str,), + "to": (int,), + } + + attribute_map = { + "_from": "from", + "parameters": "parameters", + "template_id": "template_id", + "to": "to", + } + + def __init__( + self_, + template_id: str, + _from: Union[int, UnsetType] = unset, + parameters: Union[Dict[str, str], UnsetType] = unset, + to: Union[int, UnsetType] = unset, + **kwargs, + ): + """ + A template-based query block within a segment data query. + + :param _from: The start of the time range in milliseconds since epoch. + :type _from: int, optional + + :param parameters: The template parameters as key-value pairs. + :type parameters: {str: (str,)}, optional + + :param template_id: The identifier of the template. + :type template_id: str + + :param to: The end of the time range in milliseconds since epoch. + :type to: int, optional + """ + if _from is not unset: + kwargs["_from"] = _from + if parameters is not unset: + kwargs["parameters"] = parameters + if to is not unset: + kwargs["to"] = to + super().__init__(kwargs) + + self_.template_id = template_id diff --git a/src/datadog_api_client/v2/model/rum_segment_template_list_response.py b/src/datadog_api_client/v2/model/rum_segment_template_list_response.py new file mode 100644 index 0000000000..d8ec9ec850 --- /dev/null +++ b/src/datadog_api_client/v2/model/rum_segment_template_list_response.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.rum_segment_template_response_data import RumSegmentTemplateResponseData + + +class RumSegmentTemplateListResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.rum_segment_template_response_data import RumSegmentTemplateResponseData + + return { + "data": ([RumSegmentTemplateResponseData],), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: List[RumSegmentTemplateResponseData], **kwargs): + """ + Response for listing segment templates. + + :param data: The list of segment templates. + :type data: [RumSegmentTemplateResponseData] + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/rum_segment_template_parameter_def.py b/src/datadog_api_client/v2/model/rum_segment_template_parameter_def.py new file mode 100644 index 0000000000..473aba01b8 --- /dev/null +++ b/src/datadog_api_client/v2/model/rum_segment_template_parameter_def.py @@ -0,0 +1,45 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class RumSegmentTemplateParameterDef(ModelNormal): + @cached_property + def openapi_types(_): + return { + "default": (str,), + "description": (str,), + "validate": (str,), + } + + attribute_map = { + "default": "default", + "description": "description", + "validate": "validate", + } + + def __init__(self_, default: str, description: str, validate: str, **kwargs): + """ + A parameter definition for a segment template. + + :param default: The default value for the parameter. + :type default: str + + :param description: A description of the parameter. + :type description: str + + :param validate: Validation rules for the parameter. + :type validate: str + """ + super().__init__(kwargs) + + self_.default = default + self_.description = description + self_.validate = validate diff --git a/src/datadog_api_client/v2/model/rum_segment_template_resource_type.py b/src/datadog_api_client/v2/model/rum_segment_template_resource_type.py new file mode 100644 index 0000000000..da56429361 --- /dev/null +++ b/src/datadog_api_client/v2/model/rum_segment_template_resource_type.py @@ -0,0 +1,35 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class RumSegmentTemplateResourceType(ModelSimple): + """ + Type of the segment template resource. + + :param value: If omitted defaults to "template_metadata". Must be one of ["template_metadata"]. + :type value: str + """ + + allowed_values = { + "template_metadata", + } + TEMPLATE_METADATA: ClassVar["RumSegmentTemplateResourceType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +RumSegmentTemplateResourceType.TEMPLATE_METADATA = RumSegmentTemplateResourceType("template_metadata") diff --git a/src/datadog_api_client/v2/model/rum_segment_template_response_attributes.py b/src/datadog_api_client/v2/model/rum_segment_template_response_attributes.py new file mode 100644 index 0000000000..fb106a339f --- /dev/null +++ b/src/datadog_api_client/v2/model/rum_segment_template_response_attributes.py @@ -0,0 +1,96 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Dict, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + datetime, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.rum_segment_template_parameter_def import RumSegmentTemplateParameterDef + from datadog_api_client.v2.model.rum_segment_template_status import RumSegmentTemplateStatus + + +class RumSegmentTemplateResponseAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.rum_segment_template_parameter_def import RumSegmentTemplateParameterDef + from datadog_api_client.v2.model.rum_segment_template_status import RumSegmentTemplateStatus + + return { + "category": (str,), + "created_at": (datetime,), + "description": (str,), + "modified_at": (datetime,), + "name": (str,), + "parameters": ({str: (RumSegmentTemplateParameterDef,)},), + "status": (RumSegmentTemplateStatus,), + "version": (int,), + } + + attribute_map = { + "category": "category", + "created_at": "created_at", + "description": "description", + "modified_at": "modified_at", + "name": "name", + "parameters": "parameters", + "status": "status", + "version": "version", + } + + def __init__( + self_, + category: str, + created_at: datetime, + description: str, + modified_at: datetime, + name: str, + parameters: Dict[str, RumSegmentTemplateParameterDef], + status: RumSegmentTemplateStatus, + version: int, + **kwargs, + ): + """ + Attributes of a segment template in a response. + + :param category: The category of the template. + :type category: str + + :param created_at: The creation timestamp in RFC 3339 format. + :type created_at: datetime + + :param description: A description of the template. + :type description: str + + :param modified_at: The last modification timestamp in RFC 3339 format. + :type modified_at: datetime + + :param name: The name of the template. + :type name: str + + :param parameters: The template parameter definitions. + :type parameters: {str: (RumSegmentTemplateParameterDef,)} + + :param status: The status of a segment template. + :type status: RumSegmentTemplateStatus + + :param version: The version number of the template. + :type version: int + """ + super().__init__(kwargs) + + self_.category = category + self_.created_at = created_at + self_.description = description + self_.modified_at = modified_at + self_.name = name + self_.parameters = parameters + self_.status = status + self_.version = version diff --git a/src/datadog_api_client/v2/model/rum_segment_template_response_data.py b/src/datadog_api_client/v2/model/rum_segment_template_response_data.py new file mode 100644 index 0000000000..584643cd9c --- /dev/null +++ b/src/datadog_api_client/v2/model/rum_segment_template_response_data.py @@ -0,0 +1,60 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.rum_segment_template_response_attributes import ( + RumSegmentTemplateResponseAttributes, + ) + from datadog_api_client.v2.model.rum_segment_template_resource_type import RumSegmentTemplateResourceType + + +class RumSegmentTemplateResponseData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.rum_segment_template_response_attributes import ( + RumSegmentTemplateResponseAttributes, + ) + from datadog_api_client.v2.model.rum_segment_template_resource_type import RumSegmentTemplateResourceType + + return { + "attributes": (RumSegmentTemplateResponseAttributes,), + "id": (str,), + "type": (RumSegmentTemplateResourceType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, attributes: RumSegmentTemplateResponseAttributes, id: str, type: RumSegmentTemplateResourceType, **kwargs + ): + """ + Data object for a segment template in a response. + + :param attributes: Attributes of a segment template in a response. + :type attributes: RumSegmentTemplateResponseAttributes + + :param id: The unique identifier of the template. + :type id: str + + :param type: Type of the segment template resource. + :type type: RumSegmentTemplateResourceType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/rum_segment_template_status.py b/src/datadog_api_client/v2/model/rum_segment_template_status.py new file mode 100644 index 0000000000..a526fe9afb --- /dev/null +++ b/src/datadog_api_client/v2/model/rum_segment_template_status.py @@ -0,0 +1,41 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class RumSegmentTemplateStatus(ModelSimple): + """ + The status of a segment template. + + :param value: Must be one of ["active", "deprecated", "archived"]. + :type value: str + """ + + allowed_values = { + "active", + "deprecated", + "archived", + } + ACTIVE: ClassVar["RumSegmentTemplateStatus"] + DEPRECATED: ClassVar["RumSegmentTemplateStatus"] + ARCHIVED: ClassVar["RumSegmentTemplateStatus"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +RumSegmentTemplateStatus.ACTIVE = RumSegmentTemplateStatus("active") +RumSegmentTemplateStatus.DEPRECATED = RumSegmentTemplateStatus("deprecated") +RumSegmentTemplateStatus.ARCHIVED = RumSegmentTemplateStatus("archived") diff --git a/src/datadog_api_client/v2/model/rum_segment_update_attributes.py b/src/datadog_api_client/v2/model/rum_segment_update_attributes.py new file mode 100644 index 0000000000..c5f597ac1e --- /dev/null +++ b/src/datadog_api_client/v2/model/rum_segment_update_attributes.py @@ -0,0 +1,70 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.rum_segment_data_query import RumSegmentDataQuery + + +class RumSegmentUpdateAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.rum_segment_data_query import RumSegmentDataQuery + + return { + "data_query": (RumSegmentDataQuery,), + "description": (str,), + "name": (str,), + "tags": ([str],), + } + + attribute_map = { + "data_query": "data_query", + "description": "description", + "name": "name", + "tags": "tags", + } + + def __init__( + self_, + data_query: Union[RumSegmentDataQuery, UnsetType] = unset, + description: Union[str, UnsetType] = unset, + name: Union[str, UnsetType] = unset, + tags: Union[List[str], UnsetType] = unset, + **kwargs, + ): + """ + Attributes for updating a segment. All fields are optional. + + :param data_query: Query definition for the segment. Contains one or more query blocks and an optional combination formula. + :type data_query: RumSegmentDataQuery, optional + + :param description: The updated description of the segment. + :type description: str, optional + + :param name: The updated name of the segment. + :type name: str, optional + + :param tags: The updated list of tags for the segment. + :type tags: [str], optional + """ + if data_query is not unset: + kwargs["data_query"] = data_query + if description is not unset: + kwargs["description"] = description + if name is not unset: + kwargs["name"] = name + if tags is not unset: + kwargs["tags"] = tags + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/rum_segment_update_data.py b/src/datadog_api_client/v2/model/rum_segment_update_data.py new file mode 100644 index 0000000000..8dc0d55619 --- /dev/null +++ b/src/datadog_api_client/v2/model/rum_segment_update_data.py @@ -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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.rum_segment_update_attributes import RumSegmentUpdateAttributes + from datadog_api_client.v2.model.rum_segment_resource_type import RumSegmentResourceType + + +class RumSegmentUpdateData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.rum_segment_update_attributes import RumSegmentUpdateAttributes + from datadog_api_client.v2.model.rum_segment_resource_type import RumSegmentResourceType + + return { + "attributes": (RumSegmentUpdateAttributes,), + "id": (str,), + "type": (RumSegmentResourceType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__(self_, attributes: RumSegmentUpdateAttributes, id: str, type: RumSegmentResourceType, **kwargs): + """ + Data object for a segment update request. + + :param attributes: Attributes for updating a segment. All fields are optional. + :type attributes: RumSegmentUpdateAttributes + + :param id: The identifier of the segment to update. + :type id: str + + :param type: Type of the segment resource. + :type type: RumSegmentResourceType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/rum_segment_update_request.py b/src/datadog_api_client/v2/model/rum_segment_update_request.py new file mode 100644 index 0000000000..efd16eee83 --- /dev/null +++ b/src/datadog_api_client/v2/model/rum_segment_update_request.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.rum_segment_update_data import RumSegmentUpdateData + + +class RumSegmentUpdateRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.rum_segment_update_data import RumSegmentUpdateData + + return { + "data": (RumSegmentUpdateData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: RumSegmentUpdateData, **kwargs): + """ + Request body for updating a segment. + + :param data: Data object for a segment update request. + :type data: RumSegmentUpdateData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/rum_segment_user.py b/src/datadog_api_client/v2/model/rum_segment_user.py new file mode 100644 index 0000000000..c258363eda --- /dev/null +++ b/src/datadog_api_client/v2/model/rum_segment_user.py @@ -0,0 +1,57 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class RumSegmentUser(ModelNormal): + @cached_property + def openapi_types(_): + return { + "handle": (str,), + "icon": (str,), + "id": (str,), + "name": (str,), + "uuid": (str,), + } + + attribute_map = { + "handle": "handle", + "icon": "icon", + "id": "id", + "name": "name", + "uuid": "uuid", + } + + def __init__(self_, handle: str, icon: str, id: str, name: str, uuid: str, **kwargs): + """ + A user who performed an action on a segment. + + :param handle: The email handle of the user. + :type handle: str + + :param icon: The URL of the user icon. + :type icon: str + + :param id: The numeric identifier of the user. + :type id: str + + :param name: The display name of the user. + :type name: str + + :param uuid: The unique identifier of the user. + :type uuid: str + """ + super().__init__(kwargs) + + self_.handle = handle + self_.icon = icon + self_.id = id + self_.name = name + self_.uuid = uuid diff --git a/src/datadog_api_client/v2/model/rum_static_segment_create_attributes.py b/src/datadog_api_client/v2/model/rum_static_segment_create_attributes.py new file mode 100644 index 0000000000..3a9b542db1 --- /dev/null +++ b/src/datadog_api_client/v2/model/rum_static_segment_create_attributes.py @@ -0,0 +1,70 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.rum_static_segment_journey_query_object import RumStaticSegmentJourneyQueryObject + + +class RumStaticSegmentCreateAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.rum_static_segment_journey_query_object import ( + RumStaticSegmentJourneyQueryObject, + ) + + return { + "description": (str,), + "journey_query_object": (RumStaticSegmentJourneyQueryObject,), + "name": (str,), + "tags": ([str],), + } + + attribute_map = { + "description": "description", + "journey_query_object": "journey_query_object", + "name": "name", + "tags": "tags", + } + + def __init__( + self_, + description: str, + journey_query_object: RumStaticSegmentJourneyQueryObject, + name: str, + tags: Union[List[str], UnsetType] = unset, + **kwargs, + ): + """ + Attributes for creating a new static segment. + + :param description: A description of the static segment. + :type description: str + + :param journey_query_object: The journey query object used to compute the static segment user list. + :type journey_query_object: RumStaticSegmentJourneyQueryObject + + :param name: The name of the static segment. + :type name: str + + :param tags: A list of tags for the static segment. + :type tags: [str], optional + """ + if tags is not unset: + kwargs["tags"] = tags + super().__init__(kwargs) + + self_.description = description + self_.journey_query_object = journey_query_object + self_.name = name diff --git a/src/datadog_api_client/v2/model/rum_static_segment_create_data.py b/src/datadog_api_client/v2/model/rum_static_segment_create_data.py new file mode 100644 index 0000000000..e5615aaf23 --- /dev/null +++ b/src/datadog_api_client/v2/model/rum_static_segment_create_data.py @@ -0,0 +1,48 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.rum_static_segment_create_attributes import RumStaticSegmentCreateAttributes + from datadog_api_client.v2.model.rum_static_segment_request_type import RumStaticSegmentRequestType + + +class RumStaticSegmentCreateData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.rum_static_segment_create_attributes import RumStaticSegmentCreateAttributes + from datadog_api_client.v2.model.rum_static_segment_request_type import RumStaticSegmentRequestType + + return { + "attributes": (RumStaticSegmentCreateAttributes,), + "type": (RumStaticSegmentRequestType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__(self_, attributes: RumStaticSegmentCreateAttributes, type: RumStaticSegmentRequestType, **kwargs): + """ + Data object for a static segment creation request. + + :param attributes: Attributes for creating a new static segment. + :type attributes: RumStaticSegmentCreateAttributes + + :param type: Type of the static segment creation request resource. + :type type: RumStaticSegmentRequestType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/model/rum_static_segment_create_request.py b/src/datadog_api_client/v2/model/rum_static_segment_create_request.py new file mode 100644 index 0000000000..f3853ef014 --- /dev/null +++ b/src/datadog_api_client/v2/model/rum_static_segment_create_request.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.rum_static_segment_create_data import RumStaticSegmentCreateData + + +class RumStaticSegmentCreateRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.rum_static_segment_create_data import RumStaticSegmentCreateData + + return { + "data": (RumStaticSegmentCreateData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: RumStaticSegmentCreateData, **kwargs): + """ + Request body for creating a new static segment. + + :param data: Data object for a static segment creation request. + :type data: RumStaticSegmentCreateData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/rum_static_segment_journey_filter.py b/src/datadog_api_client/v2/model/rum_static_segment_journey_filter.py new file mode 100644 index 0000000000..69c16b4925 --- /dev/null +++ b/src/datadog_api_client/v2/model/rum_static_segment_journey_filter.py @@ -0,0 +1,39 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class RumStaticSegmentJourneyFilter(ModelNormal): + @cached_property + def openapi_types(_): + return { + "attribute": (str,), + "value": (str,), + } + + attribute_map = { + "attribute": "attribute", + "value": "value", + } + + def __init__(self_, attribute: str, value: str, **kwargs): + """ + A filter within a journey query node. + + :param attribute: The attribute to filter on. + :type attribute: str + + :param value: The value to match. + :type value: str + """ + super().__init__(kwargs) + + self_.attribute = attribute + self_.value = value diff --git a/src/datadog_api_client/v2/model/rum_static_segment_journey_node.py b/src/datadog_api_client/v2/model/rum_static_segment_journey_node.py new file mode 100644 index 0000000000..c0867f4310 --- /dev/null +++ b/src/datadog_api_client/v2/model/rum_static_segment_journey_node.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.rum_static_segment_journey_filter import RumStaticSegmentJourneyFilter + + +class RumStaticSegmentJourneyNode(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.rum_static_segment_journey_filter import RumStaticSegmentJourneyFilter + + return { + "filters": ([RumStaticSegmentJourneyFilter],), + } + + attribute_map = { + "filters": "filters", + } + + def __init__(self_, filters: List[RumStaticSegmentJourneyFilter], **kwargs): + """ + A node in a journey query object. + + :param filters: The list of filters for this node. + :type filters: [RumStaticSegmentJourneyFilter] + """ + super().__init__(kwargs) + + self_.filters = filters diff --git a/src/datadog_api_client/v2/model/rum_static_segment_journey_query_object.py b/src/datadog_api_client/v2/model/rum_static_segment_journey_query_object.py new file mode 100644 index 0000000000..6e82e8cb95 --- /dev/null +++ b/src/datadog_api_client/v2/model/rum_static_segment_journey_query_object.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.rum_static_segment_journey_node import RumStaticSegmentJourneyNode + + +class RumStaticSegmentJourneyQueryObject(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.rum_static_segment_journey_node import RumStaticSegmentJourneyNode + + return { + "nodes": ([RumStaticSegmentJourneyNode],), + } + + attribute_map = { + "nodes": "nodes", + } + + def __init__(self_, nodes: List[RumStaticSegmentJourneyNode], **kwargs): + """ + The journey query object used to compute the static segment user list. + + :param nodes: The list of journey nodes defining the query. + :type nodes: [RumStaticSegmentJourneyNode] + """ + super().__init__(kwargs) + + self_.nodes = nodes diff --git a/src/datadog_api_client/v2/model/rum_static_segment_request_type.py b/src/datadog_api_client/v2/model/rum_static_segment_request_type.py new file mode 100644 index 0000000000..62b4148e89 --- /dev/null +++ b/src/datadog_api_client/v2/model/rum_static_segment_request_type.py @@ -0,0 +1,35 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class RumStaticSegmentRequestType(ModelSimple): + """ + Type of the static segment creation request resource. + + :param value: If omitted defaults to "create_static_segment_request". Must be one of ["create_static_segment_request"]. + :type value: str + """ + + allowed_values = { + "create_static_segment_request", + } + CREATE_STATIC_SEGMENT_REQUEST: ClassVar["RumStaticSegmentRequestType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +RumStaticSegmentRequestType.CREATE_STATIC_SEGMENT_REQUEST = RumStaticSegmentRequestType("create_static_segment_request") diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index f1336c27f5..66cc442978 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -4551,6 +4551,45 @@ from datadog_api_client.v2.model.rum_retention_filters_order_request import RumRetentionFiltersOrderRequest from datadog_api_client.v2.model.rum_retention_filters_order_response import RumRetentionFiltersOrderResponse from datadog_api_client.v2.model.rum_retention_filters_response import RumRetentionFiltersResponse +from datadog_api_client.v2.model.rum_segment_create_attributes import RumSegmentCreateAttributes +from datadog_api_client.v2.model.rum_segment_create_data import RumSegmentCreateData +from datadog_api_client.v2.model.rum_segment_create_request import RumSegmentCreateRequest +from datadog_api_client.v2.model.rum_segment_data_query import RumSegmentDataQuery +from datadog_api_client.v2.model.rum_segment_delete_attributes import RumSegmentDeleteAttributes +from datadog_api_client.v2.model.rum_segment_delete_data import RumSegmentDeleteData +from datadog_api_client.v2.model.rum_segment_delete_response import RumSegmentDeleteResponse +from datadog_api_client.v2.model.rum_segment_delete_type import RumSegmentDeleteType +from datadog_api_client.v2.model.rum_segment_event_platform import RumSegmentEventPlatform +from datadog_api_client.v2.model.rum_segment_journey import RumSegmentJourney +from datadog_api_client.v2.model.rum_segment_list_response import RumSegmentListResponse +from datadog_api_client.v2.model.rum_segment_reference_table import RumSegmentReferenceTable +from datadog_api_client.v2.model.rum_segment_reference_table_column import RumSegmentReferenceTableColumn +from datadog_api_client.v2.model.rum_segment_reference_table_join_condition import RumSegmentReferenceTableJoinCondition +from datadog_api_client.v2.model.rum_segment_resource_type import RumSegmentResourceType +from datadog_api_client.v2.model.rum_segment_response import RumSegmentResponse +from datadog_api_client.v2.model.rum_segment_response_attributes import RumSegmentResponseAttributes +from datadog_api_client.v2.model.rum_segment_response_data import RumSegmentResponseData +from datadog_api_client.v2.model.rum_segment_segment_type import RumSegmentSegmentType +from datadog_api_client.v2.model.rum_segment_source import RumSegmentSource +from datadog_api_client.v2.model.rum_segment_static_entry import RumSegmentStaticEntry +from datadog_api_client.v2.model.rum_segment_template_instance import RumSegmentTemplateInstance +from datadog_api_client.v2.model.rum_segment_template_list_response import RumSegmentTemplateListResponse +from datadog_api_client.v2.model.rum_segment_template_parameter_def import RumSegmentTemplateParameterDef +from datadog_api_client.v2.model.rum_segment_template_resource_type import RumSegmentTemplateResourceType +from datadog_api_client.v2.model.rum_segment_template_response_attributes import RumSegmentTemplateResponseAttributes +from datadog_api_client.v2.model.rum_segment_template_response_data import RumSegmentTemplateResponseData +from datadog_api_client.v2.model.rum_segment_template_status import RumSegmentTemplateStatus +from datadog_api_client.v2.model.rum_segment_update_attributes import RumSegmentUpdateAttributes +from datadog_api_client.v2.model.rum_segment_update_data import RumSegmentUpdateData +from datadog_api_client.v2.model.rum_segment_update_request import RumSegmentUpdateRequest +from datadog_api_client.v2.model.rum_segment_user import RumSegmentUser +from datadog_api_client.v2.model.rum_static_segment_create_attributes import RumStaticSegmentCreateAttributes +from datadog_api_client.v2.model.rum_static_segment_create_data import RumStaticSegmentCreateData +from datadog_api_client.v2.model.rum_static_segment_create_request import RumStaticSegmentCreateRequest +from datadog_api_client.v2.model.rum_static_segment_journey_filter import RumStaticSegmentJourneyFilter +from datadog_api_client.v2.model.rum_static_segment_journey_node import RumStaticSegmentJourneyNode +from datadog_api_client.v2.model.rum_static_segment_journey_query_object import RumStaticSegmentJourneyQueryObject +from datadog_api_client.v2.model.rum_static_segment_request_type import RumStaticSegmentRequestType from datadog_api_client.v2.model.run_threat_hunting_job_request import RunThreatHuntingJobRequest from datadog_api_client.v2.model.run_threat_hunting_job_request_attributes import RunThreatHuntingJobRequestAttributes from datadog_api_client.v2.model.run_threat_hunting_job_request_data import RunThreatHuntingJobRequestData @@ -9310,6 +9349,45 @@ "RumRetentionFiltersOrderRequest", "RumRetentionFiltersOrderResponse", "RumRetentionFiltersResponse", + "RumSegmentCreateAttributes", + "RumSegmentCreateData", + "RumSegmentCreateRequest", + "RumSegmentDataQuery", + "RumSegmentDeleteAttributes", + "RumSegmentDeleteData", + "RumSegmentDeleteResponse", + "RumSegmentDeleteType", + "RumSegmentEventPlatform", + "RumSegmentJourney", + "RumSegmentListResponse", + "RumSegmentReferenceTable", + "RumSegmentReferenceTableColumn", + "RumSegmentReferenceTableJoinCondition", + "RumSegmentResourceType", + "RumSegmentResponse", + "RumSegmentResponseAttributes", + "RumSegmentResponseData", + "RumSegmentSegmentType", + "RumSegmentSource", + "RumSegmentStaticEntry", + "RumSegmentTemplateInstance", + "RumSegmentTemplateListResponse", + "RumSegmentTemplateParameterDef", + "RumSegmentTemplateResourceType", + "RumSegmentTemplateResponseAttributes", + "RumSegmentTemplateResponseData", + "RumSegmentTemplateStatus", + "RumSegmentUpdateAttributes", + "RumSegmentUpdateData", + "RumSegmentUpdateRequest", + "RumSegmentUser", + "RumStaticSegmentCreateAttributes", + "RumStaticSegmentCreateData", + "RumStaticSegmentCreateRequest", + "RumStaticSegmentJourneyFilter", + "RumStaticSegmentJourneyNode", + "RumStaticSegmentJourneyQueryObject", + "RumStaticSegmentRequestType", "RunThreatHuntingJobRequest", "RunThreatHuntingJobRequestAttributes", "RunThreatHuntingJobRequestData", diff --git a/tests/v2/features/rum_user_segments.feature b/tests/v2/features/rum_user_segments.feature new file mode 100644 index 0000000000..7a6305c6e0 --- /dev/null +++ b/tests/v2/features/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/tests/v2/features/undo.json b/tests/v2/features/undo.json index 2f0af9dca7..6514777da2 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/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": {