diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index b9a63afce0a..59e19780a68 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -51317,6 +51317,713 @@ components: $ref: '#/components/schemas/RumRetentionFilterData' type: array type: object + RumSegmentCreateAttributes: + description: Attributes for creating a new segment. + properties: + data_query: + $ref: '#/components/schemas/RumSegmentDataQuery' + description: + description: A description of the segment. + example: Users who visited the homepage. + type: string + name: + description: The name of the segment. + example: My Segment + type: string + tags: + description: A list of tags for the segment. + example: + - team:frontend + items: + type: string + type: array + required: + - name + - data_query + type: object + RumSegmentCreateData: + description: Data object for a segment creation request. + properties: + attributes: + $ref: '#/components/schemas/RumSegmentCreateAttributes' + type: + $ref: '#/components/schemas/RumSegmentResourceType' + required: + - type + - attributes + type: object + RumSegmentCreateRequest: + description: Request body for creating a new segment. + properties: + data: + $ref: '#/components/schemas/RumSegmentCreateData' + required: + - data + type: object + RumSegmentDataQuery: + description: Query definition for the segment. Contains one or more query blocks + and an optional combination formula. + properties: + combination: + description: Boolean expression combining multiple query blocks. + example: (logs && apm_home) && NOT(apm_trace) + type: string + event_platforms: + description: List of event platform query blocks. + items: + $ref: '#/components/schemas/RumSegmentEventPlatform' + type: array + journeys: + description: List of journey-based query blocks. + items: + $ref: '#/components/schemas/RumSegmentJourney' + type: array + reference_tables: + description: List of reference table query blocks. + items: + $ref: '#/components/schemas/RumSegmentReferenceTable' + type: array + static: + description: List of static user list blocks. + items: + $ref: '#/components/schemas/RumSegmentStaticEntry' + type: array + templates: + description: List of template-based query blocks. + items: + $ref: '#/components/schemas/RumSegmentTemplateInstance' + type: array + type: object + RumSegmentDeleteAttributes: + description: Attributes of a deleted segment response. + properties: + disabled_at: + description: The timestamp when the segment was disabled in RFC 3339 format. + example: '2024-03-15T10:30:00Z' + format: date-time + type: string + disabled_by: + $ref: '#/components/schemas/RumSegmentUser' + name: + description: The name of the deleted segment. + example: My Segment + type: string + uuid: + description: The unique identifier of the deleted segment. + example: a1b2c3d4-1234-5678-9abc-123456789abc + type: string + required: + - uuid + - name + - disabled_at + - disabled_by + type: object + RumSegmentDeleteData: + description: Data object for a deleted segment response. + properties: + attributes: + $ref: '#/components/schemas/RumSegmentDeleteAttributes' + id: + description: Unique identifier for the deleted segment. + example: a1b2c3d4-1234-5678-9abc-123456789abc + type: string + type: + $ref: '#/components/schemas/RumSegmentDeleteType' + required: + - id + - type + - attributes + type: object + RumSegmentDeleteResponse: + description: Response for a segment deletion. + properties: + data: + $ref: '#/components/schemas/RumSegmentDeleteData' + required: + - data + type: object + RumSegmentDeleteType: + description: Type of the deleted segment resource. + enum: + - deleted_segment + example: deleted_segment + type: string + x-enum-varnames: + - DELETED_SEGMENT + RumSegmentEventPlatform: + description: An event platform query block within a segment data query. + properties: + facet: + description: The facet to extract user identifiers from. + example: '@usr.id' + type: string + from: + description: The start of the time range in milliseconds since epoch. + example: 1709888355000 + format: int64 + type: integer + name: + description: The name of this query block. + example: logs + type: string + query: + description: The search query for filtering events. + example: '@type:view @view.url_path:/logs' + type: string + to: + description: The end of the time range in milliseconds since epoch. + example: 1710493155000 + format: int64 + type: integer + required: + - name + - query + - facet + type: object + RumSegmentJourney: + description: A journey-based query block within a segment data query. + properties: + conversion_type: + description: The type of conversion to track. + example: any + type: string + group_by: + description: The facet to group journey results by. + example: '@usr.id' + type: string + name: + description: The name of this journey query block. + example: my_journey + type: string + search: + description: The search query for filtering events. + example: '@type:view' + type: string + type: object + RumSegmentListResponse: + description: Response for listing segments. + properties: + data: + description: The list of segments. + items: + $ref: '#/components/schemas/RumSegmentResponseData' + type: array + required: + - data + type: object + RumSegmentReferenceTable: + description: A reference table query block within a segment data query. + properties: + columns: + description: The columns to include from the reference table. + items: + $ref: '#/components/schemas/RumSegmentReferenceTableColumn' + type: array + filter_query: + description: An optional filter query for the reference table data. + example: '' + type: string + join_condition: + $ref: '#/components/schemas/RumSegmentReferenceTableJoinCondition' + name: + description: The name of this query block. + example: my_ref_table + type: string + table_name: + description: The name of the reference table. + example: my_table + type: string + required: + - name + - table_name + - columns + - join_condition + type: object + RumSegmentReferenceTableColumn: + description: A column definition in a reference table query block. + properties: + name: + description: The name of the column. + example: user_id + type: string + required: + - name + type: object + RumSegmentReferenceTableJoinCondition: + description: The join condition for a reference table query block. + properties: + column_name: + description: The reference table column to join on. + example: user_id + type: string + facet: + description: The RUM facet to join on. + example: '@usr.id' + type: string + required: + - facet + - column_name + type: object + RumSegmentResourceType: + description: Type of the segment resource. + enum: + - segment + example: segment + type: string + x-enum-varnames: + - SEGMENT + RumSegmentResponse: + description: Response containing a single segment. + properties: + data: + $ref: '#/components/schemas/RumSegmentResponseData' + required: + - data + type: object + RumSegmentResponseAttributes: + description: Attributes of a segment in a response. + properties: + created_at: + description: The creation timestamp in RFC 3339 format. + example: '2024-03-15T10:30:00Z' + format: date-time + type: string + created_by: + $ref: '#/components/schemas/RumSegmentUser' + data_query: + $ref: '#/components/schemas/RumSegmentDataQuery' + description: + description: A description of the segment. + example: Users who visited the homepage. + type: string + modified_at: + description: The last modification timestamp in RFC 3339 format. + example: '2024-03-15T10:30:00Z' + format: date-time + type: string + modified_by: + $ref: '#/components/schemas/RumSegmentUser' + name: + description: The name of the segment. + example: My Segment + type: string + org_id: + description: The organization identifier. + example: 123456 + format: int64 + type: integer + row_count: + description: The number of users in the segment. + example: 500 + format: int64 + type: integer + source: + $ref: '#/components/schemas/RumSegmentSource' + tags: + description: A list of tags for the segment. + example: + - team:frontend + items: + type: string + type: array + type: + $ref: '#/components/schemas/RumSegmentSegmentType' + uuid: + description: The unique identifier of the segment. + example: a1b2c3d4-1234-5678-9abc-123456789abc + type: string + version: + description: The version number of the segment. + example: 1 + format: int64 + type: integer + required: + - uuid + - org_id + - name + - description + - data_query + - created_by + - modified_by + - created_at + - modified_at + - row_count + - version + - tags + - type + - source + type: object + RumSegmentResponseData: + description: Data object for a segment in a response. + properties: + attributes: + $ref: '#/components/schemas/RumSegmentResponseAttributes' + id: + description: The unique identifier of the segment. + example: a1b2c3d4-1234-5678-9abc-123456789abc + type: string + type: + $ref: '#/components/schemas/RumSegmentResourceType' + required: + - id + - type + - attributes + type: object + RumSegmentSegmentType: + description: The type of a segment based on its data query configuration. + enum: + - static + - event_platform + - combination + - journeys + - reference_table + - templates + example: event_platform + type: string + x-enum-varnames: + - STATIC + - EVENT_PLATFORM + - COMBINATION + - JOURNEYS + - REFERENCE_TABLE + - TEMPLATES + RumSegmentSource: + description: The source of a segment. + enum: + - user_created + - initial + example: user_created + type: string + x-enum-varnames: + - USER_CREATED + - INITIAL + RumSegmentStaticEntry: + description: A static user list entry within a segment data query. + properties: + id: + description: The identifier of the static list. + example: static-list-1 + type: string + name: + description: The name of the static list. + example: My Static List + type: string + user_count: + description: The number of users in the static list. + example: 500 + format: int64 + type: integer + required: + - id + - name + - user_count + type: object + RumSegmentTemplateInstance: + description: A template-based query block within a segment data query. + properties: + from: + description: The start of the time range in milliseconds since epoch. + example: 1709888355000 + format: int64 + type: integer + parameters: + additionalProperties: + type: string + description: The template parameters as key-value pairs. + example: + threshold: '5' + type: object + template_id: + description: The identifier of the template. + example: stickiness-v1 + type: string + to: + description: The end of the time range in milliseconds since epoch. + example: 1710493155000 + format: int64 + type: integer + required: + - template_id + type: object + RumSegmentTemplateListResponse: + description: Response for listing segment templates. + properties: + data: + description: The list of segment templates. + items: + $ref: '#/components/schemas/RumSegmentTemplateResponseData' + type: array + required: + - data + type: object + RumSegmentTemplateParameterDef: + description: A parameter definition for a segment template. + properties: + default: + description: The default value for the parameter. + example: '5' + type: string + description: + description: A description of the parameter. + example: The minimum number of sessions. + type: string + validate: + description: Validation rules for the parameter. + example: required + type: string + required: + - description + - default + - validate + type: object + RumSegmentTemplateResourceType: + description: Type of the segment template resource. + enum: + - template_metadata + example: template_metadata + type: string + x-enum-varnames: + - TEMPLATE_METADATA + RumSegmentTemplateResponseAttributes: + description: Attributes of a segment template in a response. + properties: + category: + description: The category of the template. + example: engagement + type: string + created_at: + description: The creation timestamp in RFC 3339 format. + example: '2024-01-01T00:00:00Z' + format: date-time + type: string + description: + description: A description of the template. + example: Users who visited at least N times. + type: string + modified_at: + description: The last modification timestamp in RFC 3339 format. + example: '2024-01-01T00:00:00Z' + format: date-time + type: string + name: + description: The name of the template. + example: stickiness-v1 + type: string + parameters: + additionalProperties: + $ref: '#/components/schemas/RumSegmentTemplateParameterDef' + description: The template parameter definitions. + type: object + status: + $ref: '#/components/schemas/RumSegmentTemplateStatus' + version: + description: The version number of the template. + example: 1 + format: int64 + type: integer + required: + - name + - description + - category + - parameters + - status + - version + - created_at + - modified_at + type: object + RumSegmentTemplateResponseData: + description: Data object for a segment template in a response. + properties: + attributes: + $ref: '#/components/schemas/RumSegmentTemplateResponseAttributes' + id: + description: The unique identifier of the template. + example: stickiness-v1 + type: string + type: + $ref: '#/components/schemas/RumSegmentTemplateResourceType' + required: + - id + - type + - attributes + type: object + RumSegmentTemplateStatus: + description: The status of a segment template. + enum: + - active + - deprecated + - archived + example: active + type: string + x-enum-varnames: + - ACTIVE + - DEPRECATED + - ARCHIVED + RumSegmentUpdateAttributes: + description: Attributes for updating a segment. All fields are optional. + properties: + data_query: + $ref: '#/components/schemas/RumSegmentDataQuery' + description: + description: The updated description of the segment. + example: Updated description. + type: string + name: + description: The updated name of the segment. + example: Updated Segment Name + type: string + tags: + description: The updated list of tags for the segment. + example: + - team:backend + items: + type: string + type: array + type: object + RumSegmentUpdateData: + description: Data object for a segment update request. + properties: + attributes: + $ref: '#/components/schemas/RumSegmentUpdateAttributes' + id: + description: The identifier of the segment to update. + example: a1b2c3d4-1234-5678-9abc-123456789abc + type: string + type: + $ref: '#/components/schemas/RumSegmentResourceType' + required: + - id + - type + - attributes + type: object + RumSegmentUpdateRequest: + description: Request body for updating a segment. + properties: + data: + $ref: '#/components/schemas/RumSegmentUpdateData' + required: + - data + type: object + RumSegmentUser: + description: A user who performed an action on a segment. + properties: + handle: + description: The email handle of the user. + example: john.doe@example.com + type: string + icon: + description: The URL of the user icon. + example: https://example.com/icon.png + type: string + id: + description: The numeric identifier of the user. + example: '12' + type: string + name: + description: The display name of the user. + example: John Doe + type: string + uuid: + description: The unique identifier of the user. + example: user-uuid-123 + type: string + required: + - id + - uuid + - name + - handle + - icon + type: object + RumStaticSegmentCreateAttributes: + description: Attributes for creating a new static segment. + properties: + description: + description: A description of the static segment. + example: Users from a specific journey. + type: string + journey_query_object: + $ref: '#/components/schemas/RumStaticSegmentJourneyQueryObject' + name: + description: The name of the static segment. + example: My Static Segment + type: string + tags: + description: A list of tags for the static segment. + example: + - team:frontend + items: + type: string + type: array + required: + - name + - description + - journey_query_object + type: object + RumStaticSegmentCreateData: + description: Data object for a static segment creation request. + properties: + attributes: + $ref: '#/components/schemas/RumStaticSegmentCreateAttributes' + type: + $ref: '#/components/schemas/RumStaticSegmentRequestType' + required: + - type + - attributes + type: object + RumStaticSegmentCreateRequest: + description: Request body for creating a new static segment. + properties: + data: + $ref: '#/components/schemas/RumStaticSegmentCreateData' + required: + - data + type: object + RumStaticSegmentJourneyFilter: + description: A filter within a journey query node. + properties: + attribute: + description: The attribute to filter on. + example: '@type' + type: string + value: + description: The value to match. + example: view + type: string + required: + - attribute + - value + type: object + RumStaticSegmentJourneyNode: + description: A node in a journey query object. + properties: + filters: + description: The list of filters for this node. + items: + $ref: '#/components/schemas/RumStaticSegmentJourneyFilter' + type: array + required: + - filters + type: object + RumStaticSegmentJourneyQueryObject: + description: The journey query object used to compute the static segment user + list. + properties: + nodes: + description: The list of journey nodes defining the query. + items: + $ref: '#/components/schemas/RumStaticSegmentJourneyNode' + type: array + required: + - nodes + type: object + RumStaticSegmentRequestType: + description: Type of the static segment creation request resource. + enum: + - create_static_segment_request + example: create_static_segment_request + type: string + x-enum-varnames: + - CREATE_STATIC_SEGMENT_REQUEST RunRetentionFilterName: description: The name of a RUM retention filter. example: Retention filter for session @@ -93185,6 +93892,329 @@ paths: summary: List rum replay viewership history sessions tags: - Rum Replay Viewership + /api/v2/rum/segment: + get: + description: List all user segments for the current organization. Supports sorting + and pagination. + operationId: ListRumSegments + parameters: + - description: Sort order for the segments list. + in: query + name: sort + required: false + schema: + example: name + type: string + - description: Maximum number of segments to return. + in: query + name: limit + required: false + schema: + example: 25 + type: integer + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/RumSegmentListResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: List all RUM segments + tags: + - RUM User Segments + x-unstable: '**Note**: This endpoint is in preview and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + post: + description: Create a new user segment for the current organization. + operationId: CreateRumSegment + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RumSegmentCreateRequest' + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/RumSegmentResponse' + description: Created + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Conflict + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Create a RUM segment + tags: + - RUM User Segments + x-unstable: '**Note**: This endpoint is in preview and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/rum/segment/initialize: + post: + description: Initialize default segments for the current organization. This + creates a set of predefined segments if they do not already exist. + operationId: InitializeRumSegments + responses: + '200': + description: OK + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Initialize RUM segments + tags: + - RUM User Segments + x-unstable: '**Note**: This endpoint is in preview and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/rum/segment/static: + post: + description: Create a new static user segment from a journey query. Static segments + contain a fixed list of users computed from the query at creation time. + operationId: CreateRumStaticSegment + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RumStaticSegmentCreateRequest' + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/RumSegmentResponse' + description: Created + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Conflict + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Create a static RUM segment + tags: + - RUM User Segments + x-unstable: '**Note**: This endpoint is in preview and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/rum/segment/templates: + get: + description: List all available segment templates. Templates provide predefined + segment configurations that can be customized with parameters. + operationId: ListRumSegmentTemplates + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/RumSegmentTemplateListResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: List RUM segment templates + tags: + - RUM User Segments + x-unstable: '**Note**: This endpoint is in preview and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/rum/segment/{segment_id}: + delete: + description: Delete a user segment by its identifier. + operationId: DeleteRumSegment + parameters: + - description: The identifier of the segment. + in: path + name: segment_id + required: true + schema: + example: a1b2c3d4-1234-5678-9abc-123456789abc + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/RumSegmentDeleteResponse' + description: OK + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Delete a RUM segment + tags: + - RUM User Segments + x-unstable: '**Note**: This endpoint is in preview and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + get: + description: Get a specific user segment by its identifier. + operationId: GetRumSegment + parameters: + - description: The identifier of the segment. + in: path + name: segment_id + required: true + schema: + example: a1b2c3d4-1234-5678-9abc-123456789abc + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/RumSegmentResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Get a RUM segment + tags: + - RUM User Segments + x-unstable: '**Note**: This endpoint is in preview and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + put: + description: Update an existing user segment. All fields in the request body + are optional. + operationId: UpdateRumSegment + parameters: + - description: The identifier of the segment. + in: path + name: segment_id + required: true + schema: + example: a1b2c3d4-1234-5678-9abc-123456789abc + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RumSegmentUpdateRequest' + required: true + responses: + '204': + description: No Content + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not Found + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Conflict + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Update a RUM segment + tags: + - RUM User Segments + x-unstable: '**Note**: This endpoint is in preview and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/saml_configurations/idp_metadata: post: description: 'Endpoint for uploading IdP metadata for SAML setup. @@ -104793,6 +105823,8 @@ tags: aggregate your RUM events over HTTP. See the [RUM & Session Replay page](https://docs.datadoghq.com/real_user_monitoring/) for more information name: RUM +- description: Manage RUM user segments for audience targeting and analysis. + name: RUM User Segments - description: View and manage Reference Tables in your organization. name: Reference Tables - description: 'A restriction policy defines the access control rules for a resource, diff --git a/examples/v2/rum-user-segments/CreateRumSegment.java b/examples/v2/rum-user-segments/CreateRumSegment.java new file mode 100644 index 00000000000..d3e8632c5d4 --- /dev/null +++ b/examples/v2/rum-user-segments/CreateRumSegment.java @@ -0,0 +1,96 @@ +// Create a RUM segment returns "Created" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.RumUserSegmentsApi; +import com.datadog.api.client.v2.model.RumSegmentCreateAttributes; +import com.datadog.api.client.v2.model.RumSegmentCreateData; +import com.datadog.api.client.v2.model.RumSegmentCreateRequest; +import com.datadog.api.client.v2.model.RumSegmentDataQuery; +import com.datadog.api.client.v2.model.RumSegmentEventPlatform; +import com.datadog.api.client.v2.model.RumSegmentJourney; +import com.datadog.api.client.v2.model.RumSegmentReferenceTable; +import com.datadog.api.client.v2.model.RumSegmentReferenceTableColumn; +import com.datadog.api.client.v2.model.RumSegmentReferenceTableJoinCondition; +import com.datadog.api.client.v2.model.RumSegmentResourceType; +import com.datadog.api.client.v2.model.RumSegmentResponse; +import com.datadog.api.client.v2.model.RumSegmentStaticEntry; +import com.datadog.api.client.v2.model.RumSegmentTemplateInstance; +import java.util.Collections; +import java.util.Map; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.createRumSegment", true); + RumUserSegmentsApi apiInstance = new RumUserSegmentsApi(defaultClient); + + RumSegmentCreateRequest body = + new RumSegmentCreateRequest() + .data( + new RumSegmentCreateData() + .attributes( + new RumSegmentCreateAttributes() + .dataQuery( + new RumSegmentDataQuery() + .combination("(logs && apm_home) && NOT(apm_trace)") + .eventPlatforms( + Collections.singletonList( + new RumSegmentEventPlatform() + .facet("@usr.id") + .from(1709888355000L) + .name("logs") + .query("@type:view @view.url_path:/logs") + .to(1710493155000L))) + .journeys( + Collections.singletonList( + new RumSegmentJourney() + .conversionType("any") + .groupBy("@usr.id") + .name("my_journey") + .search("@type:view"))) + .referenceTables( + Collections.singletonList( + new RumSegmentReferenceTable() + .columns( + Collections.singletonList( + new RumSegmentReferenceTableColumn() + .name("user_id"))) + .filterQuery("") + .joinCondition( + new RumSegmentReferenceTableJoinCondition() + .columnName("user_id") + .facet("@usr.id")) + .name("my_ref_table") + .tableName("my_table"))) + ._static( + Collections.singletonList( + new RumSegmentStaticEntry() + .id("static-list-1") + .name("My Static List") + .userCount(500L))) + .templates( + Collections.singletonList( + new RumSegmentTemplateInstance() + .from(1709888355000L) + .parameters( + Map.ofEntries(Map.entry("threshold", "5"))) + .templateId("stickiness-v1") + .to(1710493155000L)))) + .description("Users who visited the homepage.") + .name("My Segment") + .tags(Collections.singletonList("team:frontend"))) + .type(RumSegmentResourceType.SEGMENT)); + + try { + RumSegmentResponse result = apiInstance.createRumSegment(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling RumUserSegmentsApi#createRumSegment"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/rum-user-segments/CreateRumStaticSegment.java b/examples/v2/rum-user-segments/CreateRumStaticSegment.java new file mode 100644 index 00000000000..8f83ffae992 --- /dev/null +++ b/examples/v2/rum-user-segments/CreateRumStaticSegment.java @@ -0,0 +1,54 @@ +// Create a static RUM segment returns "Created" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.RumUserSegmentsApi; +import com.datadog.api.client.v2.model.RumSegmentResponse; +import com.datadog.api.client.v2.model.RumStaticSegmentCreateAttributes; +import com.datadog.api.client.v2.model.RumStaticSegmentCreateData; +import com.datadog.api.client.v2.model.RumStaticSegmentCreateRequest; +import com.datadog.api.client.v2.model.RumStaticSegmentJourneyFilter; +import com.datadog.api.client.v2.model.RumStaticSegmentJourneyNode; +import com.datadog.api.client.v2.model.RumStaticSegmentJourneyQueryObject; +import com.datadog.api.client.v2.model.RumStaticSegmentRequestType; +import java.util.Collections; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.createRumStaticSegment", true); + RumUserSegmentsApi apiInstance = new RumUserSegmentsApi(defaultClient); + + RumStaticSegmentCreateRequest body = + new RumStaticSegmentCreateRequest() + .data( + new RumStaticSegmentCreateData() + .attributes( + new RumStaticSegmentCreateAttributes() + .description("Users from a specific journey.") + .journeyQueryObject( + new RumStaticSegmentJourneyQueryObject() + .nodes( + Collections.singletonList( + new RumStaticSegmentJourneyNode() + .filters( + Collections.singletonList( + new RumStaticSegmentJourneyFilter() + .attribute("@type") + .value("view")))))) + .name("My Static Segment") + .tags(Collections.singletonList("team:frontend"))) + .type(RumStaticSegmentRequestType.CREATE_STATIC_SEGMENT_REQUEST)); + + try { + RumSegmentResponse result = apiInstance.createRumStaticSegment(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling RumUserSegmentsApi#createRumStaticSegment"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/rum-user-segments/DeleteRumSegment.java b/examples/v2/rum-user-segments/DeleteRumSegment.java new file mode 100644 index 00000000000..3c2fb9cd8d5 --- /dev/null +++ b/examples/v2/rum-user-segments/DeleteRumSegment.java @@ -0,0 +1,26 @@ +// Delete a RUM segment returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.RumUserSegmentsApi; +import com.datadog.api.client.v2.model.RumSegmentDeleteResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.deleteRumSegment", true); + RumUserSegmentsApi apiInstance = new RumUserSegmentsApi(defaultClient); + + try { + RumSegmentDeleteResponse result = + apiInstance.deleteRumSegment("a1b2c3d4-1234-5678-9abc-123456789abc"); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling RumUserSegmentsApi#deleteRumSegment"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/rum-user-segments/GetRumSegment.java b/examples/v2/rum-user-segments/GetRumSegment.java new file mode 100644 index 00000000000..1560ef39800 --- /dev/null +++ b/examples/v2/rum-user-segments/GetRumSegment.java @@ -0,0 +1,25 @@ +// Get a RUM segment returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.RumUserSegmentsApi; +import com.datadog.api.client.v2.model.RumSegmentResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.getRumSegment", true); + RumUserSegmentsApi apiInstance = new RumUserSegmentsApi(defaultClient); + + try { + RumSegmentResponse result = apiInstance.getRumSegment("a1b2c3d4-1234-5678-9abc-123456789abc"); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling RumUserSegmentsApi#getRumSegment"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/rum-user-segments/InitializeRumSegments.java b/examples/v2/rum-user-segments/InitializeRumSegments.java new file mode 100644 index 00000000000..fa4bda4de0e --- /dev/null +++ b/examples/v2/rum-user-segments/InitializeRumSegments.java @@ -0,0 +1,23 @@ +// Initialize RUM segments returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.RumUserSegmentsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.initializeRumSegments", true); + RumUserSegmentsApi apiInstance = new RumUserSegmentsApi(defaultClient); + + try { + apiInstance.initializeRumSegments(); + } catch (ApiException e) { + System.err.println("Exception when calling RumUserSegmentsApi#initializeRumSegments"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/rum-user-segments/ListRumSegmentTemplates.java b/examples/v2/rum-user-segments/ListRumSegmentTemplates.java new file mode 100644 index 00000000000..86f7efae946 --- /dev/null +++ b/examples/v2/rum-user-segments/ListRumSegmentTemplates.java @@ -0,0 +1,25 @@ +// List RUM segment templates returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.RumUserSegmentsApi; +import com.datadog.api.client.v2.model.RumSegmentTemplateListResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.listRumSegmentTemplates", true); + RumUserSegmentsApi apiInstance = new RumUserSegmentsApi(defaultClient); + + try { + RumSegmentTemplateListResponse result = apiInstance.listRumSegmentTemplates(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling RumUserSegmentsApi#listRumSegmentTemplates"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/rum-user-segments/ListRumSegments.java b/examples/v2/rum-user-segments/ListRumSegments.java new file mode 100644 index 00000000000..08163c10a78 --- /dev/null +++ b/examples/v2/rum-user-segments/ListRumSegments.java @@ -0,0 +1,25 @@ +// List all RUM segments returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.RumUserSegmentsApi; +import com.datadog.api.client.v2.model.RumSegmentListResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.listRumSegments", true); + RumUserSegmentsApi apiInstance = new RumUserSegmentsApi(defaultClient); + + try { + RumSegmentListResponse result = apiInstance.listRumSegments(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling RumUserSegmentsApi#listRumSegments"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/rum-user-segments/UpdateRumSegment.java b/examples/v2/rum-user-segments/UpdateRumSegment.java new file mode 100644 index 00000000000..c4837e37acd --- /dev/null +++ b/examples/v2/rum-user-segments/UpdateRumSegment.java @@ -0,0 +1,95 @@ +// Update a RUM segment returns "No Content" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.RumUserSegmentsApi; +import com.datadog.api.client.v2.model.RumSegmentDataQuery; +import com.datadog.api.client.v2.model.RumSegmentEventPlatform; +import com.datadog.api.client.v2.model.RumSegmentJourney; +import com.datadog.api.client.v2.model.RumSegmentReferenceTable; +import com.datadog.api.client.v2.model.RumSegmentReferenceTableColumn; +import com.datadog.api.client.v2.model.RumSegmentReferenceTableJoinCondition; +import com.datadog.api.client.v2.model.RumSegmentResourceType; +import com.datadog.api.client.v2.model.RumSegmentStaticEntry; +import com.datadog.api.client.v2.model.RumSegmentTemplateInstance; +import com.datadog.api.client.v2.model.RumSegmentUpdateAttributes; +import com.datadog.api.client.v2.model.RumSegmentUpdateData; +import com.datadog.api.client.v2.model.RumSegmentUpdateRequest; +import java.util.Collections; +import java.util.Map; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.updateRumSegment", true); + RumUserSegmentsApi apiInstance = new RumUserSegmentsApi(defaultClient); + + RumSegmentUpdateRequest body = + new RumSegmentUpdateRequest() + .data( + new RumSegmentUpdateData() + .attributes( + new RumSegmentUpdateAttributes() + .dataQuery( + new RumSegmentDataQuery() + .combination("(logs && apm_home) && NOT(apm_trace)") + .eventPlatforms( + Collections.singletonList( + new RumSegmentEventPlatform() + .facet("@usr.id") + .from(1709888355000L) + .name("logs") + .query("@type:view @view.url_path:/logs") + .to(1710493155000L))) + .journeys( + Collections.singletonList( + new RumSegmentJourney() + .conversionType("any") + .groupBy("@usr.id") + .name("my_journey") + .search("@type:view"))) + .referenceTables( + Collections.singletonList( + new RumSegmentReferenceTable() + .columns( + Collections.singletonList( + new RumSegmentReferenceTableColumn() + .name("user_id"))) + .filterQuery("") + .joinCondition( + new RumSegmentReferenceTableJoinCondition() + .columnName("user_id") + .facet("@usr.id")) + .name("my_ref_table") + .tableName("my_table"))) + ._static( + Collections.singletonList( + new RumSegmentStaticEntry() + .id("static-list-1") + .name("My Static List") + .userCount(500L))) + .templates( + Collections.singletonList( + new RumSegmentTemplateInstance() + .from(1709888355000L) + .parameters( + Map.ofEntries(Map.entry("threshold", "5"))) + .templateId("stickiness-v1") + .to(1710493155000L)))) + .description("Updated description.") + .name("Updated Segment Name") + .tags(Collections.singletonList("team:backend"))) + .id("a1b2c3d4-1234-5678-9abc-123456789abc") + .type(RumSegmentResourceType.SEGMENT)); + + try { + apiInstance.updateRumSegment("a1b2c3d4-1234-5678-9abc-123456789abc", body); + } catch (ApiException e) { + System.err.println("Exception when calling RumUserSegmentsApi#updateRumSegment"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/datadog/api/client/ApiClient.java b/src/main/java/com/datadog/api/client/ApiClient.java index 7606b2b54f0..452975c92f4 100644 --- a/src/main/java/com/datadog/api/client/ApiClient.java +++ b/src/main/java/com/datadog/api/client/ApiClient.java @@ -920,6 +920,14 @@ public class ApiClient { put("v2.queryEventFilteredUsers", false); put("v2.queryUsers", false); put("v2.updateConnection", false); + put("v2.createRumSegment", false); + put("v2.createRumStaticSegment", false); + put("v2.deleteRumSegment", false); + put("v2.getRumSegment", false); + put("v2.initializeRumSegments", false); + put("v2.listRumSegments", false); + put("v2.listRumSegmentTemplates", false); + put("v2.updateRumSegment", false); put("v2.createScorecardOutcomesBatch", false); put("v2.createScorecardRule", false); put("v2.deleteScorecardRule", false); diff --git a/src/main/java/com/datadog/api/client/v2/api/RumUserSegmentsApi.java b/src/main/java/com/datadog/api/client/v2/api/RumUserSegmentsApi.java new file mode 100644 index 00000000000..4e3d008ef21 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/api/RumUserSegmentsApi.java @@ -0,0 +1,1291 @@ +package com.datadog.api.client.v2.api; + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.ApiResponse; +import com.datadog.api.client.Pair; +import com.datadog.api.client.v2.model.RumSegmentCreateRequest; +import com.datadog.api.client.v2.model.RumSegmentDeleteResponse; +import com.datadog.api.client.v2.model.RumSegmentListResponse; +import com.datadog.api.client.v2.model.RumSegmentResponse; +import com.datadog.api.client.v2.model.RumSegmentTemplateListResponse; +import com.datadog.api.client.v2.model.RumSegmentUpdateRequest; +import com.datadog.api.client.v2.model.RumStaticSegmentCreateRequest; +import jakarta.ws.rs.client.Invocation; +import jakarta.ws.rs.core.GenericType; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.CompletableFuture; + +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RumUserSegmentsApi { + private ApiClient apiClient; + + public RumUserSegmentsApi() { + this(ApiClient.getDefaultApiClient()); + } + + public RumUserSegmentsApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Get the API client. + * + * @return API client + */ + public ApiClient getApiClient() { + return apiClient; + } + + /** + * Set the API client. + * + * @param apiClient an instance of API client + */ + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Create a RUM segment. + * + *

See {@link #createRumSegmentWithHttpInfo}. + * + * @param body (required) + * @return RumSegmentResponse + * @throws ApiException if fails to make API call + */ + public RumSegmentResponse createRumSegment(RumSegmentCreateRequest body) throws ApiException { + return createRumSegmentWithHttpInfo(body).getData(); + } + + /** + * Create a RUM segment. + * + *

See {@link #createRumSegmentWithHttpInfoAsync}. + * + * @param body (required) + * @return CompletableFuture<RumSegmentResponse> + */ + public CompletableFuture createRumSegmentAsync(RumSegmentCreateRequest body) { + return createRumSegmentWithHttpInfoAsync(body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Create a new user segment for the current organization. + * + * @param body (required) + * @return ApiResponse<RumSegmentResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
201 Created -
400 Bad Request -
403 Forbidden -
409 Conflict -
429 Too many requests -
+ */ + public ApiResponse createRumSegmentWithHttpInfo(RumSegmentCreateRequest body) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "createRumSegment"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling createRumSegment"); + } + // create path and map variables + String localVarPath = "/api/v2/rum/segment"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.RumUserSegmentsApi.createRumSegment", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Create a RUM segment. + * + *

See {@link #createRumSegmentWithHttpInfo}. + * + * @param body (required) + * @return CompletableFuture<ApiResponse<RumSegmentResponse>> + */ + public CompletableFuture> createRumSegmentWithHttpInfoAsync( + RumSegmentCreateRequest body) { + // Check if unstable operation is enabled + String operationId = "createRumSegment"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling createRumSegment")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/rum/segment"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.RumUserSegmentsApi.createRumSegment", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Create a static RUM segment. + * + *

See {@link #createRumStaticSegmentWithHttpInfo}. + * + * @param body (required) + * @return RumSegmentResponse + * @throws ApiException if fails to make API call + */ + public RumSegmentResponse createRumStaticSegment(RumStaticSegmentCreateRequest body) + throws ApiException { + return createRumStaticSegmentWithHttpInfo(body).getData(); + } + + /** + * Create a static RUM segment. + * + *

See {@link #createRumStaticSegmentWithHttpInfoAsync}. + * + * @param body (required) + * @return CompletableFuture<RumSegmentResponse> + */ + public CompletableFuture createRumStaticSegmentAsync( + RumStaticSegmentCreateRequest body) { + return createRumStaticSegmentWithHttpInfoAsync(body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Create a new static user segment from a journey query. Static segments contain a fixed list of + * users computed from the query at creation time. + * + * @param body (required) + * @return ApiResponse<RumSegmentResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
201 Created -
400 Bad Request -
403 Forbidden -
409 Conflict -
429 Too many requests -
+ */ + public ApiResponse createRumStaticSegmentWithHttpInfo( + RumStaticSegmentCreateRequest body) throws ApiException { + // Check if unstable operation is enabled + String operationId = "createRumStaticSegment"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling createRumStaticSegment"); + } + // create path and map variables + String localVarPath = "/api/v2/rum/segment/static"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.RumUserSegmentsApi.createRumStaticSegment", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Create a static RUM segment. + * + *

See {@link #createRumStaticSegmentWithHttpInfo}. + * + * @param body (required) + * @return CompletableFuture<ApiResponse<RumSegmentResponse>> + */ + public CompletableFuture> createRumStaticSegmentWithHttpInfoAsync( + RumStaticSegmentCreateRequest body) { + // Check if unstable operation is enabled + String operationId = "createRumStaticSegment"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling createRumStaticSegment")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/rum/segment/static"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.RumUserSegmentsApi.createRumStaticSegment", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Delete a RUM segment. + * + *

See {@link #deleteRumSegmentWithHttpInfo}. + * + * @param segmentId The identifier of the segment. (required) + * @return RumSegmentDeleteResponse + * @throws ApiException if fails to make API call + */ + public RumSegmentDeleteResponse deleteRumSegment(String segmentId) throws ApiException { + return deleteRumSegmentWithHttpInfo(segmentId).getData(); + } + + /** + * Delete a RUM segment. + * + *

See {@link #deleteRumSegmentWithHttpInfoAsync}. + * + * @param segmentId The identifier of the segment. (required) + * @return CompletableFuture<RumSegmentDeleteResponse> + */ + public CompletableFuture deleteRumSegmentAsync(String segmentId) { + return deleteRumSegmentWithHttpInfoAsync(segmentId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Delete a user segment by its identifier. + * + * @param segmentId The identifier of the segment. (required) + * @return ApiResponse<RumSegmentDeleteResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse deleteRumSegmentWithHttpInfo(String segmentId) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "deleteRumSegment"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'segmentId' is set + if (segmentId == null) { + throw new ApiException( + 400, "Missing the required parameter 'segmentId' when calling deleteRumSegment"); + } + // create path and map variables + String localVarPath = + "/api/v2/rum/segment/{segment_id}" + .replaceAll("\\{" + "segment_id" + "\\}", apiClient.escapeString(segmentId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.RumUserSegmentsApi.deleteRumSegment", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Delete a RUM segment. + * + *

See {@link #deleteRumSegmentWithHttpInfo}. + * + * @param segmentId The identifier of the segment. (required) + * @return CompletableFuture<ApiResponse<RumSegmentDeleteResponse>> + */ + public CompletableFuture> deleteRumSegmentWithHttpInfoAsync( + String segmentId) { + // Check if unstable operation is enabled + String operationId = "deleteRumSegment"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'segmentId' is set + if (segmentId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'segmentId' when calling deleteRumSegment")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/rum/segment/{segment_id}" + .replaceAll("\\{" + "segment_id" + "\\}", apiClient.escapeString(segmentId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.RumUserSegmentsApi.deleteRumSegment", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get a RUM segment. + * + *

See {@link #getRumSegmentWithHttpInfo}. + * + * @param segmentId The identifier of the segment. (required) + * @return RumSegmentResponse + * @throws ApiException if fails to make API call + */ + public RumSegmentResponse getRumSegment(String segmentId) throws ApiException { + return getRumSegmentWithHttpInfo(segmentId).getData(); + } + + /** + * Get a RUM segment. + * + *

See {@link #getRumSegmentWithHttpInfoAsync}. + * + * @param segmentId The identifier of the segment. (required) + * @return CompletableFuture<RumSegmentResponse> + */ + public CompletableFuture getRumSegmentAsync(String segmentId) { + return getRumSegmentWithHttpInfoAsync(segmentId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get a specific user segment by its identifier. + * + * @param segmentId The identifier of the segment. (required) + * @return ApiResponse<RumSegmentResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse getRumSegmentWithHttpInfo(String segmentId) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "getRumSegment"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'segmentId' is set + if (segmentId == null) { + throw new ApiException( + 400, "Missing the required parameter 'segmentId' when calling getRumSegment"); + } + // create path and map variables + String localVarPath = + "/api/v2/rum/segment/{segment_id}" + .replaceAll("\\{" + "segment_id" + "\\}", apiClient.escapeString(segmentId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.RumUserSegmentsApi.getRumSegment", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get a RUM segment. + * + *

See {@link #getRumSegmentWithHttpInfo}. + * + * @param segmentId The identifier of the segment. (required) + * @return CompletableFuture<ApiResponse<RumSegmentResponse>> + */ + public CompletableFuture> getRumSegmentWithHttpInfoAsync( + String segmentId) { + // Check if unstable operation is enabled + String operationId = "getRumSegment"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'segmentId' is set + if (segmentId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'segmentId' when calling getRumSegment")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/rum/segment/{segment_id}" + .replaceAll("\\{" + "segment_id" + "\\}", apiClient.escapeString(segmentId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.RumUserSegmentsApi.getRumSegment", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Initialize RUM segments. + * + *

See {@link #initializeRumSegmentsWithHttpInfo}. + * + * @throws ApiException if fails to make API call + */ + public void initializeRumSegments() throws ApiException { + initializeRumSegmentsWithHttpInfo(); + } + + /** + * Initialize RUM segments. + * + *

See {@link #initializeRumSegmentsWithHttpInfoAsync}. + * + * @return CompletableFuture + */ + public CompletableFuture initializeRumSegmentsAsync() { + return initializeRumSegmentsWithHttpInfoAsync() + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Initialize default segments for the current organization. This creates a set of predefined + * segments if they do not already exist. + * + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
403 Forbidden -
429 Too many requests -
+ */ + public ApiResponse initializeRumSegmentsWithHttpInfo() throws ApiException { + // Check if unstable operation is enabled + String operationId = "initializeRumSegments"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + // create path and map variables + String localVarPath = "/api/v2/rum/segment/initialize"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.RumUserSegmentsApi.initializeRumSegments", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Initialize RUM segments. + * + *

See {@link #initializeRumSegmentsWithHttpInfo}. + * + * @return CompletableFuture<ApiResponse<Void>> + */ + public CompletableFuture> initializeRumSegmentsWithHttpInfoAsync() { + // Check if unstable operation is enabled + String operationId = "initializeRumSegments"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + // create path and map variables + String localVarPath = "/api/v2/rum/segment/initialize"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.RumUserSegmentsApi.initializeRumSegments", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "POST", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** Manage optional parameters to listRumSegments. */ + public static class ListRumSegmentsOptionalParameters { + private String sort; + private Integer limit; + + /** + * Set sort. + * + * @param sort Sort order for the segments list. (optional) + * @return ListRumSegmentsOptionalParameters + */ + public ListRumSegmentsOptionalParameters sort(String sort) { + this.sort = sort; + return this; + } + + /** + * Set limit. + * + * @param limit Maximum number of segments to return. (optional) + * @return ListRumSegmentsOptionalParameters + */ + public ListRumSegmentsOptionalParameters limit(Integer limit) { + this.limit = limit; + return this; + } + } + + /** + * List all RUM segments. + * + *

See {@link #listRumSegmentsWithHttpInfo}. + * + * @return RumSegmentListResponse + * @throws ApiException if fails to make API call + */ + public RumSegmentListResponse listRumSegments() throws ApiException { + return listRumSegmentsWithHttpInfo(new ListRumSegmentsOptionalParameters()).getData(); + } + + /** + * List all RUM segments. + * + *

See {@link #listRumSegmentsWithHttpInfoAsync}. + * + * @return CompletableFuture<RumSegmentListResponse> + */ + public CompletableFuture listRumSegmentsAsync() { + return listRumSegmentsWithHttpInfoAsync(new ListRumSegmentsOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * List all RUM segments. + * + *

See {@link #listRumSegmentsWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return RumSegmentListResponse + * @throws ApiException if fails to make API call + */ + public RumSegmentListResponse listRumSegments(ListRumSegmentsOptionalParameters parameters) + throws ApiException { + return listRumSegmentsWithHttpInfo(parameters).getData(); + } + + /** + * List all RUM segments. + * + *

See {@link #listRumSegmentsWithHttpInfoAsync}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<RumSegmentListResponse> + */ + public CompletableFuture listRumSegmentsAsync( + ListRumSegmentsOptionalParameters parameters) { + return listRumSegmentsWithHttpInfoAsync(parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * List all user segments for the current organization. Supports sorting and pagination. + * + * @param parameters Optional parameters for the request. + * @return ApiResponse<RumSegmentListResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
429 Too many requests -
+ */ + public ApiResponse listRumSegmentsWithHttpInfo( + ListRumSegmentsOptionalParameters parameters) throws ApiException { + // Check if unstable operation is enabled + String operationId = "listRumSegments"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + String sort = parameters.sort; + Integer limit = parameters.limit; + // create path and map variables + String localVarPath = "/api/v2/rum/segment"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort", sort)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "limit", limit)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.RumUserSegmentsApi.listRumSegments", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * List all RUM segments. + * + *

See {@link #listRumSegmentsWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<RumSegmentListResponse>> + */ + public CompletableFuture> listRumSegmentsWithHttpInfoAsync( + ListRumSegmentsOptionalParameters parameters) { + // Check if unstable operation is enabled + String operationId = "listRumSegments"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + String sort = parameters.sort; + Integer limit = parameters.limit; + // create path and map variables + String localVarPath = "/api/v2/rum/segment"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort", sort)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "limit", limit)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.RumUserSegmentsApi.listRumSegments", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * List RUM segment templates. + * + *

See {@link #listRumSegmentTemplatesWithHttpInfo}. + * + * @return RumSegmentTemplateListResponse + * @throws ApiException if fails to make API call + */ + public RumSegmentTemplateListResponse listRumSegmentTemplates() throws ApiException { + return listRumSegmentTemplatesWithHttpInfo().getData(); + } + + /** + * List RUM segment templates. + * + *

See {@link #listRumSegmentTemplatesWithHttpInfoAsync}. + * + * @return CompletableFuture<RumSegmentTemplateListResponse> + */ + public CompletableFuture listRumSegmentTemplatesAsync() { + return listRumSegmentTemplatesWithHttpInfoAsync() + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * List all available segment templates. Templates provide predefined segment configurations that + * can be customized with parameters. + * + * @return ApiResponse<RumSegmentTemplateListResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
429 Too many requests -
+ */ + public ApiResponse listRumSegmentTemplatesWithHttpInfo() + throws ApiException { + // Check if unstable operation is enabled + String operationId = "listRumSegmentTemplates"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + // create path and map variables + String localVarPath = "/api/v2/rum/segment/templates"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.RumUserSegmentsApi.listRumSegmentTemplates", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * List RUM segment templates. + * + *

See {@link #listRumSegmentTemplatesWithHttpInfo}. + * + * @return CompletableFuture<ApiResponse<RumSegmentTemplateListResponse>> + */ + public CompletableFuture> + listRumSegmentTemplatesWithHttpInfoAsync() { + // Check if unstable operation is enabled + String operationId = "listRumSegmentTemplates"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + // create path and map variables + String localVarPath = "/api/v2/rum/segment/templates"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.RumUserSegmentsApi.listRumSegmentTemplates", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Update a RUM segment. + * + *

See {@link #updateRumSegmentWithHttpInfo}. + * + * @param segmentId The identifier of the segment. (required) + * @param body (required) + * @throws ApiException if fails to make API call + */ + public void updateRumSegment(String segmentId, RumSegmentUpdateRequest body) throws ApiException { + updateRumSegmentWithHttpInfo(segmentId, body); + } + + /** + * Update a RUM segment. + * + *

See {@link #updateRumSegmentWithHttpInfoAsync}. + * + * @param segmentId The identifier of the segment. (required) + * @param body (required) + * @return CompletableFuture + */ + public CompletableFuture updateRumSegmentAsync( + String segmentId, RumSegmentUpdateRequest body) { + return updateRumSegmentWithHttpInfoAsync(segmentId, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Update an existing user segment. All fields in the request body are optional. + * + * @param segmentId The identifier of the segment. (required) + * @param body (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
204 No Content -
400 Bad Request -
403 Forbidden -
404 Not Found -
409 Conflict -
429 Too many requests -
+ */ + public ApiResponse updateRumSegmentWithHttpInfo( + String segmentId, RumSegmentUpdateRequest body) throws ApiException { + // Check if unstable operation is enabled + String operationId = "updateRumSegment"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = body; + + // verify the required parameter 'segmentId' is set + if (segmentId == null) { + throw new ApiException( + 400, "Missing the required parameter 'segmentId' when calling updateRumSegment"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling updateRumSegment"); + } + // create path and map variables + String localVarPath = + "/api/v2/rum/segment/{segment_id}" + .replaceAll("\\{" + "segment_id" + "\\}", apiClient.escapeString(segmentId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.RumUserSegmentsApi.updateRumSegment", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "PUT", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Update a RUM segment. + * + *

See {@link #updateRumSegmentWithHttpInfo}. + * + * @param segmentId The identifier of the segment. (required) + * @param body (required) + * @return CompletableFuture<ApiResponse<Void>> + */ + public CompletableFuture> updateRumSegmentWithHttpInfoAsync( + String segmentId, RumSegmentUpdateRequest body) { + // Check if unstable operation is enabled + String operationId = "updateRumSegment"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = body; + + // verify the required parameter 'segmentId' is set + if (segmentId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'segmentId' when calling updateRumSegment")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling updateRumSegment")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/rum/segment/{segment_id}" + .replaceAll("\\{" + "segment_id" + "\\}", apiClient.escapeString(segmentId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.RumUserSegmentsApi.updateRumSegment", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "PUT", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + null); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RumSegmentCreateAttributes.java b/src/main/java/com/datadog/api/client/v2/model/RumSegmentCreateAttributes.java new file mode 100644 index 00000000000..bc3bdf75b9c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RumSegmentCreateAttributes.java @@ -0,0 +1,242 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Attributes for creating a new segment. */ +@JsonPropertyOrder({ + RumSegmentCreateAttributes.JSON_PROPERTY_DATA_QUERY, + RumSegmentCreateAttributes.JSON_PROPERTY_DESCRIPTION, + RumSegmentCreateAttributes.JSON_PROPERTY_NAME, + RumSegmentCreateAttributes.JSON_PROPERTY_TAGS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RumSegmentCreateAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA_QUERY = "data_query"; + private RumSegmentDataQuery dataQuery; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_TAGS = "tags"; + private List tags = null; + + public RumSegmentCreateAttributes() {} + + @JsonCreator + public RumSegmentCreateAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA_QUERY) + RumSegmentDataQuery dataQuery, + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name) { + this.dataQuery = dataQuery; + this.unparsed |= dataQuery.unparsed; + this.name = name; + } + + public RumSegmentCreateAttributes dataQuery(RumSegmentDataQuery dataQuery) { + this.dataQuery = dataQuery; + this.unparsed |= dataQuery.unparsed; + return this; + } + + /** + * Query definition for the segment. Contains one or more query blocks and an optional combination + * formula. + * + * @return dataQuery + */ + @JsonProperty(JSON_PROPERTY_DATA_QUERY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public RumSegmentDataQuery getDataQuery() { + return dataQuery; + } + + public void setDataQuery(RumSegmentDataQuery dataQuery) { + this.dataQuery = dataQuery; + } + + public RumSegmentCreateAttributes description(String description) { + this.description = description; + return this; + } + + /** + * A description of the segment. + * + * @return description + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public RumSegmentCreateAttributes name(String name) { + this.name = name; + return this; + } + + /** + * The name of the segment. + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public RumSegmentCreateAttributes tags(List tags) { + this.tags = tags; + return this; + } + + public RumSegmentCreateAttributes addTagsItem(String tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList<>(); + } + this.tags.add(tagsItem); + return this; + } + + /** + * A list of tags for the segment. + * + * @return tags + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTags() { + return tags; + } + + public void setTags(List tags) { + this.tags = tags; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return RumSegmentCreateAttributes + */ + @JsonAnySetter + public RumSegmentCreateAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this RumSegmentCreateAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RumSegmentCreateAttributes rumSegmentCreateAttributes = (RumSegmentCreateAttributes) o; + return Objects.equals(this.dataQuery, rumSegmentCreateAttributes.dataQuery) + && Objects.equals(this.description, rumSegmentCreateAttributes.description) + && Objects.equals(this.name, rumSegmentCreateAttributes.name) + && Objects.equals(this.tags, rumSegmentCreateAttributes.tags) + && Objects.equals( + this.additionalProperties, rumSegmentCreateAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(dataQuery, description, name, tags, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RumSegmentCreateAttributes {\n"); + sb.append(" dataQuery: ").append(toIndentedString(dataQuery)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RumSegmentCreateData.java b/src/main/java/com/datadog/api/client/v2/model/RumSegmentCreateData.java new file mode 100644 index 00000000000..5178d08f5be --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RumSegmentCreateData.java @@ -0,0 +1,181 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data object for a segment creation request. */ +@JsonPropertyOrder({ + RumSegmentCreateData.JSON_PROPERTY_ATTRIBUTES, + RumSegmentCreateData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RumSegmentCreateData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private RumSegmentCreateAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private RumSegmentResourceType type; + + public RumSegmentCreateData() {} + + @JsonCreator + public RumSegmentCreateData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + RumSegmentCreateAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) RumSegmentResourceType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public RumSegmentCreateData attributes(RumSegmentCreateAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes for creating a new segment. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public RumSegmentCreateAttributes getAttributes() { + return attributes; + } + + public void setAttributes(RumSegmentCreateAttributes attributes) { + this.attributes = attributes; + } + + public RumSegmentCreateData type(RumSegmentResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Type of the segment resource. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public RumSegmentResourceType getType() { + return type; + } + + public void setType(RumSegmentResourceType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return RumSegmentCreateData + */ + @JsonAnySetter + public RumSegmentCreateData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this RumSegmentCreateData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RumSegmentCreateData rumSegmentCreateData = (RumSegmentCreateData) o; + return Objects.equals(this.attributes, rumSegmentCreateData.attributes) + && Objects.equals(this.type, rumSegmentCreateData.type) + && Objects.equals(this.additionalProperties, rumSegmentCreateData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RumSegmentCreateData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RumSegmentCreateRequest.java b/src/main/java/com/datadog/api/client/v2/model/RumSegmentCreateRequest.java new file mode 100644 index 00000000000..22bf2e73077 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RumSegmentCreateRequest.java @@ -0,0 +1,145 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Request body for creating a new segment. */ +@JsonPropertyOrder({RumSegmentCreateRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RumSegmentCreateRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private RumSegmentCreateData data; + + public RumSegmentCreateRequest() {} + + @JsonCreator + public RumSegmentCreateRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) RumSegmentCreateData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public RumSegmentCreateRequest data(RumSegmentCreateData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data object for a segment creation request. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public RumSegmentCreateData getData() { + return data; + } + + public void setData(RumSegmentCreateData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return RumSegmentCreateRequest + */ + @JsonAnySetter + public RumSegmentCreateRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this RumSegmentCreateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RumSegmentCreateRequest rumSegmentCreateRequest = (RumSegmentCreateRequest) o; + return Objects.equals(this.data, rumSegmentCreateRequest.data) + && Objects.equals(this.additionalProperties, rumSegmentCreateRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RumSegmentCreateRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RumSegmentDataQuery.java b/src/main/java/com/datadog/api/client/v2/model/RumSegmentDataQuery.java new file mode 100644 index 00000000000..cb5cb3778a8 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RumSegmentDataQuery.java @@ -0,0 +1,344 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** + * Query definition for the segment. Contains one or more query blocks and an optional combination + * formula. + */ +@JsonPropertyOrder({ + RumSegmentDataQuery.JSON_PROPERTY_COMBINATION, + RumSegmentDataQuery.JSON_PROPERTY_EVENT_PLATFORMS, + RumSegmentDataQuery.JSON_PROPERTY_JOURNEYS, + RumSegmentDataQuery.JSON_PROPERTY_REFERENCE_TABLES, + RumSegmentDataQuery.JSON_PROPERTY_STATIC, + RumSegmentDataQuery.JSON_PROPERTY_TEMPLATES +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RumSegmentDataQuery { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_COMBINATION = "combination"; + private String combination; + + public static final String JSON_PROPERTY_EVENT_PLATFORMS = "event_platforms"; + private List eventPlatforms = null; + + public static final String JSON_PROPERTY_JOURNEYS = "journeys"; + private List journeys = null; + + public static final String JSON_PROPERTY_REFERENCE_TABLES = "reference_tables"; + private List referenceTables = null; + + public static final String JSON_PROPERTY_STATIC = "static"; + private List _static = null; + + public static final String JSON_PROPERTY_TEMPLATES = "templates"; + private List templates = null; + + public RumSegmentDataQuery combination(String combination) { + this.combination = combination; + return this; + } + + /** + * Boolean expression combining multiple query blocks. + * + * @return combination + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COMBINATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCombination() { + return combination; + } + + public void setCombination(String combination) { + this.combination = combination; + } + + public RumSegmentDataQuery eventPlatforms(List eventPlatforms) { + this.eventPlatforms = eventPlatforms; + for (RumSegmentEventPlatform item : eventPlatforms) { + this.unparsed |= item.unparsed; + } + return this; + } + + public RumSegmentDataQuery addEventPlatformsItem(RumSegmentEventPlatform eventPlatformsItem) { + if (this.eventPlatforms == null) { + this.eventPlatforms = new ArrayList<>(); + } + this.eventPlatforms.add(eventPlatformsItem); + this.unparsed |= eventPlatformsItem.unparsed; + return this; + } + + /** + * List of event platform query blocks. + * + * @return eventPlatforms + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EVENT_PLATFORMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getEventPlatforms() { + return eventPlatforms; + } + + public void setEventPlatforms(List eventPlatforms) { + this.eventPlatforms = eventPlatforms; + } + + public RumSegmentDataQuery journeys(List journeys) { + this.journeys = journeys; + for (RumSegmentJourney item : journeys) { + this.unparsed |= item.unparsed; + } + return this; + } + + public RumSegmentDataQuery addJourneysItem(RumSegmentJourney journeysItem) { + if (this.journeys == null) { + this.journeys = new ArrayList<>(); + } + this.journeys.add(journeysItem); + this.unparsed |= journeysItem.unparsed; + return this; + } + + /** + * List of journey-based query blocks. + * + * @return journeys + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_JOURNEYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getJourneys() { + return journeys; + } + + public void setJourneys(List journeys) { + this.journeys = journeys; + } + + public RumSegmentDataQuery referenceTables(List referenceTables) { + this.referenceTables = referenceTables; + for (RumSegmentReferenceTable item : referenceTables) { + this.unparsed |= item.unparsed; + } + return this; + } + + public RumSegmentDataQuery addReferenceTablesItem(RumSegmentReferenceTable referenceTablesItem) { + if (this.referenceTables == null) { + this.referenceTables = new ArrayList<>(); + } + this.referenceTables.add(referenceTablesItem); + this.unparsed |= referenceTablesItem.unparsed; + return this; + } + + /** + * List of reference table query blocks. + * + * @return referenceTables + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REFERENCE_TABLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getReferenceTables() { + return referenceTables; + } + + public void setReferenceTables(List referenceTables) { + this.referenceTables = referenceTables; + } + + public RumSegmentDataQuery _static(List _static) { + this._static = _static; + for (RumSegmentStaticEntry item : _static) { + this.unparsed |= item.unparsed; + } + return this; + } + + public RumSegmentDataQuery add_staticItem(RumSegmentStaticEntry _staticItem) { + if (this._static == null) { + this._static = new ArrayList<>(); + } + this._static.add(_staticItem); + this.unparsed |= _staticItem.unparsed; + return this; + } + + /** + * List of static user list blocks. + * + * @return _static + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STATIC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getStatic() { + return _static; + } + + public void setStatic(List _static) { + this._static = _static; + } + + public RumSegmentDataQuery templates(List templates) { + this.templates = templates; + for (RumSegmentTemplateInstance item : templates) { + this.unparsed |= item.unparsed; + } + return this; + } + + public RumSegmentDataQuery addTemplatesItem(RumSegmentTemplateInstance templatesItem) { + if (this.templates == null) { + this.templates = new ArrayList<>(); + } + this.templates.add(templatesItem); + this.unparsed |= templatesItem.unparsed; + return this; + } + + /** + * List of template-based query blocks. + * + * @return templates + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEMPLATES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTemplates() { + return templates; + } + + public void setTemplates(List templates) { + this.templates = templates; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return RumSegmentDataQuery + */ + @JsonAnySetter + public RumSegmentDataQuery putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this RumSegmentDataQuery object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RumSegmentDataQuery rumSegmentDataQuery = (RumSegmentDataQuery) o; + return Objects.equals(this.combination, rumSegmentDataQuery.combination) + && Objects.equals(this.eventPlatforms, rumSegmentDataQuery.eventPlatforms) + && Objects.equals(this.journeys, rumSegmentDataQuery.journeys) + && Objects.equals(this.referenceTables, rumSegmentDataQuery.referenceTables) + && Objects.equals(this._static, rumSegmentDataQuery._static) + && Objects.equals(this.templates, rumSegmentDataQuery.templates) + && Objects.equals(this.additionalProperties, rumSegmentDataQuery.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + combination, + eventPlatforms, + journeys, + referenceTables, + _static, + templates, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RumSegmentDataQuery {\n"); + sb.append(" combination: ").append(toIndentedString(combination)).append("\n"); + sb.append(" eventPlatforms: ").append(toIndentedString(eventPlatforms)).append("\n"); + sb.append(" journeys: ").append(toIndentedString(journeys)).append("\n"); + sb.append(" referenceTables: ").append(toIndentedString(referenceTables)).append("\n"); + sb.append(" _static: ").append(toIndentedString(_static)).append("\n"); + sb.append(" templates: ").append(toIndentedString(templates)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RumSegmentDeleteAttributes.java b/src/main/java/com/datadog/api/client/v2/model/RumSegmentDeleteAttributes.java new file mode 100644 index 00000000000..9b9d07ae47d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RumSegmentDeleteAttributes.java @@ -0,0 +1,233 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Attributes of a deleted segment response. */ +@JsonPropertyOrder({ + RumSegmentDeleteAttributes.JSON_PROPERTY_DISABLED_AT, + RumSegmentDeleteAttributes.JSON_PROPERTY_DISABLED_BY, + RumSegmentDeleteAttributes.JSON_PROPERTY_NAME, + RumSegmentDeleteAttributes.JSON_PROPERTY_UUID +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RumSegmentDeleteAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DISABLED_AT = "disabled_at"; + private OffsetDateTime disabledAt; + + public static final String JSON_PROPERTY_DISABLED_BY = "disabled_by"; + private RumSegmentUser disabledBy; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_UUID = "uuid"; + private String uuid; + + public RumSegmentDeleteAttributes() {} + + @JsonCreator + public RumSegmentDeleteAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_DISABLED_AT) OffsetDateTime disabledAt, + @JsonProperty(required = true, value = JSON_PROPERTY_DISABLED_BY) RumSegmentUser disabledBy, + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, + @JsonProperty(required = true, value = JSON_PROPERTY_UUID) String uuid) { + this.disabledAt = disabledAt; + this.disabledBy = disabledBy; + this.unparsed |= disabledBy.unparsed; + this.name = name; + this.uuid = uuid; + } + + public RumSegmentDeleteAttributes disabledAt(OffsetDateTime disabledAt) { + this.disabledAt = disabledAt; + return this; + } + + /** + * The timestamp when the segment was disabled in RFC 3339 format. + * + * @return disabledAt + */ + @JsonProperty(JSON_PROPERTY_DISABLED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OffsetDateTime getDisabledAt() { + return disabledAt; + } + + public void setDisabledAt(OffsetDateTime disabledAt) { + this.disabledAt = disabledAt; + } + + public RumSegmentDeleteAttributes disabledBy(RumSegmentUser disabledBy) { + this.disabledBy = disabledBy; + this.unparsed |= disabledBy.unparsed; + return this; + } + + /** + * A user who performed an action on a segment. + * + * @return disabledBy + */ + @JsonProperty(JSON_PROPERTY_DISABLED_BY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public RumSegmentUser getDisabledBy() { + return disabledBy; + } + + public void setDisabledBy(RumSegmentUser disabledBy) { + this.disabledBy = disabledBy; + } + + public RumSegmentDeleteAttributes name(String name) { + this.name = name; + return this; + } + + /** + * The name of the deleted segment. + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public RumSegmentDeleteAttributes uuid(String uuid) { + this.uuid = uuid; + return this; + } + + /** + * The unique identifier of the deleted segment. + * + * @return uuid + */ + @JsonProperty(JSON_PROPERTY_UUID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getUuid() { + return uuid; + } + + public void setUuid(String uuid) { + this.uuid = uuid; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return RumSegmentDeleteAttributes + */ + @JsonAnySetter + public RumSegmentDeleteAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this RumSegmentDeleteAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RumSegmentDeleteAttributes rumSegmentDeleteAttributes = (RumSegmentDeleteAttributes) o; + return Objects.equals(this.disabledAt, rumSegmentDeleteAttributes.disabledAt) + && Objects.equals(this.disabledBy, rumSegmentDeleteAttributes.disabledBy) + && Objects.equals(this.name, rumSegmentDeleteAttributes.name) + && Objects.equals(this.uuid, rumSegmentDeleteAttributes.uuid) + && Objects.equals( + this.additionalProperties, rumSegmentDeleteAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(disabledAt, disabledBy, name, uuid, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RumSegmentDeleteAttributes {\n"); + sb.append(" disabledAt: ").append(toIndentedString(disabledAt)).append("\n"); + sb.append(" disabledBy: ").append(toIndentedString(disabledBy)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RumSegmentDeleteData.java b/src/main/java/com/datadog/api/client/v2/model/RumSegmentDeleteData.java new file mode 100644 index 00000000000..64e3fc77c9c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RumSegmentDeleteData.java @@ -0,0 +1,209 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data object for a deleted segment response. */ +@JsonPropertyOrder({ + RumSegmentDeleteData.JSON_PROPERTY_ATTRIBUTES, + RumSegmentDeleteData.JSON_PROPERTY_ID, + RumSegmentDeleteData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RumSegmentDeleteData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private RumSegmentDeleteAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private RumSegmentDeleteType type; + + public RumSegmentDeleteData() {} + + @JsonCreator + public RumSegmentDeleteData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + RumSegmentDeleteAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) RumSegmentDeleteType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public RumSegmentDeleteData attributes(RumSegmentDeleteAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of a deleted segment response. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public RumSegmentDeleteAttributes getAttributes() { + return attributes; + } + + public void setAttributes(RumSegmentDeleteAttributes attributes) { + this.attributes = attributes; + } + + public RumSegmentDeleteData id(String id) { + this.id = id; + return this; + } + + /** + * Unique identifier for the deleted segment. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public RumSegmentDeleteData type(RumSegmentDeleteType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Type of the deleted segment resource. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public RumSegmentDeleteType getType() { + return type; + } + + public void setType(RumSegmentDeleteType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return RumSegmentDeleteData + */ + @JsonAnySetter + public RumSegmentDeleteData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this RumSegmentDeleteData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RumSegmentDeleteData rumSegmentDeleteData = (RumSegmentDeleteData) o; + return Objects.equals(this.attributes, rumSegmentDeleteData.attributes) + && Objects.equals(this.id, rumSegmentDeleteData.id) + && Objects.equals(this.type, rumSegmentDeleteData.type) + && Objects.equals(this.additionalProperties, rumSegmentDeleteData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RumSegmentDeleteData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RumSegmentDeleteResponse.java b/src/main/java/com/datadog/api/client/v2/model/RumSegmentDeleteResponse.java new file mode 100644 index 00000000000..3073d9bbd29 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RumSegmentDeleteResponse.java @@ -0,0 +1,145 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Response for a segment deletion. */ +@JsonPropertyOrder({RumSegmentDeleteResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RumSegmentDeleteResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private RumSegmentDeleteData data; + + public RumSegmentDeleteResponse() {} + + @JsonCreator + public RumSegmentDeleteResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) RumSegmentDeleteData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public RumSegmentDeleteResponse data(RumSegmentDeleteData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data object for a deleted segment response. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public RumSegmentDeleteData getData() { + return data; + } + + public void setData(RumSegmentDeleteData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return RumSegmentDeleteResponse + */ + @JsonAnySetter + public RumSegmentDeleteResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this RumSegmentDeleteResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RumSegmentDeleteResponse rumSegmentDeleteResponse = (RumSegmentDeleteResponse) o; + return Objects.equals(this.data, rumSegmentDeleteResponse.data) + && Objects.equals(this.additionalProperties, rumSegmentDeleteResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RumSegmentDeleteResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RumSegmentDeleteType.java b/src/main/java/com/datadog/api/client/v2/model/RumSegmentDeleteType.java new file mode 100644 index 00000000000..15c7ef7d5a3 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RumSegmentDeleteType.java @@ -0,0 +1,56 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Type of the deleted segment resource. */ +@JsonSerialize(using = RumSegmentDeleteType.RumSegmentDeleteTypeSerializer.class) +public class RumSegmentDeleteType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("deleted_segment")); + + public static final RumSegmentDeleteType DELETED_SEGMENT = + new RumSegmentDeleteType("deleted_segment"); + + RumSegmentDeleteType(String value) { + super(value, allowedValues); + } + + public static class RumSegmentDeleteTypeSerializer extends StdSerializer { + public RumSegmentDeleteTypeSerializer(Class t) { + super(t); + } + + public RumSegmentDeleteTypeSerializer() { + this(null); + } + + @Override + public void serialize( + RumSegmentDeleteType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static RumSegmentDeleteType fromValue(String value) { + return new RumSegmentDeleteType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RumSegmentEventPlatform.java b/src/main/java/com/datadog/api/client/v2/model/RumSegmentEventPlatform.java new file mode 100644 index 00000000000..5caa57f2e2a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RumSegmentEventPlatform.java @@ -0,0 +1,255 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** An event platform query block within a segment data query. */ +@JsonPropertyOrder({ + RumSegmentEventPlatform.JSON_PROPERTY_FACET, + RumSegmentEventPlatform.JSON_PROPERTY_FROM, + RumSegmentEventPlatform.JSON_PROPERTY_NAME, + RumSegmentEventPlatform.JSON_PROPERTY_QUERY, + RumSegmentEventPlatform.JSON_PROPERTY_TO +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RumSegmentEventPlatform { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_FACET = "facet"; + private String facet; + + public static final String JSON_PROPERTY_FROM = "from"; + private Long from; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_QUERY = "query"; + private String query; + + public static final String JSON_PROPERTY_TO = "to"; + private Long to; + + public RumSegmentEventPlatform() {} + + @JsonCreator + public RumSegmentEventPlatform( + @JsonProperty(required = true, value = JSON_PROPERTY_FACET) String facet, + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, + @JsonProperty(required = true, value = JSON_PROPERTY_QUERY) String query) { + this.facet = facet; + this.name = name; + this.query = query; + } + + public RumSegmentEventPlatform facet(String facet) { + this.facet = facet; + return this; + } + + /** + * The facet to extract user identifiers from. + * + * @return facet + */ + @JsonProperty(JSON_PROPERTY_FACET) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getFacet() { + return facet; + } + + public void setFacet(String facet) { + this.facet = facet; + } + + public RumSegmentEventPlatform from(Long from) { + this.from = from; + return this; + } + + /** + * The start of the time range in milliseconds since epoch. + * + * @return from + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FROM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getFrom() { + return from; + } + + public void setFrom(Long from) { + this.from = from; + } + + public RumSegmentEventPlatform name(String name) { + this.name = name; + return this; + } + + /** + * The name of this query block. + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public RumSegmentEventPlatform query(String query) { + this.query = query; + return this; + } + + /** + * The search query for filtering events. + * + * @return query + */ + @JsonProperty(JSON_PROPERTY_QUERY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getQuery() { + return query; + } + + public void setQuery(String query) { + this.query = query; + } + + public RumSegmentEventPlatform to(Long to) { + this.to = to; + return this; + } + + /** + * The end of the time range in milliseconds since epoch. + * + * @return to + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getTo() { + return to; + } + + public void setTo(Long to) { + this.to = to; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return RumSegmentEventPlatform + */ + @JsonAnySetter + public RumSegmentEventPlatform putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this RumSegmentEventPlatform object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RumSegmentEventPlatform rumSegmentEventPlatform = (RumSegmentEventPlatform) o; + return Objects.equals(this.facet, rumSegmentEventPlatform.facet) + && Objects.equals(this.from, rumSegmentEventPlatform.from) + && Objects.equals(this.name, rumSegmentEventPlatform.name) + && Objects.equals(this.query, rumSegmentEventPlatform.query) + && Objects.equals(this.to, rumSegmentEventPlatform.to) + && Objects.equals(this.additionalProperties, rumSegmentEventPlatform.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(facet, from, name, query, to, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RumSegmentEventPlatform {\n"); + sb.append(" facet: ").append(toIndentedString(facet)).append("\n"); + sb.append(" from: ").append(toIndentedString(from)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" query: ").append(toIndentedString(query)).append("\n"); + sb.append(" to: ").append(toIndentedString(to)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RumSegmentJourney.java b/src/main/java/com/datadog/api/client/v2/model/RumSegmentJourney.java new file mode 100644 index 00000000000..7684780eadd --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RumSegmentJourney.java @@ -0,0 +1,218 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** A journey-based query block within a segment data query. */ +@JsonPropertyOrder({ + RumSegmentJourney.JSON_PROPERTY_CONVERSION_TYPE, + RumSegmentJourney.JSON_PROPERTY_GROUP_BY, + RumSegmentJourney.JSON_PROPERTY_NAME, + RumSegmentJourney.JSON_PROPERTY_SEARCH +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RumSegmentJourney { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CONVERSION_TYPE = "conversion_type"; + private String conversionType; + + public static final String JSON_PROPERTY_GROUP_BY = "group_by"; + private String groupBy; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_SEARCH = "search"; + private String search; + + public RumSegmentJourney conversionType(String conversionType) { + this.conversionType = conversionType; + return this; + } + + /** + * The type of conversion to track. + * + * @return conversionType + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONVERSION_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getConversionType() { + return conversionType; + } + + public void setConversionType(String conversionType) { + this.conversionType = conversionType; + } + + public RumSegmentJourney groupBy(String groupBy) { + this.groupBy = groupBy; + return this; + } + + /** + * The facet to group journey results by. + * + * @return groupBy + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_GROUP_BY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getGroupBy() { + return groupBy; + } + + public void setGroupBy(String groupBy) { + this.groupBy = groupBy; + } + + public RumSegmentJourney name(String name) { + this.name = name; + return this; + } + + /** + * The name of this journey query block. + * + * @return name + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public RumSegmentJourney search(String search) { + this.search = search; + return this; + } + + /** + * The search query for filtering events. + * + * @return search + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SEARCH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSearch() { + return search; + } + + public void setSearch(String search) { + this.search = search; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return RumSegmentJourney + */ + @JsonAnySetter + public RumSegmentJourney putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this RumSegmentJourney object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RumSegmentJourney rumSegmentJourney = (RumSegmentJourney) o; + return Objects.equals(this.conversionType, rumSegmentJourney.conversionType) + && Objects.equals(this.groupBy, rumSegmentJourney.groupBy) + && Objects.equals(this.name, rumSegmentJourney.name) + && Objects.equals(this.search, rumSegmentJourney.search) + && Objects.equals(this.additionalProperties, rumSegmentJourney.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(conversionType, groupBy, name, search, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RumSegmentJourney {\n"); + sb.append(" conversionType: ").append(toIndentedString(conversionType)).append("\n"); + sb.append(" groupBy: ").append(toIndentedString(groupBy)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" search: ").append(toIndentedString(search)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RumSegmentListResponse.java b/src/main/java/com/datadog/api/client/v2/model/RumSegmentListResponse.java new file mode 100644 index 00000000000..44948ff5394 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RumSegmentListResponse.java @@ -0,0 +1,155 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Response for listing segments. */ +@JsonPropertyOrder({RumSegmentListResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RumSegmentListResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public RumSegmentListResponse() {} + + @JsonCreator + public RumSegmentListResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + List data) { + this.data = data; + } + + public RumSegmentListResponse data(List data) { + this.data = data; + for (RumSegmentResponseData item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public RumSegmentListResponse addDataItem(RumSegmentResponseData dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * The list of segments. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return RumSegmentListResponse + */ + @JsonAnySetter + public RumSegmentListResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this RumSegmentListResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RumSegmentListResponse rumSegmentListResponse = (RumSegmentListResponse) o; + return Objects.equals(this.data, rumSegmentListResponse.data) + && Objects.equals(this.additionalProperties, rumSegmentListResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RumSegmentListResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RumSegmentReferenceTable.java b/src/main/java/com/datadog/api/client/v2/model/RumSegmentReferenceTable.java new file mode 100644 index 00000000000..b0f31cfebe7 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RumSegmentReferenceTable.java @@ -0,0 +1,272 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** A reference table query block within a segment data query. */ +@JsonPropertyOrder({ + RumSegmentReferenceTable.JSON_PROPERTY_COLUMNS, + RumSegmentReferenceTable.JSON_PROPERTY_FILTER_QUERY, + RumSegmentReferenceTable.JSON_PROPERTY_JOIN_CONDITION, + RumSegmentReferenceTable.JSON_PROPERTY_NAME, + RumSegmentReferenceTable.JSON_PROPERTY_TABLE_NAME +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RumSegmentReferenceTable { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_COLUMNS = "columns"; + private List columns = new ArrayList<>(); + + public static final String JSON_PROPERTY_FILTER_QUERY = "filter_query"; + private String filterQuery; + + public static final String JSON_PROPERTY_JOIN_CONDITION = "join_condition"; + private RumSegmentReferenceTableJoinCondition joinCondition; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_TABLE_NAME = "table_name"; + private String tableName; + + public RumSegmentReferenceTable() {} + + @JsonCreator + public RumSegmentReferenceTable( + @JsonProperty(required = true, value = JSON_PROPERTY_COLUMNS) + List columns, + @JsonProperty(required = true, value = JSON_PROPERTY_JOIN_CONDITION) + RumSegmentReferenceTableJoinCondition joinCondition, + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, + @JsonProperty(required = true, value = JSON_PROPERTY_TABLE_NAME) String tableName) { + this.columns = columns; + this.joinCondition = joinCondition; + this.unparsed |= joinCondition.unparsed; + this.name = name; + this.tableName = tableName; + } + + public RumSegmentReferenceTable columns(List columns) { + this.columns = columns; + for (RumSegmentReferenceTableColumn item : columns) { + this.unparsed |= item.unparsed; + } + return this; + } + + public RumSegmentReferenceTable addColumnsItem(RumSegmentReferenceTableColumn columnsItem) { + this.columns.add(columnsItem); + this.unparsed |= columnsItem.unparsed; + return this; + } + + /** + * The columns to include from the reference table. + * + * @return columns + */ + @JsonProperty(JSON_PROPERTY_COLUMNS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getColumns() { + return columns; + } + + public void setColumns(List columns) { + this.columns = columns; + } + + public RumSegmentReferenceTable filterQuery(String filterQuery) { + this.filterQuery = filterQuery; + return this; + } + + /** + * An optional filter query for the reference table data. + * + * @return filterQuery + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILTER_QUERY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFilterQuery() { + return filterQuery; + } + + public void setFilterQuery(String filterQuery) { + this.filterQuery = filterQuery; + } + + public RumSegmentReferenceTable joinCondition( + RumSegmentReferenceTableJoinCondition joinCondition) { + this.joinCondition = joinCondition; + this.unparsed |= joinCondition.unparsed; + return this; + } + + /** + * The join condition for a reference table query block. + * + * @return joinCondition + */ + @JsonProperty(JSON_PROPERTY_JOIN_CONDITION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public RumSegmentReferenceTableJoinCondition getJoinCondition() { + return joinCondition; + } + + public void setJoinCondition(RumSegmentReferenceTableJoinCondition joinCondition) { + this.joinCondition = joinCondition; + } + + public RumSegmentReferenceTable name(String name) { + this.name = name; + return this; + } + + /** + * The name of this query block. + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public RumSegmentReferenceTable tableName(String tableName) { + this.tableName = tableName; + return this; + } + + /** + * The name of the reference table. + * + * @return tableName + */ + @JsonProperty(JSON_PROPERTY_TABLE_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getTableName() { + return tableName; + } + + public void setTableName(String tableName) { + this.tableName = tableName; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return RumSegmentReferenceTable + */ + @JsonAnySetter + public RumSegmentReferenceTable putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this RumSegmentReferenceTable object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RumSegmentReferenceTable rumSegmentReferenceTable = (RumSegmentReferenceTable) o; + return Objects.equals(this.columns, rumSegmentReferenceTable.columns) + && Objects.equals(this.filterQuery, rumSegmentReferenceTable.filterQuery) + && Objects.equals(this.joinCondition, rumSegmentReferenceTable.joinCondition) + && Objects.equals(this.name, rumSegmentReferenceTable.name) + && Objects.equals(this.tableName, rumSegmentReferenceTable.tableName) + && Objects.equals(this.additionalProperties, rumSegmentReferenceTable.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(columns, filterQuery, joinCondition, name, tableName, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RumSegmentReferenceTable {\n"); + sb.append(" columns: ").append(toIndentedString(columns)).append("\n"); + sb.append(" filterQuery: ").append(toIndentedString(filterQuery)).append("\n"); + sb.append(" joinCondition: ").append(toIndentedString(joinCondition)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" tableName: ").append(toIndentedString(tableName)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RumSegmentReferenceTableColumn.java b/src/main/java/com/datadog/api/client/v2/model/RumSegmentReferenceTableColumn.java new file mode 100644 index 00000000000..d3296b45cc8 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RumSegmentReferenceTableColumn.java @@ -0,0 +1,145 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** A column definition in a reference table query block. */ +@JsonPropertyOrder({RumSegmentReferenceTableColumn.JSON_PROPERTY_NAME}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RumSegmentReferenceTableColumn { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public RumSegmentReferenceTableColumn() {} + + @JsonCreator + public RumSegmentReferenceTableColumn( + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name) { + this.name = name; + } + + public RumSegmentReferenceTableColumn name(String name) { + this.name = name; + return this; + } + + /** + * The name of the column. + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return RumSegmentReferenceTableColumn + */ + @JsonAnySetter + public RumSegmentReferenceTableColumn putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this RumSegmentReferenceTableColumn object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RumSegmentReferenceTableColumn rumSegmentReferenceTableColumn = + (RumSegmentReferenceTableColumn) o; + return Objects.equals(this.name, rumSegmentReferenceTableColumn.name) + && Objects.equals( + this.additionalProperties, rumSegmentReferenceTableColumn.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RumSegmentReferenceTableColumn {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RumSegmentReferenceTableJoinCondition.java b/src/main/java/com/datadog/api/client/v2/model/RumSegmentReferenceTableJoinCondition.java new file mode 100644 index 00000000000..9795f14dc2b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RumSegmentReferenceTableJoinCondition.java @@ -0,0 +1,175 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The join condition for a reference table query block. */ +@JsonPropertyOrder({ + RumSegmentReferenceTableJoinCondition.JSON_PROPERTY_COLUMN_NAME, + RumSegmentReferenceTableJoinCondition.JSON_PROPERTY_FACET +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RumSegmentReferenceTableJoinCondition { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_COLUMN_NAME = "column_name"; + private String columnName; + + public static final String JSON_PROPERTY_FACET = "facet"; + private String facet; + + public RumSegmentReferenceTableJoinCondition() {} + + @JsonCreator + public RumSegmentReferenceTableJoinCondition( + @JsonProperty(required = true, value = JSON_PROPERTY_COLUMN_NAME) String columnName, + @JsonProperty(required = true, value = JSON_PROPERTY_FACET) String facet) { + this.columnName = columnName; + this.facet = facet; + } + + public RumSegmentReferenceTableJoinCondition columnName(String columnName) { + this.columnName = columnName; + return this; + } + + /** + * The reference table column to join on. + * + * @return columnName + */ + @JsonProperty(JSON_PROPERTY_COLUMN_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getColumnName() { + return columnName; + } + + public void setColumnName(String columnName) { + this.columnName = columnName; + } + + public RumSegmentReferenceTableJoinCondition facet(String facet) { + this.facet = facet; + return this; + } + + /** + * The RUM facet to join on. + * + * @return facet + */ + @JsonProperty(JSON_PROPERTY_FACET) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getFacet() { + return facet; + } + + public void setFacet(String facet) { + this.facet = facet; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return RumSegmentReferenceTableJoinCondition + */ + @JsonAnySetter + public RumSegmentReferenceTableJoinCondition putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this RumSegmentReferenceTableJoinCondition object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RumSegmentReferenceTableJoinCondition rumSegmentReferenceTableJoinCondition = + (RumSegmentReferenceTableJoinCondition) o; + return Objects.equals(this.columnName, rumSegmentReferenceTableJoinCondition.columnName) + && Objects.equals(this.facet, rumSegmentReferenceTableJoinCondition.facet) + && Objects.equals( + this.additionalProperties, rumSegmentReferenceTableJoinCondition.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(columnName, facet, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RumSegmentReferenceTableJoinCondition {\n"); + sb.append(" columnName: ").append(toIndentedString(columnName)).append("\n"); + sb.append(" facet: ").append(toIndentedString(facet)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RumSegmentResourceType.java b/src/main/java/com/datadog/api/client/v2/model/RumSegmentResourceType.java new file mode 100644 index 00000000000..2374a342079 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RumSegmentResourceType.java @@ -0,0 +1,55 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Type of the segment resource. */ +@JsonSerialize(using = RumSegmentResourceType.RumSegmentResourceTypeSerializer.class) +public class RumSegmentResourceType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("segment")); + + public static final RumSegmentResourceType SEGMENT = new RumSegmentResourceType("segment"); + + RumSegmentResourceType(String value) { + super(value, allowedValues); + } + + public static class RumSegmentResourceTypeSerializer + extends StdSerializer { + public RumSegmentResourceTypeSerializer(Class t) { + super(t); + } + + public RumSegmentResourceTypeSerializer() { + this(null); + } + + @Override + public void serialize( + RumSegmentResourceType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static RumSegmentResourceType fromValue(String value) { + return new RumSegmentResourceType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RumSegmentResponse.java b/src/main/java/com/datadog/api/client/v2/model/RumSegmentResponse.java new file mode 100644 index 00000000000..0ff781523de --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RumSegmentResponse.java @@ -0,0 +1,145 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Response containing a single segment. */ +@JsonPropertyOrder({RumSegmentResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RumSegmentResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private RumSegmentResponseData data; + + public RumSegmentResponse() {} + + @JsonCreator + public RumSegmentResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) RumSegmentResponseData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public RumSegmentResponse data(RumSegmentResponseData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data object for a segment in a response. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public RumSegmentResponseData getData() { + return data; + } + + public void setData(RumSegmentResponseData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return RumSegmentResponse + */ + @JsonAnySetter + public RumSegmentResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this RumSegmentResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RumSegmentResponse rumSegmentResponse = (RumSegmentResponse) o; + return Objects.equals(this.data, rumSegmentResponse.data) + && Objects.equals(this.additionalProperties, rumSegmentResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RumSegmentResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RumSegmentResponseAttributes.java b/src/main/java/com/datadog/api/client/v2/model/RumSegmentResponseAttributes.java new file mode 100644 index 00000000000..ce8362cbc90 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RumSegmentResponseAttributes.java @@ -0,0 +1,551 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Attributes of a segment in a response. */ +@JsonPropertyOrder({ + RumSegmentResponseAttributes.JSON_PROPERTY_CREATED_AT, + RumSegmentResponseAttributes.JSON_PROPERTY_CREATED_BY, + RumSegmentResponseAttributes.JSON_PROPERTY_DATA_QUERY, + RumSegmentResponseAttributes.JSON_PROPERTY_DESCRIPTION, + RumSegmentResponseAttributes.JSON_PROPERTY_MODIFIED_AT, + RumSegmentResponseAttributes.JSON_PROPERTY_MODIFIED_BY, + RumSegmentResponseAttributes.JSON_PROPERTY_NAME, + RumSegmentResponseAttributes.JSON_PROPERTY_ORG_ID, + RumSegmentResponseAttributes.JSON_PROPERTY_ROW_COUNT, + RumSegmentResponseAttributes.JSON_PROPERTY_SOURCE, + RumSegmentResponseAttributes.JSON_PROPERTY_TAGS, + RumSegmentResponseAttributes.JSON_PROPERTY_TYPE, + RumSegmentResponseAttributes.JSON_PROPERTY_UUID, + RumSegmentResponseAttributes.JSON_PROPERTY_VERSION +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RumSegmentResponseAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + private OffsetDateTime createdAt; + + public static final String JSON_PROPERTY_CREATED_BY = "created_by"; + private RumSegmentUser createdBy; + + public static final String JSON_PROPERTY_DATA_QUERY = "data_query"; + private RumSegmentDataQuery dataQuery; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_MODIFIED_AT = "modified_at"; + private OffsetDateTime modifiedAt; + + public static final String JSON_PROPERTY_MODIFIED_BY = "modified_by"; + private RumSegmentUser modifiedBy; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_ORG_ID = "org_id"; + private Long orgId; + + public static final String JSON_PROPERTY_ROW_COUNT = "row_count"; + private Long rowCount; + + public static final String JSON_PROPERTY_SOURCE = "source"; + private RumSegmentSource source; + + public static final String JSON_PROPERTY_TAGS = "tags"; + private List tags = new ArrayList<>(); + + public static final String JSON_PROPERTY_TYPE = "type"; + private RumSegmentSegmentType type; + + public static final String JSON_PROPERTY_UUID = "uuid"; + private String uuid; + + public static final String JSON_PROPERTY_VERSION = "version"; + private Long version; + + public RumSegmentResponseAttributes() {} + + @JsonCreator + public RumSegmentResponseAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_CREATED_AT) OffsetDateTime createdAt, + @JsonProperty(required = true, value = JSON_PROPERTY_CREATED_BY) RumSegmentUser createdBy, + @JsonProperty(required = true, value = JSON_PROPERTY_DATA_QUERY) + RumSegmentDataQuery dataQuery, + @JsonProperty(required = true, value = JSON_PROPERTY_DESCRIPTION) String description, + @JsonProperty(required = true, value = JSON_PROPERTY_MODIFIED_AT) OffsetDateTime modifiedAt, + @JsonProperty(required = true, value = JSON_PROPERTY_MODIFIED_BY) RumSegmentUser modifiedBy, + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, + @JsonProperty(required = true, value = JSON_PROPERTY_ORG_ID) Long orgId, + @JsonProperty(required = true, value = JSON_PROPERTY_ROW_COUNT) Long rowCount, + @JsonProperty(required = true, value = JSON_PROPERTY_SOURCE) RumSegmentSource source, + @JsonProperty(required = true, value = JSON_PROPERTY_TAGS) List tags, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) RumSegmentSegmentType type, + @JsonProperty(required = true, value = JSON_PROPERTY_UUID) String uuid, + @JsonProperty(required = true, value = JSON_PROPERTY_VERSION) Long version) { + this.createdAt = createdAt; + this.createdBy = createdBy; + this.unparsed |= createdBy.unparsed; + this.dataQuery = dataQuery; + this.unparsed |= dataQuery.unparsed; + this.description = description; + this.modifiedAt = modifiedAt; + this.modifiedBy = modifiedBy; + this.unparsed |= modifiedBy.unparsed; + this.name = name; + this.orgId = orgId; + this.rowCount = rowCount; + this.source = source; + this.unparsed |= !source.isValid(); + this.tags = tags; + this.type = type; + this.unparsed |= !type.isValid(); + this.uuid = uuid; + this.version = version; + } + + public RumSegmentResponseAttributes createdAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * The creation timestamp in RFC 3339 format. + * + * @return createdAt + */ + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + public RumSegmentResponseAttributes createdBy(RumSegmentUser createdBy) { + this.createdBy = createdBy; + this.unparsed |= createdBy.unparsed; + return this; + } + + /** + * A user who performed an action on a segment. + * + * @return createdBy + */ + @JsonProperty(JSON_PROPERTY_CREATED_BY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public RumSegmentUser getCreatedBy() { + return createdBy; + } + + public void setCreatedBy(RumSegmentUser createdBy) { + this.createdBy = createdBy; + } + + public RumSegmentResponseAttributes dataQuery(RumSegmentDataQuery dataQuery) { + this.dataQuery = dataQuery; + this.unparsed |= dataQuery.unparsed; + return this; + } + + /** + * Query definition for the segment. Contains one or more query blocks and an optional combination + * formula. + * + * @return dataQuery + */ + @JsonProperty(JSON_PROPERTY_DATA_QUERY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public RumSegmentDataQuery getDataQuery() { + return dataQuery; + } + + public void setDataQuery(RumSegmentDataQuery dataQuery) { + this.dataQuery = dataQuery; + } + + public RumSegmentResponseAttributes description(String description) { + this.description = description; + return this; + } + + /** + * A description of the segment. + * + * @return description + */ + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public RumSegmentResponseAttributes modifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = modifiedAt; + return this; + } + + /** + * The last modification timestamp in RFC 3339 format. + * + * @return modifiedAt + */ + @JsonProperty(JSON_PROPERTY_MODIFIED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OffsetDateTime getModifiedAt() { + return modifiedAt; + } + + public void setModifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = modifiedAt; + } + + public RumSegmentResponseAttributes modifiedBy(RumSegmentUser modifiedBy) { + this.modifiedBy = modifiedBy; + this.unparsed |= modifiedBy.unparsed; + return this; + } + + /** + * A user who performed an action on a segment. + * + * @return modifiedBy + */ + @JsonProperty(JSON_PROPERTY_MODIFIED_BY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public RumSegmentUser getModifiedBy() { + return modifiedBy; + } + + public void setModifiedBy(RumSegmentUser modifiedBy) { + this.modifiedBy = modifiedBy; + } + + public RumSegmentResponseAttributes name(String name) { + this.name = name; + return this; + } + + /** + * The name of the segment. + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public RumSegmentResponseAttributes orgId(Long orgId) { + this.orgId = orgId; + return this; + } + + /** + * The organization identifier. + * + * @return orgId + */ + @JsonProperty(JSON_PROPERTY_ORG_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getOrgId() { + return orgId; + } + + public void setOrgId(Long orgId) { + this.orgId = orgId; + } + + public RumSegmentResponseAttributes rowCount(Long rowCount) { + this.rowCount = rowCount; + return this; + } + + /** + * The number of users in the segment. + * + * @return rowCount + */ + @JsonProperty(JSON_PROPERTY_ROW_COUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getRowCount() { + return rowCount; + } + + public void setRowCount(Long rowCount) { + this.rowCount = rowCount; + } + + public RumSegmentResponseAttributes source(RumSegmentSource source) { + this.source = source; + this.unparsed |= !source.isValid(); + return this; + } + + /** + * The source of a segment. + * + * @return source + */ + @JsonProperty(JSON_PROPERTY_SOURCE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public RumSegmentSource getSource() { + return source; + } + + public void setSource(RumSegmentSource source) { + if (!source.isValid()) { + this.unparsed = true; + } + this.source = source; + } + + public RumSegmentResponseAttributes tags(List tags) { + this.tags = tags; + return this; + } + + public RumSegmentResponseAttributes addTagsItem(String tagsItem) { + this.tags.add(tagsItem); + return this; + } + + /** + * A list of tags for the segment. + * + * @return tags + */ + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getTags() { + return tags; + } + + public void setTags(List tags) { + this.tags = tags; + } + + public RumSegmentResponseAttributes type(RumSegmentSegmentType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The type of a segment based on its data query configuration. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public RumSegmentSegmentType getType() { + return type; + } + + public void setType(RumSegmentSegmentType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + public RumSegmentResponseAttributes uuid(String uuid) { + this.uuid = uuid; + return this; + } + + /** + * The unique identifier of the segment. + * + * @return uuid + */ + @JsonProperty(JSON_PROPERTY_UUID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getUuid() { + return uuid; + } + + public void setUuid(String uuid) { + this.uuid = uuid; + } + + public RumSegmentResponseAttributes version(Long version) { + this.version = version; + return this; + } + + /** + * The version number of the segment. + * + * @return version + */ + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getVersion() { + return version; + } + + public void setVersion(Long version) { + this.version = version; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return RumSegmentResponseAttributes + */ + @JsonAnySetter + public RumSegmentResponseAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this RumSegmentResponseAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RumSegmentResponseAttributes rumSegmentResponseAttributes = (RumSegmentResponseAttributes) o; + return Objects.equals(this.createdAt, rumSegmentResponseAttributes.createdAt) + && Objects.equals(this.createdBy, rumSegmentResponseAttributes.createdBy) + && Objects.equals(this.dataQuery, rumSegmentResponseAttributes.dataQuery) + && Objects.equals(this.description, rumSegmentResponseAttributes.description) + && Objects.equals(this.modifiedAt, rumSegmentResponseAttributes.modifiedAt) + && Objects.equals(this.modifiedBy, rumSegmentResponseAttributes.modifiedBy) + && Objects.equals(this.name, rumSegmentResponseAttributes.name) + && Objects.equals(this.orgId, rumSegmentResponseAttributes.orgId) + && Objects.equals(this.rowCount, rumSegmentResponseAttributes.rowCount) + && Objects.equals(this.source, rumSegmentResponseAttributes.source) + && Objects.equals(this.tags, rumSegmentResponseAttributes.tags) + && Objects.equals(this.type, rumSegmentResponseAttributes.type) + && Objects.equals(this.uuid, rumSegmentResponseAttributes.uuid) + && Objects.equals(this.version, rumSegmentResponseAttributes.version) + && Objects.equals( + this.additionalProperties, rumSegmentResponseAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + createdAt, + createdBy, + dataQuery, + description, + modifiedAt, + modifiedBy, + name, + orgId, + rowCount, + source, + tags, + type, + uuid, + version, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RumSegmentResponseAttributes {\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); + sb.append(" dataQuery: ").append(toIndentedString(dataQuery)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" modifiedAt: ").append(toIndentedString(modifiedAt)).append("\n"); + sb.append(" modifiedBy: ").append(toIndentedString(modifiedBy)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" orgId: ").append(toIndentedString(orgId)).append("\n"); + sb.append(" rowCount: ").append(toIndentedString(rowCount)).append("\n"); + sb.append(" source: ").append(toIndentedString(source)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RumSegmentResponseData.java b/src/main/java/com/datadog/api/client/v2/model/RumSegmentResponseData.java new file mode 100644 index 00000000000..93f87b3fdc4 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RumSegmentResponseData.java @@ -0,0 +1,209 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data object for a segment in a response. */ +@JsonPropertyOrder({ + RumSegmentResponseData.JSON_PROPERTY_ATTRIBUTES, + RumSegmentResponseData.JSON_PROPERTY_ID, + RumSegmentResponseData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RumSegmentResponseData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private RumSegmentResponseAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private RumSegmentResourceType type; + + public RumSegmentResponseData() {} + + @JsonCreator + public RumSegmentResponseData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + RumSegmentResponseAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) RumSegmentResourceType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public RumSegmentResponseData attributes(RumSegmentResponseAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of a segment in a response. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public RumSegmentResponseAttributes getAttributes() { + return attributes; + } + + public void setAttributes(RumSegmentResponseAttributes attributes) { + this.attributes = attributes; + } + + public RumSegmentResponseData id(String id) { + this.id = id; + return this; + } + + /** + * The unique identifier of the segment. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public RumSegmentResponseData type(RumSegmentResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Type of the segment resource. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public RumSegmentResourceType getType() { + return type; + } + + public void setType(RumSegmentResourceType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return RumSegmentResponseData + */ + @JsonAnySetter + public RumSegmentResponseData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this RumSegmentResponseData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RumSegmentResponseData rumSegmentResponseData = (RumSegmentResponseData) o; + return Objects.equals(this.attributes, rumSegmentResponseData.attributes) + && Objects.equals(this.id, rumSegmentResponseData.id) + && Objects.equals(this.type, rumSegmentResponseData.type) + && Objects.equals(this.additionalProperties, rumSegmentResponseData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RumSegmentResponseData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RumSegmentSegmentType.java b/src/main/java/com/datadog/api/client/v2/model/RumSegmentSegmentType.java new file mode 100644 index 00000000000..9fa1b4c5b84 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RumSegmentSegmentType.java @@ -0,0 +1,69 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The type of a segment based on its data query configuration. */ +@JsonSerialize(using = RumSegmentSegmentType.RumSegmentSegmentTypeSerializer.class) +public class RumSegmentSegmentType extends ModelEnum { + + private static final Set allowedValues = + new HashSet( + Arrays.asList( + "static", + "event_platform", + "combination", + "journeys", + "reference_table", + "templates")); + + public static final RumSegmentSegmentType STATIC = new RumSegmentSegmentType("static"); + public static final RumSegmentSegmentType EVENT_PLATFORM = + new RumSegmentSegmentType("event_platform"); + public static final RumSegmentSegmentType COMBINATION = new RumSegmentSegmentType("combination"); + public static final RumSegmentSegmentType JOURNEYS = new RumSegmentSegmentType("journeys"); + public static final RumSegmentSegmentType REFERENCE_TABLE = + new RumSegmentSegmentType("reference_table"); + public static final RumSegmentSegmentType TEMPLATES = new RumSegmentSegmentType("templates"); + + RumSegmentSegmentType(String value) { + super(value, allowedValues); + } + + public static class RumSegmentSegmentTypeSerializer extends StdSerializer { + public RumSegmentSegmentTypeSerializer(Class t) { + super(t); + } + + public RumSegmentSegmentTypeSerializer() { + this(null); + } + + @Override + public void serialize( + RumSegmentSegmentType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static RumSegmentSegmentType fromValue(String value) { + return new RumSegmentSegmentType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RumSegmentSource.java b/src/main/java/com/datadog/api/client/v2/model/RumSegmentSource.java new file mode 100644 index 00000000000..7d9621fe254 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RumSegmentSource.java @@ -0,0 +1,55 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The source of a segment. */ +@JsonSerialize(using = RumSegmentSource.RumSegmentSourceSerializer.class) +public class RumSegmentSource extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("user_created", "initial")); + + public static final RumSegmentSource USER_CREATED = new RumSegmentSource("user_created"); + public static final RumSegmentSource INITIAL = new RumSegmentSource("initial"); + + RumSegmentSource(String value) { + super(value, allowedValues); + } + + public static class RumSegmentSourceSerializer extends StdSerializer { + public RumSegmentSourceSerializer(Class t) { + super(t); + } + + public RumSegmentSourceSerializer() { + this(null); + } + + @Override + public void serialize(RumSegmentSource value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static RumSegmentSource fromValue(String value) { + return new RumSegmentSource(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RumSegmentStaticEntry.java b/src/main/java/com/datadog/api/client/v2/model/RumSegmentStaticEntry.java new file mode 100644 index 00000000000..954ccf4d6ab --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RumSegmentStaticEntry.java @@ -0,0 +1,201 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** A static user list entry within a segment data query. */ +@JsonPropertyOrder({ + RumSegmentStaticEntry.JSON_PROPERTY_ID, + RumSegmentStaticEntry.JSON_PROPERTY_NAME, + RumSegmentStaticEntry.JSON_PROPERTY_USER_COUNT +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RumSegmentStaticEntry { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_USER_COUNT = "user_count"; + private Long userCount; + + public RumSegmentStaticEntry() {} + + @JsonCreator + public RumSegmentStaticEntry( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, + @JsonProperty(required = true, value = JSON_PROPERTY_USER_COUNT) Long userCount) { + this.id = id; + this.name = name; + this.userCount = userCount; + } + + public RumSegmentStaticEntry id(String id) { + this.id = id; + return this; + } + + /** + * The identifier of the static list. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public RumSegmentStaticEntry name(String name) { + this.name = name; + return this; + } + + /** + * The name of the static list. + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public RumSegmentStaticEntry userCount(Long userCount) { + this.userCount = userCount; + return this; + } + + /** + * The number of users in the static list. + * + * @return userCount + */ + @JsonProperty(JSON_PROPERTY_USER_COUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getUserCount() { + return userCount; + } + + public void setUserCount(Long userCount) { + this.userCount = userCount; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return RumSegmentStaticEntry + */ + @JsonAnySetter + public RumSegmentStaticEntry putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this RumSegmentStaticEntry object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RumSegmentStaticEntry rumSegmentStaticEntry = (RumSegmentStaticEntry) o; + return Objects.equals(this.id, rumSegmentStaticEntry.id) + && Objects.equals(this.name, rumSegmentStaticEntry.name) + && Objects.equals(this.userCount, rumSegmentStaticEntry.userCount) + && Objects.equals(this.additionalProperties, rumSegmentStaticEntry.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, userCount, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RumSegmentStaticEntry {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" userCount: ").append(toIndentedString(userCount)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RumSegmentTemplateInstance.java b/src/main/java/com/datadog/api/client/v2/model/RumSegmentTemplateInstance.java new file mode 100644 index 00000000000..f96269c005d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RumSegmentTemplateInstance.java @@ -0,0 +1,235 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** A template-based query block within a segment data query. */ +@JsonPropertyOrder({ + RumSegmentTemplateInstance.JSON_PROPERTY_FROM, + RumSegmentTemplateInstance.JSON_PROPERTY_PARAMETERS, + RumSegmentTemplateInstance.JSON_PROPERTY_TEMPLATE_ID, + RumSegmentTemplateInstance.JSON_PROPERTY_TO +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RumSegmentTemplateInstance { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_FROM = "from"; + private Long from; + + public static final String JSON_PROPERTY_PARAMETERS = "parameters"; + private Map parameters = null; + + public static final String JSON_PROPERTY_TEMPLATE_ID = "template_id"; + private String templateId; + + public static final String JSON_PROPERTY_TO = "to"; + private Long to; + + public RumSegmentTemplateInstance() {} + + @JsonCreator + public RumSegmentTemplateInstance( + @JsonProperty(required = true, value = JSON_PROPERTY_TEMPLATE_ID) String templateId) { + this.templateId = templateId; + } + + public RumSegmentTemplateInstance from(Long from) { + this.from = from; + return this; + } + + /** + * The start of the time range in milliseconds since epoch. + * + * @return from + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FROM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getFrom() { + return from; + } + + public void setFrom(Long from) { + this.from = from; + } + + public RumSegmentTemplateInstance parameters(Map parameters) { + this.parameters = parameters; + return this; + } + + public RumSegmentTemplateInstance putParametersItem(String key, String parametersItem) { + if (this.parameters == null) { + this.parameters = new HashMap<>(); + } + this.parameters.put(key, parametersItem); + return this; + } + + /** + * The template parameters as key-value pairs. + * + * @return parameters + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PARAMETERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getParameters() { + return parameters; + } + + public void setParameters(Map parameters) { + this.parameters = parameters; + } + + public RumSegmentTemplateInstance templateId(String templateId) { + this.templateId = templateId; + return this; + } + + /** + * The identifier of the template. + * + * @return templateId + */ + @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getTemplateId() { + return templateId; + } + + public void setTemplateId(String templateId) { + this.templateId = templateId; + } + + public RumSegmentTemplateInstance to(Long to) { + this.to = to; + return this; + } + + /** + * The end of the time range in milliseconds since epoch. + * + * @return to + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getTo() { + return to; + } + + public void setTo(Long to) { + this.to = to; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return RumSegmentTemplateInstance + */ + @JsonAnySetter + public RumSegmentTemplateInstance putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this RumSegmentTemplateInstance object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RumSegmentTemplateInstance rumSegmentTemplateInstance = (RumSegmentTemplateInstance) o; + return Objects.equals(this.from, rumSegmentTemplateInstance.from) + && Objects.equals(this.parameters, rumSegmentTemplateInstance.parameters) + && Objects.equals(this.templateId, rumSegmentTemplateInstance.templateId) + && Objects.equals(this.to, rumSegmentTemplateInstance.to) + && Objects.equals( + this.additionalProperties, rumSegmentTemplateInstance.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(from, parameters, templateId, to, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RumSegmentTemplateInstance {\n"); + sb.append(" from: ").append(toIndentedString(from)).append("\n"); + sb.append(" parameters: ").append(toIndentedString(parameters)).append("\n"); + sb.append(" templateId: ").append(toIndentedString(templateId)).append("\n"); + sb.append(" to: ").append(toIndentedString(to)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RumSegmentTemplateListResponse.java b/src/main/java/com/datadog/api/client/v2/model/RumSegmentTemplateListResponse.java new file mode 100644 index 00000000000..3acd632ef92 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RumSegmentTemplateListResponse.java @@ -0,0 +1,157 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Response for listing segment templates. */ +@JsonPropertyOrder({RumSegmentTemplateListResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RumSegmentTemplateListResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public RumSegmentTemplateListResponse() {} + + @JsonCreator + public RumSegmentTemplateListResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + List data) { + this.data = data; + } + + public RumSegmentTemplateListResponse data(List data) { + this.data = data; + for (RumSegmentTemplateResponseData item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public RumSegmentTemplateListResponse addDataItem(RumSegmentTemplateResponseData dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * The list of segment templates. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return RumSegmentTemplateListResponse + */ + @JsonAnySetter + public RumSegmentTemplateListResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this RumSegmentTemplateListResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RumSegmentTemplateListResponse rumSegmentTemplateListResponse = + (RumSegmentTemplateListResponse) o; + return Objects.equals(this.data, rumSegmentTemplateListResponse.data) + && Objects.equals( + this.additionalProperties, rumSegmentTemplateListResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RumSegmentTemplateListResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RumSegmentTemplateParameterDef.java b/src/main/java/com/datadog/api/client/v2/model/RumSegmentTemplateParameterDef.java new file mode 100644 index 00000000000..8d46e6a1af4 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RumSegmentTemplateParameterDef.java @@ -0,0 +1,203 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** A parameter definition for a segment template. */ +@JsonPropertyOrder({ + RumSegmentTemplateParameterDef.JSON_PROPERTY_DEFAULT, + RumSegmentTemplateParameterDef.JSON_PROPERTY_DESCRIPTION, + RumSegmentTemplateParameterDef.JSON_PROPERTY_VALIDATE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RumSegmentTemplateParameterDef { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DEFAULT = "default"; + private String _default; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_VALIDATE = "validate"; + private String validate; + + public RumSegmentTemplateParameterDef() {} + + @JsonCreator + public RumSegmentTemplateParameterDef( + @JsonProperty(required = true, value = JSON_PROPERTY_DEFAULT) String _default, + @JsonProperty(required = true, value = JSON_PROPERTY_DESCRIPTION) String description, + @JsonProperty(required = true, value = JSON_PROPERTY_VALIDATE) String validate) { + this._default = _default; + this.description = description; + this.validate = validate; + } + + public RumSegmentTemplateParameterDef _default(String _default) { + this._default = _default; + return this; + } + + /** + * The default value for the parameter. + * + * @return _default + */ + @JsonProperty(JSON_PROPERTY_DEFAULT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getDefault() { + return _default; + } + + public void setDefault(String _default) { + this._default = _default; + } + + public RumSegmentTemplateParameterDef description(String description) { + this.description = description; + return this; + } + + /** + * A description of the parameter. + * + * @return description + */ + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public RumSegmentTemplateParameterDef validate(String validate) { + this.validate = validate; + return this; + } + + /** + * Validation rules for the parameter. + * + * @return validate + */ + @JsonProperty(JSON_PROPERTY_VALIDATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getValidate() { + return validate; + } + + public void setValidate(String validate) { + this.validate = validate; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return RumSegmentTemplateParameterDef + */ + @JsonAnySetter + public RumSegmentTemplateParameterDef putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this RumSegmentTemplateParameterDef object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RumSegmentTemplateParameterDef rumSegmentTemplateParameterDef = + (RumSegmentTemplateParameterDef) o; + return Objects.equals(this._default, rumSegmentTemplateParameterDef._default) + && Objects.equals(this.description, rumSegmentTemplateParameterDef.description) + && Objects.equals(this.validate, rumSegmentTemplateParameterDef.validate) + && Objects.equals( + this.additionalProperties, rumSegmentTemplateParameterDef.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(_default, description, validate, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RumSegmentTemplateParameterDef {\n"); + sb.append(" _default: ").append(toIndentedString(_default)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" validate: ").append(toIndentedString(validate)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RumSegmentTemplateResourceType.java b/src/main/java/com/datadog/api/client/v2/model/RumSegmentTemplateResourceType.java new file mode 100644 index 00000000000..c5513f6f687 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RumSegmentTemplateResourceType.java @@ -0,0 +1,58 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Type of the segment template resource. */ +@JsonSerialize( + using = RumSegmentTemplateResourceType.RumSegmentTemplateResourceTypeSerializer.class) +public class RumSegmentTemplateResourceType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("template_metadata")); + + public static final RumSegmentTemplateResourceType TEMPLATE_METADATA = + new RumSegmentTemplateResourceType("template_metadata"); + + RumSegmentTemplateResourceType(String value) { + super(value, allowedValues); + } + + public static class RumSegmentTemplateResourceTypeSerializer + extends StdSerializer { + public RumSegmentTemplateResourceTypeSerializer(Class t) { + super(t); + } + + public RumSegmentTemplateResourceTypeSerializer() { + this(null); + } + + @Override + public void serialize( + RumSegmentTemplateResourceType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static RumSegmentTemplateResourceType fromValue(String value) { + return new RumSegmentTemplateResourceType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RumSegmentTemplateResponseAttributes.java b/src/main/java/com/datadog/api/client/v2/model/RumSegmentTemplateResponseAttributes.java new file mode 100644 index 00000000000..7714ff3cf0f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RumSegmentTemplateResponseAttributes.java @@ -0,0 +1,367 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Attributes of a segment template in a response. */ +@JsonPropertyOrder({ + RumSegmentTemplateResponseAttributes.JSON_PROPERTY_CATEGORY, + RumSegmentTemplateResponseAttributes.JSON_PROPERTY_CREATED_AT, + RumSegmentTemplateResponseAttributes.JSON_PROPERTY_DESCRIPTION, + RumSegmentTemplateResponseAttributes.JSON_PROPERTY_MODIFIED_AT, + RumSegmentTemplateResponseAttributes.JSON_PROPERTY_NAME, + RumSegmentTemplateResponseAttributes.JSON_PROPERTY_PARAMETERS, + RumSegmentTemplateResponseAttributes.JSON_PROPERTY_STATUS, + RumSegmentTemplateResponseAttributes.JSON_PROPERTY_VERSION +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RumSegmentTemplateResponseAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CATEGORY = "category"; + private String category; + + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + private OffsetDateTime createdAt; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_MODIFIED_AT = "modified_at"; + private OffsetDateTime modifiedAt; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_PARAMETERS = "parameters"; + private Map parameters = + new HashMap(); + + public static final String JSON_PROPERTY_STATUS = "status"; + private RumSegmentTemplateStatus status; + + public static final String JSON_PROPERTY_VERSION = "version"; + private Long version; + + public RumSegmentTemplateResponseAttributes() {} + + @JsonCreator + public RumSegmentTemplateResponseAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_CATEGORY) String category, + @JsonProperty(required = true, value = JSON_PROPERTY_CREATED_AT) OffsetDateTime createdAt, + @JsonProperty(required = true, value = JSON_PROPERTY_DESCRIPTION) String description, + @JsonProperty(required = true, value = JSON_PROPERTY_MODIFIED_AT) OffsetDateTime modifiedAt, + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, + @JsonProperty(required = true, value = JSON_PROPERTY_PARAMETERS) + Map parameters, + @JsonProperty(required = true, value = JSON_PROPERTY_STATUS) RumSegmentTemplateStatus status, + @JsonProperty(required = true, value = JSON_PROPERTY_VERSION) Long version) { + this.category = category; + this.createdAt = createdAt; + this.description = description; + this.modifiedAt = modifiedAt; + this.name = name; + this.parameters = parameters; + this.status = status; + this.unparsed |= !status.isValid(); + this.version = version; + } + + public RumSegmentTemplateResponseAttributes category(String category) { + this.category = category; + return this; + } + + /** + * The category of the template. + * + * @return category + */ + @JsonProperty(JSON_PROPERTY_CATEGORY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getCategory() { + return category; + } + + public void setCategory(String category) { + this.category = category; + } + + public RumSegmentTemplateResponseAttributes createdAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * The creation timestamp in RFC 3339 format. + * + * @return createdAt + */ + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + public RumSegmentTemplateResponseAttributes description(String description) { + this.description = description; + return this; + } + + /** + * A description of the template. + * + * @return description + */ + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public RumSegmentTemplateResponseAttributes modifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = modifiedAt; + return this; + } + + /** + * The last modification timestamp in RFC 3339 format. + * + * @return modifiedAt + */ + @JsonProperty(JSON_PROPERTY_MODIFIED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OffsetDateTime getModifiedAt() { + return modifiedAt; + } + + public void setModifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = modifiedAt; + } + + public RumSegmentTemplateResponseAttributes name(String name) { + this.name = name; + return this; + } + + /** + * The name of the template. + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public RumSegmentTemplateResponseAttributes parameters( + Map parameters) { + this.parameters = parameters; + return this; + } + + public RumSegmentTemplateResponseAttributes putParametersItem( + String key, RumSegmentTemplateParameterDef parametersItem) { + this.parameters.put(key, parametersItem); + return this; + } + + /** + * The template parameter definitions. + * + * @return parameters + */ + @JsonProperty(JSON_PROPERTY_PARAMETERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Map getParameters() { + return parameters; + } + + public void setParameters(Map parameters) { + this.parameters = parameters; + } + + public RumSegmentTemplateResponseAttributes status(RumSegmentTemplateStatus status) { + this.status = status; + this.unparsed |= !status.isValid(); + return this; + } + + /** + * The status of a segment template. + * + * @return status + */ + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public RumSegmentTemplateStatus getStatus() { + return status; + } + + public void setStatus(RumSegmentTemplateStatus status) { + if (!status.isValid()) { + this.unparsed = true; + } + this.status = status; + } + + public RumSegmentTemplateResponseAttributes version(Long version) { + this.version = version; + return this; + } + + /** + * The version number of the template. + * + * @return version + */ + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getVersion() { + return version; + } + + public void setVersion(Long version) { + this.version = version; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return RumSegmentTemplateResponseAttributes + */ + @JsonAnySetter + public RumSegmentTemplateResponseAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this RumSegmentTemplateResponseAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RumSegmentTemplateResponseAttributes rumSegmentTemplateResponseAttributes = + (RumSegmentTemplateResponseAttributes) o; + return Objects.equals(this.category, rumSegmentTemplateResponseAttributes.category) + && Objects.equals(this.createdAt, rumSegmentTemplateResponseAttributes.createdAt) + && Objects.equals(this.description, rumSegmentTemplateResponseAttributes.description) + && Objects.equals(this.modifiedAt, rumSegmentTemplateResponseAttributes.modifiedAt) + && Objects.equals(this.name, rumSegmentTemplateResponseAttributes.name) + && Objects.equals(this.parameters, rumSegmentTemplateResponseAttributes.parameters) + && Objects.equals(this.status, rumSegmentTemplateResponseAttributes.status) + && Objects.equals(this.version, rumSegmentTemplateResponseAttributes.version) + && Objects.equals( + this.additionalProperties, rumSegmentTemplateResponseAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + category, + createdAt, + description, + modifiedAt, + name, + parameters, + status, + version, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RumSegmentTemplateResponseAttributes {\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" modifiedAt: ").append(toIndentedString(modifiedAt)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" parameters: ").append(toIndentedString(parameters)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RumSegmentTemplateResponseData.java b/src/main/java/com/datadog/api/client/v2/model/RumSegmentTemplateResponseData.java new file mode 100644 index 00000000000..2243a8488bf --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RumSegmentTemplateResponseData.java @@ -0,0 +1,213 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data object for a segment template in a response. */ +@JsonPropertyOrder({ + RumSegmentTemplateResponseData.JSON_PROPERTY_ATTRIBUTES, + RumSegmentTemplateResponseData.JSON_PROPERTY_ID, + RumSegmentTemplateResponseData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RumSegmentTemplateResponseData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private RumSegmentTemplateResponseAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private RumSegmentTemplateResourceType type; + + public RumSegmentTemplateResponseData() {} + + @JsonCreator + public RumSegmentTemplateResponseData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + RumSegmentTemplateResponseAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + RumSegmentTemplateResourceType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public RumSegmentTemplateResponseData attributes( + RumSegmentTemplateResponseAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of a segment template in a response. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public RumSegmentTemplateResponseAttributes getAttributes() { + return attributes; + } + + public void setAttributes(RumSegmentTemplateResponseAttributes attributes) { + this.attributes = attributes; + } + + public RumSegmentTemplateResponseData id(String id) { + this.id = id; + return this; + } + + /** + * The unique identifier of the template. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public RumSegmentTemplateResponseData type(RumSegmentTemplateResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Type of the segment template resource. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public RumSegmentTemplateResourceType getType() { + return type; + } + + public void setType(RumSegmentTemplateResourceType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return RumSegmentTemplateResponseData + */ + @JsonAnySetter + public RumSegmentTemplateResponseData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this RumSegmentTemplateResponseData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RumSegmentTemplateResponseData rumSegmentTemplateResponseData = + (RumSegmentTemplateResponseData) o; + return Objects.equals(this.attributes, rumSegmentTemplateResponseData.attributes) + && Objects.equals(this.id, rumSegmentTemplateResponseData.id) + && Objects.equals(this.type, rumSegmentTemplateResponseData.type) + && Objects.equals( + this.additionalProperties, rumSegmentTemplateResponseData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RumSegmentTemplateResponseData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RumSegmentTemplateStatus.java b/src/main/java/com/datadog/api/client/v2/model/RumSegmentTemplateStatus.java new file mode 100644 index 00000000000..5125d2145e5 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RumSegmentTemplateStatus.java @@ -0,0 +1,59 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The status of a segment template. */ +@JsonSerialize(using = RumSegmentTemplateStatus.RumSegmentTemplateStatusSerializer.class) +public class RumSegmentTemplateStatus extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("active", "deprecated", "archived")); + + public static final RumSegmentTemplateStatus ACTIVE = new RumSegmentTemplateStatus("active"); + public static final RumSegmentTemplateStatus DEPRECATED = + new RumSegmentTemplateStatus("deprecated"); + public static final RumSegmentTemplateStatus ARCHIVED = new RumSegmentTemplateStatus("archived"); + + RumSegmentTemplateStatus(String value) { + super(value, allowedValues); + } + + public static class RumSegmentTemplateStatusSerializer + extends StdSerializer { + public RumSegmentTemplateStatusSerializer(Class t) { + super(t); + } + + public RumSegmentTemplateStatusSerializer() { + this(null); + } + + @Override + public void serialize( + RumSegmentTemplateStatus value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static RumSegmentTemplateStatus fromValue(String value) { + return new RumSegmentTemplateStatus(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RumSegmentUpdateAttributes.java b/src/main/java/com/datadog/api/client/v2/model/RumSegmentUpdateAttributes.java new file mode 100644 index 00000000000..2fb0e75d174 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RumSegmentUpdateAttributes.java @@ -0,0 +1,231 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Attributes for updating a segment. All fields are optional. */ +@JsonPropertyOrder({ + RumSegmentUpdateAttributes.JSON_PROPERTY_DATA_QUERY, + RumSegmentUpdateAttributes.JSON_PROPERTY_DESCRIPTION, + RumSegmentUpdateAttributes.JSON_PROPERTY_NAME, + RumSegmentUpdateAttributes.JSON_PROPERTY_TAGS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RumSegmentUpdateAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA_QUERY = "data_query"; + private RumSegmentDataQuery dataQuery; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_TAGS = "tags"; + private List tags = null; + + public RumSegmentUpdateAttributes dataQuery(RumSegmentDataQuery dataQuery) { + this.dataQuery = dataQuery; + this.unparsed |= dataQuery.unparsed; + return this; + } + + /** + * Query definition for the segment. Contains one or more query blocks and an optional combination + * formula. + * + * @return dataQuery + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA_QUERY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public RumSegmentDataQuery getDataQuery() { + return dataQuery; + } + + public void setDataQuery(RumSegmentDataQuery dataQuery) { + this.dataQuery = dataQuery; + } + + public RumSegmentUpdateAttributes description(String description) { + this.description = description; + return this; + } + + /** + * The updated description of the segment. + * + * @return description + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public RumSegmentUpdateAttributes name(String name) { + this.name = name; + return this; + } + + /** + * The updated name of the segment. + * + * @return name + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public RumSegmentUpdateAttributes tags(List tags) { + this.tags = tags; + return this; + } + + public RumSegmentUpdateAttributes addTagsItem(String tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList<>(); + } + this.tags.add(tagsItem); + return this; + } + + /** + * The updated list of tags for the segment. + * + * @return tags + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTags() { + return tags; + } + + public void setTags(List tags) { + this.tags = tags; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return RumSegmentUpdateAttributes + */ + @JsonAnySetter + public RumSegmentUpdateAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this RumSegmentUpdateAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RumSegmentUpdateAttributes rumSegmentUpdateAttributes = (RumSegmentUpdateAttributes) o; + return Objects.equals(this.dataQuery, rumSegmentUpdateAttributes.dataQuery) + && Objects.equals(this.description, rumSegmentUpdateAttributes.description) + && Objects.equals(this.name, rumSegmentUpdateAttributes.name) + && Objects.equals(this.tags, rumSegmentUpdateAttributes.tags) + && Objects.equals( + this.additionalProperties, rumSegmentUpdateAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(dataQuery, description, name, tags, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RumSegmentUpdateAttributes {\n"); + sb.append(" dataQuery: ").append(toIndentedString(dataQuery)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RumSegmentUpdateData.java b/src/main/java/com/datadog/api/client/v2/model/RumSegmentUpdateData.java new file mode 100644 index 00000000000..b07ae9c395e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RumSegmentUpdateData.java @@ -0,0 +1,209 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data object for a segment update request. */ +@JsonPropertyOrder({ + RumSegmentUpdateData.JSON_PROPERTY_ATTRIBUTES, + RumSegmentUpdateData.JSON_PROPERTY_ID, + RumSegmentUpdateData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RumSegmentUpdateData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private RumSegmentUpdateAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private RumSegmentResourceType type; + + public RumSegmentUpdateData() {} + + @JsonCreator + public RumSegmentUpdateData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + RumSegmentUpdateAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) RumSegmentResourceType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public RumSegmentUpdateData attributes(RumSegmentUpdateAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes for updating a segment. All fields are optional. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public RumSegmentUpdateAttributes getAttributes() { + return attributes; + } + + public void setAttributes(RumSegmentUpdateAttributes attributes) { + this.attributes = attributes; + } + + public RumSegmentUpdateData id(String id) { + this.id = id; + return this; + } + + /** + * The identifier of the segment to update. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public RumSegmentUpdateData type(RumSegmentResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Type of the segment resource. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public RumSegmentResourceType getType() { + return type; + } + + public void setType(RumSegmentResourceType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return RumSegmentUpdateData + */ + @JsonAnySetter + public RumSegmentUpdateData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this RumSegmentUpdateData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RumSegmentUpdateData rumSegmentUpdateData = (RumSegmentUpdateData) o; + return Objects.equals(this.attributes, rumSegmentUpdateData.attributes) + && Objects.equals(this.id, rumSegmentUpdateData.id) + && Objects.equals(this.type, rumSegmentUpdateData.type) + && Objects.equals(this.additionalProperties, rumSegmentUpdateData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RumSegmentUpdateData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RumSegmentUpdateRequest.java b/src/main/java/com/datadog/api/client/v2/model/RumSegmentUpdateRequest.java new file mode 100644 index 00000000000..5f086f756b8 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RumSegmentUpdateRequest.java @@ -0,0 +1,145 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Request body for updating a segment. */ +@JsonPropertyOrder({RumSegmentUpdateRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RumSegmentUpdateRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private RumSegmentUpdateData data; + + public RumSegmentUpdateRequest() {} + + @JsonCreator + public RumSegmentUpdateRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) RumSegmentUpdateData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public RumSegmentUpdateRequest data(RumSegmentUpdateData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data object for a segment update request. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public RumSegmentUpdateData getData() { + return data; + } + + public void setData(RumSegmentUpdateData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return RumSegmentUpdateRequest + */ + @JsonAnySetter + public RumSegmentUpdateRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this RumSegmentUpdateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RumSegmentUpdateRequest rumSegmentUpdateRequest = (RumSegmentUpdateRequest) o; + return Objects.equals(this.data, rumSegmentUpdateRequest.data) + && Objects.equals(this.additionalProperties, rumSegmentUpdateRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RumSegmentUpdateRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RumSegmentUser.java b/src/main/java/com/datadog/api/client/v2/model/RumSegmentUser.java new file mode 100644 index 00000000000..1ba6f4d3b18 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RumSegmentUser.java @@ -0,0 +1,257 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** A user who performed an action on a segment. */ +@JsonPropertyOrder({ + RumSegmentUser.JSON_PROPERTY_HANDLE, + RumSegmentUser.JSON_PROPERTY_ICON, + RumSegmentUser.JSON_PROPERTY_ID, + RumSegmentUser.JSON_PROPERTY_NAME, + RumSegmentUser.JSON_PROPERTY_UUID +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RumSegmentUser { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_HANDLE = "handle"; + private String handle; + + public static final String JSON_PROPERTY_ICON = "icon"; + private String icon; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_UUID = "uuid"; + private String uuid; + + public RumSegmentUser() {} + + @JsonCreator + public RumSegmentUser( + @JsonProperty(required = true, value = JSON_PROPERTY_HANDLE) String handle, + @JsonProperty(required = true, value = JSON_PROPERTY_ICON) String icon, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, + @JsonProperty(required = true, value = JSON_PROPERTY_UUID) String uuid) { + this.handle = handle; + this.icon = icon; + this.id = id; + this.name = name; + this.uuid = uuid; + } + + public RumSegmentUser handle(String handle) { + this.handle = handle; + return this; + } + + /** + * The email handle of the user. + * + * @return handle + */ + @JsonProperty(JSON_PROPERTY_HANDLE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getHandle() { + return handle; + } + + public void setHandle(String handle) { + this.handle = handle; + } + + public RumSegmentUser icon(String icon) { + this.icon = icon; + return this; + } + + /** + * The URL of the user icon. + * + * @return icon + */ + @JsonProperty(JSON_PROPERTY_ICON) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getIcon() { + return icon; + } + + public void setIcon(String icon) { + this.icon = icon; + } + + public RumSegmentUser id(String id) { + this.id = id; + return this; + } + + /** + * The numeric identifier of the user. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public RumSegmentUser name(String name) { + this.name = name; + return this; + } + + /** + * The display name of the user. + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public RumSegmentUser uuid(String uuid) { + this.uuid = uuid; + return this; + } + + /** + * The unique identifier of the user. + * + * @return uuid + */ + @JsonProperty(JSON_PROPERTY_UUID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getUuid() { + return uuid; + } + + public void setUuid(String uuid) { + this.uuid = uuid; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return RumSegmentUser + */ + @JsonAnySetter + public RumSegmentUser putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this RumSegmentUser object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RumSegmentUser rumSegmentUser = (RumSegmentUser) o; + return Objects.equals(this.handle, rumSegmentUser.handle) + && Objects.equals(this.icon, rumSegmentUser.icon) + && Objects.equals(this.id, rumSegmentUser.id) + && Objects.equals(this.name, rumSegmentUser.name) + && Objects.equals(this.uuid, rumSegmentUser.uuid) + && Objects.equals(this.additionalProperties, rumSegmentUser.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(handle, icon, id, name, uuid, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RumSegmentUser {\n"); + sb.append(" handle: ").append(toIndentedString(handle)).append("\n"); + sb.append(" icon: ").append(toIndentedString(icon)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RumStaticSegmentCreateAttributes.java b/src/main/java/com/datadog/api/client/v2/model/RumStaticSegmentCreateAttributes.java new file mode 100644 index 00000000000..49e25f1f208 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RumStaticSegmentCreateAttributes.java @@ -0,0 +1,245 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Attributes for creating a new static segment. */ +@JsonPropertyOrder({ + RumStaticSegmentCreateAttributes.JSON_PROPERTY_DESCRIPTION, + RumStaticSegmentCreateAttributes.JSON_PROPERTY_JOURNEY_QUERY_OBJECT, + RumStaticSegmentCreateAttributes.JSON_PROPERTY_NAME, + RumStaticSegmentCreateAttributes.JSON_PROPERTY_TAGS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RumStaticSegmentCreateAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_JOURNEY_QUERY_OBJECT = "journey_query_object"; + private RumStaticSegmentJourneyQueryObject journeyQueryObject; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_TAGS = "tags"; + private List tags = null; + + public RumStaticSegmentCreateAttributes() {} + + @JsonCreator + public RumStaticSegmentCreateAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_DESCRIPTION) String description, + @JsonProperty(required = true, value = JSON_PROPERTY_JOURNEY_QUERY_OBJECT) + RumStaticSegmentJourneyQueryObject journeyQueryObject, + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name) { + this.description = description; + this.journeyQueryObject = journeyQueryObject; + this.unparsed |= journeyQueryObject.unparsed; + this.name = name; + } + + public RumStaticSegmentCreateAttributes description(String description) { + this.description = description; + return this; + } + + /** + * A description of the static segment. + * + * @return description + */ + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public RumStaticSegmentCreateAttributes journeyQueryObject( + RumStaticSegmentJourneyQueryObject journeyQueryObject) { + this.journeyQueryObject = journeyQueryObject; + this.unparsed |= journeyQueryObject.unparsed; + return this; + } + + /** + * The journey query object used to compute the static segment user list. + * + * @return journeyQueryObject + */ + @JsonProperty(JSON_PROPERTY_JOURNEY_QUERY_OBJECT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public RumStaticSegmentJourneyQueryObject getJourneyQueryObject() { + return journeyQueryObject; + } + + public void setJourneyQueryObject(RumStaticSegmentJourneyQueryObject journeyQueryObject) { + this.journeyQueryObject = journeyQueryObject; + } + + public RumStaticSegmentCreateAttributes name(String name) { + this.name = name; + return this; + } + + /** + * The name of the static segment. + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public RumStaticSegmentCreateAttributes tags(List tags) { + this.tags = tags; + return this; + } + + public RumStaticSegmentCreateAttributes addTagsItem(String tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList<>(); + } + this.tags.add(tagsItem); + return this; + } + + /** + * A list of tags for the static segment. + * + * @return tags + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTags() { + return tags; + } + + public void setTags(List tags) { + this.tags = tags; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return RumStaticSegmentCreateAttributes + */ + @JsonAnySetter + public RumStaticSegmentCreateAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this RumStaticSegmentCreateAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RumStaticSegmentCreateAttributes rumStaticSegmentCreateAttributes = + (RumStaticSegmentCreateAttributes) o; + return Objects.equals(this.description, rumStaticSegmentCreateAttributes.description) + && Objects.equals( + this.journeyQueryObject, rumStaticSegmentCreateAttributes.journeyQueryObject) + && Objects.equals(this.name, rumStaticSegmentCreateAttributes.name) + && Objects.equals(this.tags, rumStaticSegmentCreateAttributes.tags) + && Objects.equals( + this.additionalProperties, rumStaticSegmentCreateAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(description, journeyQueryObject, name, tags, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RumStaticSegmentCreateAttributes {\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" journeyQueryObject: ").append(toIndentedString(journeyQueryObject)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RumStaticSegmentCreateData.java b/src/main/java/com/datadog/api/client/v2/model/RumStaticSegmentCreateData.java new file mode 100644 index 00000000000..20451a8497d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RumStaticSegmentCreateData.java @@ -0,0 +1,182 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data object for a static segment creation request. */ +@JsonPropertyOrder({ + RumStaticSegmentCreateData.JSON_PROPERTY_ATTRIBUTES, + RumStaticSegmentCreateData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RumStaticSegmentCreateData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private RumStaticSegmentCreateAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private RumStaticSegmentRequestType type; + + public RumStaticSegmentCreateData() {} + + @JsonCreator + public RumStaticSegmentCreateData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + RumStaticSegmentCreateAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) RumStaticSegmentRequestType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public RumStaticSegmentCreateData attributes(RumStaticSegmentCreateAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes for creating a new static segment. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public RumStaticSegmentCreateAttributes getAttributes() { + return attributes; + } + + public void setAttributes(RumStaticSegmentCreateAttributes attributes) { + this.attributes = attributes; + } + + public RumStaticSegmentCreateData type(RumStaticSegmentRequestType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Type of the static segment creation request resource. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public RumStaticSegmentRequestType getType() { + return type; + } + + public void setType(RumStaticSegmentRequestType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return RumStaticSegmentCreateData + */ + @JsonAnySetter + public RumStaticSegmentCreateData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this RumStaticSegmentCreateData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RumStaticSegmentCreateData rumStaticSegmentCreateData = (RumStaticSegmentCreateData) o; + return Objects.equals(this.attributes, rumStaticSegmentCreateData.attributes) + && Objects.equals(this.type, rumStaticSegmentCreateData.type) + && Objects.equals( + this.additionalProperties, rumStaticSegmentCreateData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RumStaticSegmentCreateData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RumStaticSegmentCreateRequest.java b/src/main/java/com/datadog/api/client/v2/model/RumStaticSegmentCreateRequest.java new file mode 100644 index 00000000000..bf7c5e9dc4a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RumStaticSegmentCreateRequest.java @@ -0,0 +1,146 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Request body for creating a new static segment. */ +@JsonPropertyOrder({RumStaticSegmentCreateRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RumStaticSegmentCreateRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private RumStaticSegmentCreateData data; + + public RumStaticSegmentCreateRequest() {} + + @JsonCreator + public RumStaticSegmentCreateRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) RumStaticSegmentCreateData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public RumStaticSegmentCreateRequest data(RumStaticSegmentCreateData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data object for a static segment creation request. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public RumStaticSegmentCreateData getData() { + return data; + } + + public void setData(RumStaticSegmentCreateData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return RumStaticSegmentCreateRequest + */ + @JsonAnySetter + public RumStaticSegmentCreateRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this RumStaticSegmentCreateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RumStaticSegmentCreateRequest rumStaticSegmentCreateRequest = (RumStaticSegmentCreateRequest) o; + return Objects.equals(this.data, rumStaticSegmentCreateRequest.data) + && Objects.equals( + this.additionalProperties, rumStaticSegmentCreateRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RumStaticSegmentCreateRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RumStaticSegmentJourneyFilter.java b/src/main/java/com/datadog/api/client/v2/model/RumStaticSegmentJourneyFilter.java new file mode 100644 index 00000000000..5884134e398 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RumStaticSegmentJourneyFilter.java @@ -0,0 +1,174 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** A filter within a journey query node. */ +@JsonPropertyOrder({ + RumStaticSegmentJourneyFilter.JSON_PROPERTY_ATTRIBUTE, + RumStaticSegmentJourneyFilter.JSON_PROPERTY_VALUE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RumStaticSegmentJourneyFilter { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTE = "attribute"; + private String attribute; + + public static final String JSON_PROPERTY_VALUE = "value"; + private String value; + + public RumStaticSegmentJourneyFilter() {} + + @JsonCreator + public RumStaticSegmentJourneyFilter( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTE) String attribute, + @JsonProperty(required = true, value = JSON_PROPERTY_VALUE) String value) { + this.attribute = attribute; + this.value = value; + } + + public RumStaticSegmentJourneyFilter attribute(String attribute) { + this.attribute = attribute; + return this; + } + + /** + * The attribute to filter on. + * + * @return attribute + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getAttribute() { + return attribute; + } + + public void setAttribute(String attribute) { + this.attribute = attribute; + } + + public RumStaticSegmentJourneyFilter value(String value) { + this.value = value; + return this; + } + + /** + * The value to match. + * + * @return value + */ + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return RumStaticSegmentJourneyFilter + */ + @JsonAnySetter + public RumStaticSegmentJourneyFilter putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this RumStaticSegmentJourneyFilter object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RumStaticSegmentJourneyFilter rumStaticSegmentJourneyFilter = (RumStaticSegmentJourneyFilter) o; + return Objects.equals(this.attribute, rumStaticSegmentJourneyFilter.attribute) + && Objects.equals(this.value, rumStaticSegmentJourneyFilter.value) + && Objects.equals( + this.additionalProperties, rumStaticSegmentJourneyFilter.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attribute, value, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RumStaticSegmentJourneyFilter {\n"); + sb.append(" attribute: ").append(toIndentedString(attribute)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RumStaticSegmentJourneyNode.java b/src/main/java/com/datadog/api/client/v2/model/RumStaticSegmentJourneyNode.java new file mode 100644 index 00000000000..ef9d88a8528 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RumStaticSegmentJourneyNode.java @@ -0,0 +1,156 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** A node in a journey query object. */ +@JsonPropertyOrder({RumStaticSegmentJourneyNode.JSON_PROPERTY_FILTERS}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RumStaticSegmentJourneyNode { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_FILTERS = "filters"; + private List filters = new ArrayList<>(); + + public RumStaticSegmentJourneyNode() {} + + @JsonCreator + public RumStaticSegmentJourneyNode( + @JsonProperty(required = true, value = JSON_PROPERTY_FILTERS) + List filters) { + this.filters = filters; + } + + public RumStaticSegmentJourneyNode filters(List filters) { + this.filters = filters; + for (RumStaticSegmentJourneyFilter item : filters) { + this.unparsed |= item.unparsed; + } + return this; + } + + public RumStaticSegmentJourneyNode addFiltersItem(RumStaticSegmentJourneyFilter filtersItem) { + this.filters.add(filtersItem); + this.unparsed |= filtersItem.unparsed; + return this; + } + + /** + * The list of filters for this node. + * + * @return filters + */ + @JsonProperty(JSON_PROPERTY_FILTERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getFilters() { + return filters; + } + + public void setFilters(List filters) { + this.filters = filters; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return RumStaticSegmentJourneyNode + */ + @JsonAnySetter + public RumStaticSegmentJourneyNode putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this RumStaticSegmentJourneyNode object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RumStaticSegmentJourneyNode rumStaticSegmentJourneyNode = (RumStaticSegmentJourneyNode) o; + return Objects.equals(this.filters, rumStaticSegmentJourneyNode.filters) + && Objects.equals( + this.additionalProperties, rumStaticSegmentJourneyNode.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(filters, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RumStaticSegmentJourneyNode {\n"); + sb.append(" filters: ").append(toIndentedString(filters)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RumStaticSegmentJourneyQueryObject.java b/src/main/java/com/datadog/api/client/v2/model/RumStaticSegmentJourneyQueryObject.java new file mode 100644 index 00000000000..bd98144501b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RumStaticSegmentJourneyQueryObject.java @@ -0,0 +1,157 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** The journey query object used to compute the static segment user list. */ +@JsonPropertyOrder({RumStaticSegmentJourneyQueryObject.JSON_PROPERTY_NODES}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RumStaticSegmentJourneyQueryObject { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_NODES = "nodes"; + private List nodes = new ArrayList<>(); + + public RumStaticSegmentJourneyQueryObject() {} + + @JsonCreator + public RumStaticSegmentJourneyQueryObject( + @JsonProperty(required = true, value = JSON_PROPERTY_NODES) + List nodes) { + this.nodes = nodes; + } + + public RumStaticSegmentJourneyQueryObject nodes(List nodes) { + this.nodes = nodes; + for (RumStaticSegmentJourneyNode item : nodes) { + this.unparsed |= item.unparsed; + } + return this; + } + + public RumStaticSegmentJourneyQueryObject addNodesItem(RumStaticSegmentJourneyNode nodesItem) { + this.nodes.add(nodesItem); + this.unparsed |= nodesItem.unparsed; + return this; + } + + /** + * The list of journey nodes defining the query. + * + * @return nodes + */ + @JsonProperty(JSON_PROPERTY_NODES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getNodes() { + return nodes; + } + + public void setNodes(List nodes) { + this.nodes = nodes; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return RumStaticSegmentJourneyQueryObject + */ + @JsonAnySetter + public RumStaticSegmentJourneyQueryObject putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this RumStaticSegmentJourneyQueryObject object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RumStaticSegmentJourneyQueryObject rumStaticSegmentJourneyQueryObject = + (RumStaticSegmentJourneyQueryObject) o; + return Objects.equals(this.nodes, rumStaticSegmentJourneyQueryObject.nodes) + && Objects.equals( + this.additionalProperties, rumStaticSegmentJourneyQueryObject.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(nodes, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RumStaticSegmentJourneyQueryObject {\n"); + sb.append(" nodes: ").append(toIndentedString(nodes)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RumStaticSegmentRequestType.java b/src/main/java/com/datadog/api/client/v2/model/RumStaticSegmentRequestType.java new file mode 100644 index 00000000000..cd6186bf325 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RumStaticSegmentRequestType.java @@ -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. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Type of the static segment creation request resource. */ +@JsonSerialize(using = RumStaticSegmentRequestType.RumStaticSegmentRequestTypeSerializer.class) +public class RumStaticSegmentRequestType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("create_static_segment_request")); + + public static final RumStaticSegmentRequestType CREATE_STATIC_SEGMENT_REQUEST = + new RumStaticSegmentRequestType("create_static_segment_request"); + + RumStaticSegmentRequestType(String value) { + super(value, allowedValues); + } + + public static class RumStaticSegmentRequestTypeSerializer + extends StdSerializer { + public RumStaticSegmentRequestTypeSerializer(Class t) { + super(t); + } + + public RumStaticSegmentRequestTypeSerializer() { + this(null); + } + + @Override + public void serialize( + RumStaticSegmentRequestType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static RumStaticSegmentRequestType fromValue(String value) { + return new RumStaticSegmentRequestType(value); + } +} diff --git a/src/test/resources/com/datadog/api/client/v2/api/rum_user_segments.feature b/src/test/resources/com/datadog/api/client/v2/api/rum_user_segments.feature new file mode 100644 index 00000000000..7a6305c6e00 --- /dev/null +++ b/src/test/resources/com/datadog/api/client/v2/api/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/src/test/resources/com/datadog/api/client/v2/api/undo.json b/src/test/resources/com/datadog/api/client/v2/api/undo.json index 2f0af9dca77..6514777da20 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/undo.json +++ b/src/test/resources/com/datadog/api/client/v2/api/undo.json @@ -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": {