diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index d235bdcd3db..26e1246c449 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -758,6 +758,14 @@ components: schema: example: "my-job" type: string + LLMObsAnnotationQueueIDPathParameter: + description: The ID of the LLM Observability annotation queue. + example: "b5e7f3a1-9c2d-4f8b-a1e6-3d7e9f0a2b4c" + in: path + name: queue_id + required: true + schema: + type: string LLMObsDatasetIDPathParameter: description: The ID of the LLM Observability dataset. example: "9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d" @@ -36063,6 +36071,386 @@ components: format: int64 type: integer type: object + LLMObsAnnotatedInteractionItem: + description: An interaction with its associated annotations. + properties: + annotations: + description: List of annotations for this interaction. + items: + $ref: "#/components/schemas/LLMObsAnnotationItem" + type: array + content_id: + description: Identifier of the content for this interaction. + example: "trace-abc-123" + type: string + id: + description: Unique identifier of the interaction. + example: "interaction-456" + type: string + type: + $ref: "#/components/schemas/LLMObsInteractionType" + required: + - id + - type + - content_id + - annotations + type: object + LLMObsAnnotatedInteractionsDataAttributesResponse: + description: Attributes containing the list of annotated interactions. + properties: + annotated_interactions: + description: List of interactions with their annotations. + items: + $ref: "#/components/schemas/LLMObsAnnotatedInteractionItem" + type: array + required: + - annotated_interactions + type: object + LLMObsAnnotatedInteractionsDataResponse: + description: Data object for annotated interactions. + properties: + attributes: + $ref: "#/components/schemas/LLMObsAnnotatedInteractionsDataAttributesResponse" + id: + description: The queue ID. + example: "b5e7f3a1-9c2d-4f8b-a1e6-3d7e9f0a2b4c" + type: string + type: + $ref: "#/components/schemas/LLMObsAnnotatedInteractionsType" + required: + - id + - type + - attributes + type: object + LLMObsAnnotatedInteractionsResponse: + description: Response containing the annotated interactions for an annotation queue. + properties: + data: + $ref: "#/components/schemas/LLMObsAnnotatedInteractionsDataResponse" + required: + - data + type: object + LLMObsAnnotatedInteractionsType: + description: Resource type for annotated interactions. + enum: + - annotated_interactions + example: annotated_interactions + type: string + x-enum-varnames: + - ANNOTATED_INTERACTIONS + LLMObsAnnotationItem: + description: A single annotation on an interaction. + properties: + created_at: + description: Timestamp when the annotation was created. + example: "2024-01-15T10:30:00Z" + format: date-time + type: string + created_by: + description: Identifier of the user who created the annotation. + example: "00000000-0000-0000-0000-000000000002" + type: string + id: + description: Unique identifier of the annotation. + example: "annotation-789" + type: string + interaction_id: + description: Identifier of the interaction this annotation belongs to. + example: "interaction-456" + type: string + label_values: + additionalProperties: {} + description: The label values for this annotation. + example: + quality: "good" + type: object + modified_at: + description: Timestamp when the annotation was last modified. + example: "2024-01-15T10:30:00Z" + format: date-time + type: string + modified_by: + description: Identifier of the user who last modified the annotation. + example: "00000000-0000-0000-0000-000000000002" + type: string + required: + - id + - interaction_id + - label_values + - created_by + - created_at + - modified_by + - modified_at + type: object + LLMObsAnnotationQueueDataAttributesRequest: + description: Attributes for creating an LLM Observability annotation queue. + properties: + description: + description: Description of the annotation queue. + example: "Queue for annotating customer support traces" + type: string + name: + description: Name of the annotation queue. + example: "My annotation queue" + type: string + project_id: + description: Identifier of the project this queue belongs to. + example: "a33671aa-24fd-4dcd-9b33-a8ec7dde7751" + type: string + required: + - name + - project_id + type: object + LLMObsAnnotationQueueDataAttributesResponse: + description: Attributes of an LLM Observability annotation queue. + properties: + created_at: + description: Timestamp when the queue was created. + example: "2024-01-15T10:30:00Z" + format: date-time + type: string + created_by: + description: Identifier of the user who created the queue. + example: "00000000-0000-0000-0000-000000000002" + type: string + description: + description: Description of the annotation queue. + example: "Queue for annotating customer support traces" + type: string + modified_at: + description: Timestamp when the queue was last modified. + example: "2024-01-15T10:30:00Z" + format: date-time + type: string + modified_by: + description: Identifier of the user who last modified the queue. + example: "00000000-0000-0000-0000-000000000002" + type: string + name: + description: Name of the annotation queue. + example: "My annotation queue" + type: string + owned_by: + description: Identifier of the user who owns the queue. + example: "00000000-0000-0000-0000-000000000002" + type: string + project_id: + description: Identifier of the project this queue belongs to. + example: "a33671aa-24fd-4dcd-9b33-a8ec7dde7751" + type: string + required: + - name + - project_id + - description + - created_by + - created_at + - modified_by + - modified_at + - owned_by + type: object + LLMObsAnnotationQueueDataRequest: + description: Data object for creating an LLM Observability annotation queue. + properties: + attributes: + $ref: "#/components/schemas/LLMObsAnnotationQueueDataAttributesRequest" + type: + $ref: "#/components/schemas/LLMObsAnnotationQueueType" + required: + - type + - attributes + type: object + LLMObsAnnotationQueueDataResponse: + description: Data object for an LLM Observability annotation queue. + properties: + attributes: + $ref: "#/components/schemas/LLMObsAnnotationQueueDataAttributesResponse" + id: + description: Unique identifier of the annotation queue. + example: "b5e7f3a1-9c2d-4f8b-a1e6-3d7e9f0a2b4c" + type: string + type: + $ref: "#/components/schemas/LLMObsAnnotationQueueType" + required: + - id + - type + - attributes + type: object + LLMObsAnnotationQueueInteractionItem: + description: A single interaction to add to an annotation queue. + properties: + content_id: + description: Identifier of the content (such as trace ID) for this interaction. + example: "trace-abc-123" + type: string + type: + $ref: "#/components/schemas/LLMObsInteractionType" + required: + - type + - content_id + type: object + LLMObsAnnotationQueueInteractionResponseItem: + description: A single interaction result. + properties: + already_existed: + description: Whether this interaction already existed in the queue. + example: false + type: boolean + content_id: + description: Identifier of the content for this interaction. + example: "trace-abc-123" + type: string + id: + description: Unique identifier of the interaction. + example: "00000000-0000-0000-0000-000000000000" + type: string + type: + $ref: "#/components/schemas/LLMObsInteractionType" + required: + - id + - type + - content_id + - already_existed + type: object + LLMObsAnnotationQueueInteractionsDataAttributesRequest: + description: Attributes for adding interactions to an annotation queue. + properties: + interactions: + description: List of interactions to add to the queue. Must contain at least one item. + items: + $ref: "#/components/schemas/LLMObsAnnotationQueueInteractionItem" + minItems: 1 + type: array + required: + - interactions + type: object + LLMObsAnnotationQueueInteractionsDataAttributesResponse: + description: Attributes of the interaction addition response. + properties: + interactions: + description: List of interactions that were processed. + items: + $ref: "#/components/schemas/LLMObsAnnotationQueueInteractionResponseItem" + type: array + required: + - interactions + type: object + LLMObsAnnotationQueueInteractionsDataRequest: + description: Data object for adding interactions to an annotation queue. + properties: + attributes: + $ref: "#/components/schemas/LLMObsAnnotationQueueInteractionsDataAttributesRequest" + type: + $ref: "#/components/schemas/LLMObsAnnotationQueueInteractionsType" + required: + - type + - attributes + type: object + LLMObsAnnotationQueueInteractionsDataResponse: + description: Data object for the interaction addition response. + properties: + attributes: + $ref: "#/components/schemas/LLMObsAnnotationQueueInteractionsDataAttributesResponse" + id: + description: The queue ID the interactions were added to. + example: "b5e7f3a1-9c2d-4f8b-a1e6-3d7e9f0a2b4c" + type: string + type: + $ref: "#/components/schemas/LLMObsAnnotationQueueInteractionsType" + required: + - id + - type + - attributes + type: object + LLMObsAnnotationQueueInteractionsRequest: + description: Request to add interactions to an LLM Observability annotation queue. + properties: + data: + $ref: "#/components/schemas/LLMObsAnnotationQueueInteractionsDataRequest" + required: + - data + type: object + LLMObsAnnotationQueueInteractionsResponse: + description: Response containing the result of adding interactions to an annotation queue. + properties: + data: + $ref: "#/components/schemas/LLMObsAnnotationQueueInteractionsDataResponse" + required: + - data + type: object + LLMObsAnnotationQueueInteractionsType: + description: Resource type for annotation queue interactions. + enum: + - interactions + example: interactions + type: string + x-enum-varnames: + - INTERACTIONS + LLMObsAnnotationQueueRequest: + description: Request to create an LLM Observability annotation queue. + properties: + data: + $ref: "#/components/schemas/LLMObsAnnotationQueueDataRequest" + required: + - data + type: object + LLMObsAnnotationQueueResponse: + description: Response containing a single LLM Observability annotation queue. + properties: + data: + $ref: "#/components/schemas/LLMObsAnnotationQueueDataResponse" + required: + - data + type: object + LLMObsAnnotationQueueType: + description: Resource type of an LLM Observability annotation queue. + enum: + - queues + example: queues + type: string + x-enum-varnames: + - QUEUES + LLMObsAnnotationQueueUpdateDataAttributesRequest: + description: Attributes for updating an LLM Observability annotation queue. All fields are optional. + properties: + description: + description: Updated description of the annotation queue. + example: "Updated description" + type: string + name: + description: Updated name of the annotation queue. + example: "Updated queue name" + type: string + type: object + LLMObsAnnotationQueueUpdateDataRequest: + description: Data object for updating an LLM Observability annotation queue. + properties: + attributes: + $ref: "#/components/schemas/LLMObsAnnotationQueueUpdateDataAttributesRequest" + type: + $ref: "#/components/schemas/LLMObsAnnotationQueueType" + required: + - type + - attributes + type: object + LLMObsAnnotationQueueUpdateRequest: + description: Request to update an LLM Observability annotation queue. + properties: + data: + $ref: "#/components/schemas/LLMObsAnnotationQueueUpdateDataRequest" + required: + - data + type: object + LLMObsAnnotationQueuesResponse: + description: Response containing a list of LLM Observability annotation queues. + properties: + data: + description: List of annotation queues. + items: + $ref: "#/components/schemas/LLMObsAnnotationQueueDataResponse" + type: array + required: + - data + type: object LLMObsCursorMeta: description: Pagination cursor metadata. properties: @@ -36394,6 +36782,41 @@ components: required: - data type: object + LLMObsDeleteAnnotationQueueInteractionsDataAttributesRequest: + description: Attributes for deleting interactions from an annotation queue. + properties: + interaction_ids: + description: List of interaction IDs to delete. Must contain at least one item. + example: + - "00000000-0000-0000-0000-000000000000" + - "00000000-0000-0000-0000-000000000001" + items: + description: An interaction ID to delete. + type: string + minItems: 1 + type: array + required: + - interaction_ids + type: object + LLMObsDeleteAnnotationQueueInteractionsDataRequest: + description: Data object for deleting interactions from an annotation queue. + properties: + attributes: + $ref: "#/components/schemas/LLMObsDeleteAnnotationQueueInteractionsDataAttributesRequest" + type: + $ref: "#/components/schemas/LLMObsAnnotationQueueInteractionsType" + required: + - type + - attributes + type: object + LLMObsDeleteAnnotationQueueInteractionsRequest: + description: Request to delete interactions from an LLM Observability annotation queue. + properties: + data: + $ref: "#/components/schemas/LLMObsDeleteAnnotationQueueInteractionsDataRequest" + required: + - data + type: object LLMObsDeleteDatasetRecordsDataAttributesRequest: description: Attributes for deleting records from an LLM Observability dataset. properties: @@ -36903,6 +37326,16 @@ components: required: - data type: object + LLMObsInteractionType: + description: Type of interaction in an annotation queue. + enum: + - trace + - experiment_trace + example: trace + type: string + x-enum-varnames: + - TRACE + - EXPERIMENT_TRACE LLMObsMetricAssessment: description: Assessment result for an LLM Observability experiment metric. enum: @@ -43289,6 +43722,7 @@ components: ObservabilityPipelineConfigDestinationItem: description: "A destination for the pipeline." oneOf: + - $ref: "#/components/schemas/ObservabilityPipelineElasticsearchDestination" - $ref: "#/components/schemas/ObservabilityPipelineHttpClientDestination" - $ref: "#/components/schemas/ObservabilityPipelineAmazonOpenSearchDestination" - $ref: "#/components/schemas/ObservabilityPipelineAmazonS3Destination" @@ -43298,7 +43732,6 @@ components: - $ref: "#/components/schemas/ObservabilityPipelineCloudPremDestination" - $ref: "#/components/schemas/ObservabilityPipelineCrowdStrikeNextGenSiemDestination" - $ref: "#/components/schemas/ObservabilityPipelineDatadogLogsDestination" - - $ref: "#/components/schemas/ObservabilityPipelineElasticsearchDestination" - $ref: "#/components/schemas/ObservabilityPipelineGoogleChronicleDestination" - $ref: "#/components/schemas/ObservabilityPipelineGoogleCloudStorageDestination" - $ref: "#/components/schemas/ObservabilityPipelineGooglePubSubDestination" @@ -43900,9 +44333,9 @@ components: type: object ObservabilityPipelineElasticsearchDestination: description: |- - The `elasticsearch` destination writes logs to an Elasticsearch cluster. + The `elasticsearch` destination writes logs or metrics to an Elasticsearch cluster. - **Supported pipeline types:** logs + **Supported pipeline types:** logs, metrics properties: api_version: $ref: "#/components/schemas/ObservabilityPipelineElasticsearchDestinationApiVersion" @@ -43911,9 +44344,11 @@ components: buffer: $ref: "#/components/schemas/ObservabilityPipelineBufferOptions" bulk_index: - description: The index to write logs to in Elasticsearch. + description: The name of the index to write events to in Elasticsearch. example: logs-index type: string + compression: + $ref: "#/components/schemas/ObservabilityPipelineElasticsearchDestinationCompression" data_stream: $ref: "#/components/schemas/ObservabilityPipelineElasticsearchDestinationDataStream" endpoint_url_key: @@ -43924,6 +44359,10 @@ components: description: The unique identifier for this component. example: "elasticsearch-destination" type: string + id_key: + description: The name of the field used as the document ID in Elasticsearch. + example: id + type: string inputs: description: A list of component IDs whose output is used as the `input` for this component. example: ["filter-processor"] @@ -43931,6 +44370,15 @@ components: description: The ID of a component whose output is used as input for this destination. type: string type: array + pipeline: + description: The name of an Elasticsearch ingest pipeline to apply to events before indexing. + example: my-pipeline + type: string + request_retry_partial: + description: When `true`, retries failed partial bulk requests when some events in a batch fail while others succeed. + type: boolean + tls: + $ref: "#/components/schemas/ObservabilityPipelineTls" type: $ref: "#/components/schemas/ObservabilityPipelineElasticsearchDestinationType" required: @@ -43938,7 +44386,7 @@ components: - type - inputs type: object - x-pipeline-types: [logs] + x-pipeline-types: [logs, metrics] ObservabilityPipelineElasticsearchDestinationApiVersion: description: The Elasticsearch API version to use. Set to `auto` to auto-detect. enum: [auto, v6, v7, v8] @@ -43967,18 +44415,48 @@ components: required: - strategy type: object + ObservabilityPipelineElasticsearchDestinationCompression: + description: Compression configuration for the Elasticsearch destination. + properties: + algorithm: + $ref: "#/components/schemas/ObservabilityPipelineElasticsearchDestinationCompressionAlgorithm" + level: + description: The compression level. Only applicable for `gzip`, `zlib`, and `zstd` algorithms. + example: 6 + format: int64 + type: integer + required: + - algorithm + type: object + ObservabilityPipelineElasticsearchDestinationCompressionAlgorithm: + description: The compression algorithm applied when sending data to Elasticsearch. + enum: [none, gzip, zlib, zstd, snappy] + example: gzip + type: string + x-enum-varnames: + - NONE + - GZIP + - ZLIB + - ZSTD + - SNAPPY ObservabilityPipelineElasticsearchDestinationDataStream: description: Configuration options for writing to Elasticsearch Data Streams instead of a fixed index. properties: + auto_routing: + description: When `true`, automatically routes events to the appropriate data stream based on the event content. + type: boolean dataset: - description: The data stream dataset for your logs. This groups logs by their source or application. + description: The data stream dataset. This groups events by their source or application. type: string dtype: - description: The data stream type for your logs. This determines how logs are categorized within the data stream. + description: The data stream type. This determines how events are categorized within the data stream. type: string namespace: - description: The data stream namespace for your logs. This separates logs into different environments or domains. + description: The data stream namespace. This separates events into different environments or domains. type: string + sync_fields: + description: When `true`, synchronizes data stream fields with the Elasticsearch index mapping. + type: boolean type: object ObservabilityPipelineElasticsearchDestinationType: default: elasticsearch @@ -92366,6 +92844,358 @@ paths: operator: OR permissions: - org_management + /api/v2/llm-obs/v1/annotation-queues: + get: + description: |- + List annotation queues. Optionally filter by project ID or queue IDs. These parameters are mutually exclusive. + If neither is provided, all queues in the organization are returned. + operationId: ListLLMObsAnnotationQueues + parameters: + - description: Filter annotation queues by project ID. Cannot be used together with `queueIds`. + in: query + name: projectId + schema: + type: string + - description: Filter annotation queues by queue IDs (comma-separated). Cannot be used together with `projectId`. + in: query + name: queueIds + schema: + items: + type: string + type: array + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/LLMObsAnnotationQueuesResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: List LLM Observability annotation queues + tags: + - LLM Observability + 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 annotation queue. Only `name`, `project_id`, and `description` are accepted. + Fields such as `created_by`, `owned_by`, `created_at`, `modified_by`, and `modified_at` are inferred by the backend. + operationId: CreateLLMObsAnnotationQueue + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/LLMObsAnnotationQueueRequest" + description: Create annotation queue payload. + required: true + responses: + "201": + content: + application/json: + schema: + $ref: "#/components/schemas/LLMObsAnnotationQueueResponse" + description: Created + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Create an LLM Observability annotation queue + tags: + - LLM Observability + 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/llm-obs/v1/annotation-queues/{queue_id}: + delete: + description: Delete an annotation queue by its ID. + operationId: DeleteLLMObsAnnotationQueue + parameters: + - $ref: "#/components/parameters/LLMObsAnnotationQueueIDPathParameter" + responses: + "204": + description: No Content + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "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" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Delete an LLM Observability annotation queue + tags: + - LLM Observability + 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/). + patch: + description: |- + Partially update an annotation queue. Only `name` and `description` can be updated. + operationId: UpdateLLMObsAnnotationQueue + parameters: + - $ref: "#/components/parameters/LLMObsAnnotationQueueIDPathParameter" + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/LLMObsAnnotationQueueUpdateRequest" + description: Update annotation queue payload. + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/LLMObsAnnotationQueueResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "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" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Update an LLM Observability annotation queue + tags: + - LLM Observability + 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/llm-obs/v1/annotation-queues/{queue_id}/annotated-interactions: + get: + description: Retrieve all interactions and their annotations for a given annotation queue. + operationId: GetLLMObsAnnotatedInteractions + parameters: + - $ref: "#/components/parameters/LLMObsAnnotationQueueIDPathParameter" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/LLMObsAnnotatedInteractionsResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "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" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Get annotated queue interactions + tags: + - LLM Observability + 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/llm-obs/v1/annotation-queues/{queue_id}/interactions: + post: + description: |- + Add one or more interactions (traces) to an annotation queue. + At least one interaction must be provided. + operationId: CreateLLMObsAnnotationQueueInteractions + parameters: + - $ref: "#/components/parameters/LLMObsAnnotationQueueIDPathParameter" + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/LLMObsAnnotationQueueInteractionsRequest" + description: Add interactions payload. + required: true + responses: + "201": + content: + application/json: + schema: + $ref: "#/components/schemas/LLMObsAnnotationQueueInteractionsResponse" + description: Created + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "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" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Add annotation queue interactions + tags: + - LLM Observability + 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/llm-obs/v1/annotation-queues/{queue_id}/interactions/delete: + post: + description: Delete one or more interactions from an annotation queue. + operationId: DeleteLLMObsAnnotationQueueInteractions + parameters: + - $ref: "#/components/parameters/LLMObsAnnotationQueueIDPathParameter" + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/LLMObsDeleteAnnotationQueueInteractionsRequest" + description: Delete interactions payload. + required: true + responses: + "204": + description: No Content + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "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" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Delete annotation queue interactions + tags: + - LLM Observability + 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/llm-obs/v1/experiments: get: description: List all LLM Observability experiments sorted by creation date, newest first. @@ -115735,7 +116565,7 @@ tags: description: Find out more at url: "https://docs.datadoghq.com/account_management/api-app-keys/" name: Key Management - - description: Manage LLM Observability projects, datasets, dataset records, and experiments via the Experiments API. + - description: Manage LLM Observability projects, datasets, dataset records, experiments, and annotations. name: LLM Observability - description: |- Search your logs and send them to your Datadog platform over HTTP. See the [Log Management page](https://docs.datadoghq.com/logs/) for more information. diff --git a/api/datadog/configuration.go b/api/datadog/configuration.go index 8bdd59c23a6..9d704509870 100644 --- a/api/datadog/configuration.go +++ b/api/datadog/configuration.go @@ -802,19 +802,26 @@ func NewConfiguration() *Configuration { "v2.UpdateJiraIssueTemplate": false, "v2.CreateTenancyConfig": false, "v2.GetTenancyConfigs": false, + "v2.CreateLLMObsAnnotationQueue": false, + "v2.CreateLLMObsAnnotationQueueInteractions": false, "v2.CreateLLMObsDataset": false, "v2.CreateLLMObsDatasetRecords": false, "v2.CreateLLMObsExperiment": false, "v2.CreateLLMObsExperimentEvents": false, "v2.CreateLLMObsProject": false, + "v2.DeleteLLMObsAnnotationQueue": false, + "v2.DeleteLLMObsAnnotationQueueInteractions": false, "v2.DeleteLLMObsDatasetRecords": false, "v2.DeleteLLMObsDatasets": false, "v2.DeleteLLMObsExperiments": false, "v2.DeleteLLMObsProjects": false, + "v2.GetLLMObsAnnotatedInteractions": false, + "v2.ListLLMObsAnnotationQueues": false, "v2.ListLLMObsDatasetRecords": false, "v2.ListLLMObsDatasets": false, "v2.ListLLMObsExperiments": false, "v2.ListLLMObsProjects": false, + "v2.UpdateLLMObsAnnotationQueue": false, "v2.UpdateLLMObsDataset": false, "v2.UpdateLLMObsDatasetRecords": false, "v2.UpdateLLMObsExperiment": false, diff --git a/api/datadogV2/api_llm_observability.go b/api/datadogV2/api_llm_observability.go index f8457ab9086..e7660f31580 100644 --- a/api/datadogV2/api_llm_observability.go +++ b/api/datadogV2/api_llm_observability.go @@ -10,6 +10,7 @@ import ( _log "log" _nethttp "net/http" _neturl "net/url" + "reflect" "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) @@ -17,6 +18,205 @@ import ( // LLMObservabilityApi service type type LLMObservabilityApi datadog.Service +// CreateLLMObsAnnotationQueue Create an LLM Observability annotation queue. +// Create a new annotation queue. Only `name`, `project_id`, and `description` are accepted. +// Fields such as `created_by`, `owned_by`, `created_at`, `modified_by`, and `modified_at` are inferred by the backend. +func (a *LLMObservabilityApi) CreateLLMObsAnnotationQueue(ctx _context.Context, body LLMObsAnnotationQueueRequest) (LLMObsAnnotationQueueResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue LLMObsAnnotationQueueResponse + ) + + operationId := "v2.CreateLLMObsAnnotationQueue" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.LLMObservabilityApi.CreateLLMObsAnnotationQueue") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/llm-obs/v1/annotation-queues" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Content-Type"] = "application/json" + localVarHeaderParams["Accept"] = "application/json" + + // body params + localVarPostBody = &body + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + var v JSONAPIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// CreateLLMObsAnnotationQueueInteractions Add annotation queue interactions. +// Add one or more interactions (traces) to an annotation queue. +// At least one interaction must be provided. +func (a *LLMObservabilityApi) CreateLLMObsAnnotationQueueInteractions(ctx _context.Context, queueId string, body LLMObsAnnotationQueueInteractionsRequest) (LLMObsAnnotationQueueInteractionsResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue LLMObsAnnotationQueueInteractionsResponse + ) + + operationId := "v2.CreateLLMObsAnnotationQueueInteractions" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.LLMObservabilityApi.CreateLLMObsAnnotationQueueInteractions") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/llm-obs/v1/annotation-queues/{queue_id}/interactions" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{queue_id}", _neturl.PathEscape(datadog.ParameterToString(queueId, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Content-Type"] = "application/json" + localVarHeaderParams["Accept"] = "application/json" + + // body params + localVarPostBody = &body + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + var v JSONAPIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + // CreateLLMObsDataset Create an LLM Observability dataset. // Create a new LLM Observability dataset within the specified project. func (a *LLMObservabilityApi) CreateLLMObsDataset(ctx _context.Context, projectId string, body LLMObsDatasetRequest) (LLMObsDatasetResponse, *_nethttp.Response, error) { @@ -473,43 +673,397 @@ func (a *LLMObservabilityApi) CreateLLMObsProject(ctx _context.Context, body LLM var v JSONAPIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// DeleteLLMObsAnnotationQueue Delete an LLM Observability annotation queue. +// Delete an annotation queue by its ID. +func (a *LLMObservabilityApi) DeleteLLMObsAnnotationQueue(ctx _context.Context, queueId string) (*_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} + ) + + operationId := "v2.DeleteLLMObsAnnotationQueue" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.LLMObservabilityApi.DeleteLLMObsAnnotationQueue") + if err != nil { + return nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/llm-obs/v1/annotation-queues/{queue_id}" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{queue_id}", _neturl.PathEscape(datadog.ParameterToString(queueId, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Accept"] = "*/*" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + var v JSONAPIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +// DeleteLLMObsAnnotationQueueInteractions Delete annotation queue interactions. +// Delete one or more interactions from an annotation queue. +func (a *LLMObservabilityApi) DeleteLLMObsAnnotationQueueInteractions(ctx _context.Context, queueId string, body LLMObsDeleteAnnotationQueueInteractionsRequest) (*_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + ) + + operationId := "v2.DeleteLLMObsAnnotationQueueInteractions" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.LLMObservabilityApi.DeleteLLMObsAnnotationQueueInteractions") + if err != nil { + return nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/llm-obs/v1/annotation-queues/{queue_id}/interactions/delete" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{queue_id}", _neturl.PathEscape(datadog.ParameterToString(queueId, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Content-Type"] = "application/json" + localVarHeaderParams["Accept"] = "*/*" + + // body params + localVarPostBody = &body + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + var v JSONAPIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +// DeleteLLMObsDatasetRecords Delete LLM Observability dataset records. +// Delete one or more records from an LLM Observability dataset. +func (a *LLMObservabilityApi) DeleteLLMObsDatasetRecords(ctx _context.Context, projectId string, datasetId string, body LLMObsDeleteDatasetRecordsRequest) (*_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + ) + + operationId := "v2.DeleteLLMObsDatasetRecords" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.LLMObservabilityApi.DeleteLLMObsDatasetRecords") + if err != nil { + return nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/llm-obs/v1/{project_id}/datasets/{dataset_id}/records/delete" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{project_id}", _neturl.PathEscape(datadog.ParameterToString(projectId, ""))) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{dataset_id}", _neturl.PathEscape(datadog.ParameterToString(datasetId, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Content-Type"] = "application/json" + localVarHeaderParams["Accept"] = "*/*" + + // body params + localVarPostBody = &body + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + var v JSONAPIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +// DeleteLLMObsDatasets Delete LLM Observability datasets. +// Delete one or more LLM Observability datasets within the specified project. +func (a *LLMObservabilityApi) DeleteLLMObsDatasets(ctx _context.Context, projectId string, body LLMObsDeleteDatasetsRequest) (*_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + ) + + operationId := "v2.DeleteLLMObsDatasets" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.LLMObservabilityApi.DeleteLLMObsDatasets") + if err != nil { + return nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/llm-obs/v1/{project_id}/datasets/delete" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{project_id}", _neturl.PathEscape(datadog.ParameterToString(projectId, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Content-Type"] = "application/json" + localVarHeaderParams["Accept"] = "*/*" + + // body params + localVarPostBody = &body + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + var v JSONAPIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarHTTPResponse, newErr } newErr.ErrorModel = v - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } newErr.ErrorModel = v } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := datadog.GenericOpenAPIError{ - ErrorBody: localVarBody, - ErrorMessage: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHTTPResponse, nil + return localVarHTTPResponse, nil } -// DeleteLLMObsDatasetRecords Delete LLM Observability dataset records. -// Delete one or more records from an LLM Observability dataset. -func (a *LLMObservabilityApi) DeleteLLMObsDatasetRecords(ctx _context.Context, projectId string, datasetId string, body LLMObsDeleteDatasetRecordsRequest) (*_nethttp.Response, error) { +// DeleteLLMObsExperiments Delete LLM Observability experiments. +// Delete one or more LLM Observability experiments. +func (a *LLMObservabilityApi) DeleteLLMObsExperiments(ctx _context.Context, body LLMObsDeleteExperimentsRequest) (*_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} ) - operationId := "v2.DeleteLLMObsDatasetRecords" + operationId := "v2.DeleteLLMObsExperiments" isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) if !isOperationEnabled { return nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} @@ -518,14 +1072,12 @@ func (a *LLMObservabilityApi) DeleteLLMObsDatasetRecords(ctx _context.Context, p _log.Printf("WARNING: Using unstable operation '%s'", operationId) } - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.LLMObservabilityApi.DeleteLLMObsDatasetRecords") + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.LLMObservabilityApi.DeleteLLMObsExperiments") if err != nil { return nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/api/v2/llm-obs/v1/{project_id}/datasets/{dataset_id}/records/delete" - localVarPath = datadog.ReplacePathParameter(localVarPath, "{project_id}", _neturl.PathEscape(datadog.ParameterToString(projectId, ""))) - localVarPath = datadog.ReplacePathParameter(localVarPath, "{dataset_id}", _neturl.PathEscape(datadog.ParameterToString(datasetId, ""))) + localVarPath := localBasePath + "/api/v2/llm-obs/v1/experiments/delete" localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -568,7 +1120,7 @@ func (a *LLMObservabilityApi) DeleteLLMObsDatasetRecords(ctx _context.Context, p ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { var v JSONAPIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -591,15 +1143,15 @@ func (a *LLMObservabilityApi) DeleteLLMObsDatasetRecords(ctx _context.Context, p return localVarHTTPResponse, nil } -// DeleteLLMObsDatasets Delete LLM Observability datasets. -// Delete one or more LLM Observability datasets within the specified project. -func (a *LLMObservabilityApi) DeleteLLMObsDatasets(ctx _context.Context, projectId string, body LLMObsDeleteDatasetsRequest) (*_nethttp.Response, error) { +// DeleteLLMObsProjects Delete LLM Observability projects. +// Delete one or more LLM Observability projects. +func (a *LLMObservabilityApi) DeleteLLMObsProjects(ctx _context.Context, body LLMObsDeleteProjectsRequest) (*_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} ) - operationId := "v2.DeleteLLMObsDatasets" + operationId := "v2.DeleteLLMObsProjects" isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) if !isOperationEnabled { return nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} @@ -608,13 +1160,12 @@ func (a *LLMObservabilityApi) DeleteLLMObsDatasets(ctx _context.Context, project _log.Printf("WARNING: Using unstable operation '%s'", operationId) } - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.LLMObservabilityApi.DeleteLLMObsDatasets") + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.LLMObservabilityApi.DeleteLLMObsProjects") if err != nil { return nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/api/v2/llm-obs/v1/{project_id}/datasets/delete" - localVarPath = datadog.ReplacePathParameter(localVarPath, "{project_id}", _neturl.PathEscape(datadog.ParameterToString(projectId, ""))) + localVarPath := localBasePath + "/api/v2/llm-obs/v1/projects/delete" localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -657,7 +1208,7 @@ func (a *LLMObservabilityApi) DeleteLLMObsDatasets(ctx _context.Context, project ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { var v JSONAPIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -680,42 +1231,41 @@ func (a *LLMObservabilityApi) DeleteLLMObsDatasets(ctx _context.Context, project return localVarHTTPResponse, nil } -// DeleteLLMObsExperiments Delete LLM Observability experiments. -// Delete one or more LLM Observability experiments. -func (a *LLMObservabilityApi) DeleteLLMObsExperiments(ctx _context.Context, body LLMObsDeleteExperimentsRequest) (*_nethttp.Response, error) { +// GetLLMObsAnnotatedInteractions Get annotated queue interactions. +// Retrieve all interactions and their annotations for a given annotation queue. +func (a *LLMObservabilityApi) GetLLMObsAnnotatedInteractions(ctx _context.Context, queueId string) (LLMObsAnnotatedInteractionsResponse, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue LLMObsAnnotatedInteractionsResponse ) - operationId := "v2.DeleteLLMObsExperiments" + operationId := "v2.GetLLMObsAnnotatedInteractions" isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) if !isOperationEnabled { - return nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} } if isOperationEnabled && a.Client.Cfg.Debug { _log.Printf("WARNING: Using unstable operation '%s'", operationId) } - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.LLMObservabilityApi.DeleteLLMObsExperiments") + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.LLMObservabilityApi.GetLLMObsAnnotatedInteractions") if err != nil { - return nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/api/v2/llm-obs/v1/experiments/delete" + localVarPath := localBasePath + "/api/v2/llm-obs/v1/annotation-queues/{queue_id}/annotated-interactions" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{queue_id}", _neturl.PathEscape(datadog.ParameterToString(queueId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - localVarHeaderParams["Content-Type"] = "application/json" - localVarHeaderParams["Accept"] = "*/*" + localVarHeaderParams["Accept"] = "application/json" - // body params - localVarPostBody = &body if a.Client.Cfg.DelegatedTokenConfig != nil { err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) if err != nil { - return nil, err + return localVarReturnValue, nil, err } } else { datadog.SetAuthKeys( @@ -727,17 +1277,17 @@ func (a *LLMObservabilityApi) DeleteLLMObsExperiments(ctx _context.Context, body } req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) if err != nil { - return nil, err + return localVarReturnValue, nil, err } localVarHTTPResponse, err := a.Client.CallAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err + return localVarReturnValue, localVarHTTPResponse, err } localVarBody, err := datadog.ReadBody(localVarHTTPResponse) if err != nil { - return localVarHTTPResponse, err + return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { @@ -745,65 +1295,119 @@ func (a *LLMObservabilityApi) DeleteLLMObsExperiments(ctx _context.Context, body ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 { + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { var v JSONAPIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.ErrorModel = v - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.ErrorModel = v } - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarHTTPResponse, nil + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil } -// DeleteLLMObsProjects Delete LLM Observability projects. -// Delete one or more LLM Observability projects. -func (a *LLMObservabilityApi) DeleteLLMObsProjects(ctx _context.Context, body LLMObsDeleteProjectsRequest) (*_nethttp.Response, error) { +// ListLLMObsAnnotationQueuesOptionalParameters holds optional parameters for ListLLMObsAnnotationQueues. +type ListLLMObsAnnotationQueuesOptionalParameters struct { + ProjectId *string + QueueIds *[]string +} + +// NewListLLMObsAnnotationQueuesOptionalParameters creates an empty struct for parameters. +func NewListLLMObsAnnotationQueuesOptionalParameters() *ListLLMObsAnnotationQueuesOptionalParameters { + this := ListLLMObsAnnotationQueuesOptionalParameters{} + return &this +} + +// WithProjectId sets the corresponding parameter name and returns the struct. +func (r *ListLLMObsAnnotationQueuesOptionalParameters) WithProjectId(projectId string) *ListLLMObsAnnotationQueuesOptionalParameters { + r.ProjectId = &projectId + return r +} + +// WithQueueIds sets the corresponding parameter name and returns the struct. +func (r *ListLLMObsAnnotationQueuesOptionalParameters) WithQueueIds(queueIds []string) *ListLLMObsAnnotationQueuesOptionalParameters { + r.QueueIds = &queueIds + return r +} + +// ListLLMObsAnnotationQueues List LLM Observability annotation queues. +// List annotation queues. Optionally filter by project ID or queue IDs. These parameters are mutually exclusive. +// If neither is provided, all queues in the organization are returned. +func (a *LLMObservabilityApi) ListLLMObsAnnotationQueues(ctx _context.Context, o ...ListLLMObsAnnotationQueuesOptionalParameters) (LLMObsAnnotationQueuesResponse, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue LLMObsAnnotationQueuesResponse + optionalParams ListLLMObsAnnotationQueuesOptionalParameters ) - operationId := "v2.DeleteLLMObsProjects" + if len(o) > 1 { + return localVarReturnValue, nil, datadog.ReportError("only one argument of type ListLLMObsAnnotationQueuesOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + + operationId := "v2.ListLLMObsAnnotationQueues" isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) if !isOperationEnabled { - return nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} } if isOperationEnabled && a.Client.Cfg.Debug { _log.Printf("WARNING: Using unstable operation '%s'", operationId) } - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.LLMObservabilityApi.DeleteLLMObsProjects") + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.LLMObservabilityApi.ListLLMObsAnnotationQueues") if err != nil { - return nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/api/v2/llm-obs/v1/projects/delete" + localVarPath := localBasePath + "/api/v2/llm-obs/v1/annotation-queues" localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - localVarHeaderParams["Content-Type"] = "application/json" - localVarHeaderParams["Accept"] = "*/*" + if optionalParams.ProjectId != nil { + localVarQueryParams.Add("projectId", datadog.ParameterToString(*optionalParams.ProjectId, "")) + } + if optionalParams.QueueIds != nil { + t := *optionalParams.QueueIds + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + localVarQueryParams.Add("queueIds", datadog.ParameterToString(s.Index(i), "multi")) + } + } else { + localVarQueryParams.Add("queueIds", datadog.ParameterToString(t, "multi")) + } + } + localVarHeaderParams["Accept"] = "application/json" - // body params - localVarPostBody = &body if a.Client.Cfg.DelegatedTokenConfig != nil { err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) if err != nil { - return nil, err + return localVarReturnValue, nil, err } } else { datadog.SetAuthKeys( @@ -815,17 +1419,17 @@ func (a *LLMObservabilityApi) DeleteLLMObsProjects(ctx _context.Context, body LL } req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) if err != nil { - return nil, err + return localVarReturnValue, nil, err } localVarHTTPResponse, err := a.Client.CallAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err + return localVarReturnValue, localVarHTTPResponse, err } localVarBody, err := datadog.ReadBody(localVarHTTPResponse) if err != nil { - return localVarHTTPResponse, err + return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { @@ -837,23 +1441,32 @@ func (a *LLMObservabilityApi) DeleteLLMObsProjects(ctx _context.Context, body LL var v JSONAPIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.ErrorModel = v - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { var v APIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.ErrorModel = v } - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarHTTPResponse, nil + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil } // ListLLMObsDatasetRecordsOptionalParameters holds optional parameters for ListLLMObsDatasetRecords. @@ -1471,6 +2084,105 @@ func (a *LLMObservabilityApi) ListLLMObsProjects(ctx _context.Context, o ...List return localVarReturnValue, localVarHTTPResponse, nil } +// UpdateLLMObsAnnotationQueue Update an LLM Observability annotation queue. +// Partially update an annotation queue. Only `name` and `description` can be updated. +func (a *LLMObservabilityApi) UpdateLLMObsAnnotationQueue(ctx _context.Context, queueId string, body LLMObsAnnotationQueueUpdateRequest) (LLMObsAnnotationQueueResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + localVarReturnValue LLMObsAnnotationQueueResponse + ) + + operationId := "v2.UpdateLLMObsAnnotationQueue" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.LLMObservabilityApi.UpdateLLMObsAnnotationQueue") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/llm-obs/v1/annotation-queues/{queue_id}" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{queue_id}", _neturl.PathEscape(datadog.ParameterToString(queueId, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Content-Type"] = "application/json" + localVarHeaderParams["Accept"] = "application/json" + + // body params + localVarPostBody = &body + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + var v JSONAPIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + // UpdateLLMObsDataset Update an LLM Observability dataset. // Partially update an existing LLM Observability dataset within the specified project. func (a *LLMObservabilityApi) UpdateLLMObsDataset(ctx _context.Context, projectId string, datasetId string, body LLMObsDatasetUpdateRequest) (LLMObsDatasetResponse, *_nethttp.Response, error) { diff --git a/api/datadogV2/doc.go b/api/datadogV2/doc.go index a2ac7c304f2..f3c77c2b3c4 100644 --- a/api/datadogV2/doc.go +++ b/api/datadogV2/doc.go @@ -430,19 +430,26 @@ // - [KeyManagementApi.UpdateAPIKey] // - [KeyManagementApi.UpdateApplicationKey] // - [KeyManagementApi.UpdateCurrentUserApplicationKey] +// - [LLMObservabilityApi.CreateLLMObsAnnotationQueue] +// - [LLMObservabilityApi.CreateLLMObsAnnotationQueueInteractions] // - [LLMObservabilityApi.CreateLLMObsDataset] // - [LLMObservabilityApi.CreateLLMObsDatasetRecords] // - [LLMObservabilityApi.CreateLLMObsExperiment] // - [LLMObservabilityApi.CreateLLMObsExperimentEvents] // - [LLMObservabilityApi.CreateLLMObsProject] +// - [LLMObservabilityApi.DeleteLLMObsAnnotationQueue] +// - [LLMObservabilityApi.DeleteLLMObsAnnotationQueueInteractions] // - [LLMObservabilityApi.DeleteLLMObsDatasetRecords] // - [LLMObservabilityApi.DeleteLLMObsDatasets] // - [LLMObservabilityApi.DeleteLLMObsExperiments] // - [LLMObservabilityApi.DeleteLLMObsProjects] +// - [LLMObservabilityApi.GetLLMObsAnnotatedInteractions] +// - [LLMObservabilityApi.ListLLMObsAnnotationQueues] // - [LLMObservabilityApi.ListLLMObsDatasetRecords] // - [LLMObservabilityApi.ListLLMObsDatasets] // - [LLMObservabilityApi.ListLLMObsExperiments] // - [LLMObservabilityApi.ListLLMObsProjects] +// - [LLMObservabilityApi.UpdateLLMObsAnnotationQueue] // - [LLMObservabilityApi.UpdateLLMObsDataset] // - [LLMObservabilityApi.UpdateLLMObsDatasetRecords] // - [LLMObservabilityApi.UpdateLLMObsExperiment] diff --git a/api/datadogV2/model_llm_obs_annotated_interaction_item.go b/api/datadogV2/model_llm_obs_annotated_interaction_item.go new file mode 100644 index 00000000000..a42466c291f --- /dev/null +++ b/api/datadogV2/model_llm_obs_annotated_interaction_item.go @@ -0,0 +1,207 @@ +// 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 datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsAnnotatedInteractionItem An interaction with its associated annotations. +type LLMObsAnnotatedInteractionItem struct { + // List of annotations for this interaction. + Annotations []LLMObsAnnotationItem `json:"annotations"` + // Identifier of the content for this interaction. + ContentId string `json:"content_id"` + // Unique identifier of the interaction. + Id string `json:"id"` + // Type of interaction in an annotation queue. + Type LLMObsInteractionType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsAnnotatedInteractionItem instantiates a new LLMObsAnnotatedInteractionItem object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsAnnotatedInteractionItem(annotations []LLMObsAnnotationItem, contentId string, id string, typeVar LLMObsInteractionType) *LLMObsAnnotatedInteractionItem { + this := LLMObsAnnotatedInteractionItem{} + this.Annotations = annotations + this.ContentId = contentId + this.Id = id + this.Type = typeVar + return &this +} + +// NewLLMObsAnnotatedInteractionItemWithDefaults instantiates a new LLMObsAnnotatedInteractionItem object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsAnnotatedInteractionItemWithDefaults() *LLMObsAnnotatedInteractionItem { + this := LLMObsAnnotatedInteractionItem{} + return &this +} + +// GetAnnotations returns the Annotations field value. +func (o *LLMObsAnnotatedInteractionItem) GetAnnotations() []LLMObsAnnotationItem { + if o == nil { + var ret []LLMObsAnnotationItem + return ret + } + return o.Annotations +} + +// GetAnnotationsOk returns a tuple with the Annotations field value +// and a boolean to check if the value has been set. +func (o *LLMObsAnnotatedInteractionItem) GetAnnotationsOk() (*[]LLMObsAnnotationItem, bool) { + if o == nil { + return nil, false + } + return &o.Annotations, true +} + +// SetAnnotations sets field value. +func (o *LLMObsAnnotatedInteractionItem) SetAnnotations(v []LLMObsAnnotationItem) { + o.Annotations = v +} + +// GetContentId returns the ContentId field value. +func (o *LLMObsAnnotatedInteractionItem) GetContentId() string { + if o == nil { + var ret string + return ret + } + return o.ContentId +} + +// GetContentIdOk returns a tuple with the ContentId field value +// and a boolean to check if the value has been set. +func (o *LLMObsAnnotatedInteractionItem) GetContentIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ContentId, true +} + +// SetContentId sets field value. +func (o *LLMObsAnnotatedInteractionItem) SetContentId(v string) { + o.ContentId = v +} + +// GetId returns the Id field value. +func (o *LLMObsAnnotatedInteractionItem) GetId() string { + if o == nil { + var ret string + return ret + } + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *LLMObsAnnotatedInteractionItem) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value. +func (o *LLMObsAnnotatedInteractionItem) SetId(v string) { + o.Id = v +} + +// GetType returns the Type field value. +func (o *LLMObsAnnotatedInteractionItem) GetType() LLMObsInteractionType { + if o == nil { + var ret LLMObsInteractionType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *LLMObsAnnotatedInteractionItem) GetTypeOk() (*LLMObsInteractionType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *LLMObsAnnotatedInteractionItem) SetType(v LLMObsInteractionType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsAnnotatedInteractionItem) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["annotations"] = o.Annotations + toSerialize["content_id"] = o.ContentId + toSerialize["id"] = o.Id + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsAnnotatedInteractionItem) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Annotations *[]LLMObsAnnotationItem `json:"annotations"` + ContentId *string `json:"content_id"` + Id *string `json:"id"` + Type *LLMObsInteractionType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Annotations == nil { + return fmt.Errorf("required field annotations missing") + } + if all.ContentId == nil { + return fmt.Errorf("required field content_id missing") + } + if all.Id == nil { + return fmt.Errorf("required field id missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"annotations", "content_id", "id", "type"}) + } else { + return err + } + + hasInvalidField := false + o.Annotations = *all.Annotations + o.ContentId = *all.ContentId + o.Id = *all.Id + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_annotated_interactions_data_attributes_response.go b/api/datadogV2/model_llm_obs_annotated_interactions_data_attributes_response.go new file mode 100644 index 00000000000..5167dff66c5 --- /dev/null +++ b/api/datadogV2/model_llm_obs_annotated_interactions_data_attributes_response.go @@ -0,0 +1,101 @@ +// 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 datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsAnnotatedInteractionsDataAttributesResponse Attributes containing the list of annotated interactions. +type LLMObsAnnotatedInteractionsDataAttributesResponse struct { + // List of interactions with their annotations. + AnnotatedInteractions []LLMObsAnnotatedInteractionItem `json:"annotated_interactions"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsAnnotatedInteractionsDataAttributesResponse instantiates a new LLMObsAnnotatedInteractionsDataAttributesResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsAnnotatedInteractionsDataAttributesResponse(annotatedInteractions []LLMObsAnnotatedInteractionItem) *LLMObsAnnotatedInteractionsDataAttributesResponse { + this := LLMObsAnnotatedInteractionsDataAttributesResponse{} + this.AnnotatedInteractions = annotatedInteractions + return &this +} + +// NewLLMObsAnnotatedInteractionsDataAttributesResponseWithDefaults instantiates a new LLMObsAnnotatedInteractionsDataAttributesResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsAnnotatedInteractionsDataAttributesResponseWithDefaults() *LLMObsAnnotatedInteractionsDataAttributesResponse { + this := LLMObsAnnotatedInteractionsDataAttributesResponse{} + return &this +} + +// GetAnnotatedInteractions returns the AnnotatedInteractions field value. +func (o *LLMObsAnnotatedInteractionsDataAttributesResponse) GetAnnotatedInteractions() []LLMObsAnnotatedInteractionItem { + if o == nil { + var ret []LLMObsAnnotatedInteractionItem + return ret + } + return o.AnnotatedInteractions +} + +// GetAnnotatedInteractionsOk returns a tuple with the AnnotatedInteractions field value +// and a boolean to check if the value has been set. +func (o *LLMObsAnnotatedInteractionsDataAttributesResponse) GetAnnotatedInteractionsOk() (*[]LLMObsAnnotatedInteractionItem, bool) { + if o == nil { + return nil, false + } + return &o.AnnotatedInteractions, true +} + +// SetAnnotatedInteractions sets field value. +func (o *LLMObsAnnotatedInteractionsDataAttributesResponse) SetAnnotatedInteractions(v []LLMObsAnnotatedInteractionItem) { + o.AnnotatedInteractions = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsAnnotatedInteractionsDataAttributesResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["annotated_interactions"] = o.AnnotatedInteractions + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsAnnotatedInteractionsDataAttributesResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + AnnotatedInteractions *[]LLMObsAnnotatedInteractionItem `json:"annotated_interactions"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.AnnotatedInteractions == nil { + return fmt.Errorf("required field annotated_interactions missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"annotated_interactions"}) + } else { + return err + } + o.AnnotatedInteractions = *all.AnnotatedInteractions + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_annotated_interactions_data_response.go b/api/datadogV2/model_llm_obs_annotated_interactions_data_response.go new file mode 100644 index 00000000000..3cdfa031a10 --- /dev/null +++ b/api/datadogV2/model_llm_obs_annotated_interactions_data_response.go @@ -0,0 +1,178 @@ +// 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 datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsAnnotatedInteractionsDataResponse Data object for annotated interactions. +type LLMObsAnnotatedInteractionsDataResponse struct { + // Attributes containing the list of annotated interactions. + Attributes LLMObsAnnotatedInteractionsDataAttributesResponse `json:"attributes"` + // The queue ID. + Id string `json:"id"` + // Resource type for annotated interactions. + Type LLMObsAnnotatedInteractionsType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsAnnotatedInteractionsDataResponse instantiates a new LLMObsAnnotatedInteractionsDataResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsAnnotatedInteractionsDataResponse(attributes LLMObsAnnotatedInteractionsDataAttributesResponse, id string, typeVar LLMObsAnnotatedInteractionsType) *LLMObsAnnotatedInteractionsDataResponse { + this := LLMObsAnnotatedInteractionsDataResponse{} + this.Attributes = attributes + this.Id = id + this.Type = typeVar + return &this +} + +// NewLLMObsAnnotatedInteractionsDataResponseWithDefaults instantiates a new LLMObsAnnotatedInteractionsDataResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsAnnotatedInteractionsDataResponseWithDefaults() *LLMObsAnnotatedInteractionsDataResponse { + this := LLMObsAnnotatedInteractionsDataResponse{} + return &this +} + +// GetAttributes returns the Attributes field value. +func (o *LLMObsAnnotatedInteractionsDataResponse) GetAttributes() LLMObsAnnotatedInteractionsDataAttributesResponse { + if o == nil { + var ret LLMObsAnnotatedInteractionsDataAttributesResponse + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value +// and a boolean to check if the value has been set. +func (o *LLMObsAnnotatedInteractionsDataResponse) GetAttributesOk() (*LLMObsAnnotatedInteractionsDataAttributesResponse, bool) { + if o == nil { + return nil, false + } + return &o.Attributes, true +} + +// SetAttributes sets field value. +func (o *LLMObsAnnotatedInteractionsDataResponse) SetAttributes(v LLMObsAnnotatedInteractionsDataAttributesResponse) { + o.Attributes = v +} + +// GetId returns the Id field value. +func (o *LLMObsAnnotatedInteractionsDataResponse) GetId() string { + if o == nil { + var ret string + return ret + } + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *LLMObsAnnotatedInteractionsDataResponse) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value. +func (o *LLMObsAnnotatedInteractionsDataResponse) SetId(v string) { + o.Id = v +} + +// GetType returns the Type field value. +func (o *LLMObsAnnotatedInteractionsDataResponse) GetType() LLMObsAnnotatedInteractionsType { + if o == nil { + var ret LLMObsAnnotatedInteractionsType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *LLMObsAnnotatedInteractionsDataResponse) GetTypeOk() (*LLMObsAnnotatedInteractionsType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *LLMObsAnnotatedInteractionsDataResponse) SetType(v LLMObsAnnotatedInteractionsType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsAnnotatedInteractionsDataResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["attributes"] = o.Attributes + toSerialize["id"] = o.Id + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsAnnotatedInteractionsDataResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *LLMObsAnnotatedInteractionsDataAttributesResponse `json:"attributes"` + Id *string `json:"id"` + Type *LLMObsAnnotatedInteractionsType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Attributes == nil { + return fmt.Errorf("required field attributes missing") + } + if all.Id == nil { + return fmt.Errorf("required field id missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "id", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = *all.Attributes + o.Id = *all.Id + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_annotated_interactions_response.go b/api/datadogV2/model_llm_obs_annotated_interactions_response.go new file mode 100644 index 00000000000..ec248eba431 --- /dev/null +++ b/api/datadogV2/model_llm_obs_annotated_interactions_response.go @@ -0,0 +1,110 @@ +// 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 datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsAnnotatedInteractionsResponse Response containing the annotated interactions for an annotation queue. +type LLMObsAnnotatedInteractionsResponse struct { + // Data object for annotated interactions. + Data LLMObsAnnotatedInteractionsDataResponse `json:"data"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsAnnotatedInteractionsResponse instantiates a new LLMObsAnnotatedInteractionsResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsAnnotatedInteractionsResponse(data LLMObsAnnotatedInteractionsDataResponse) *LLMObsAnnotatedInteractionsResponse { + this := LLMObsAnnotatedInteractionsResponse{} + this.Data = data + return &this +} + +// NewLLMObsAnnotatedInteractionsResponseWithDefaults instantiates a new LLMObsAnnotatedInteractionsResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsAnnotatedInteractionsResponseWithDefaults() *LLMObsAnnotatedInteractionsResponse { + this := LLMObsAnnotatedInteractionsResponse{} + return &this +} + +// GetData returns the Data field value. +func (o *LLMObsAnnotatedInteractionsResponse) GetData() LLMObsAnnotatedInteractionsDataResponse { + if o == nil { + var ret LLMObsAnnotatedInteractionsDataResponse + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *LLMObsAnnotatedInteractionsResponse) GetDataOk() (*LLMObsAnnotatedInteractionsDataResponse, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value. +func (o *LLMObsAnnotatedInteractionsResponse) SetData(v LLMObsAnnotatedInteractionsDataResponse) { + o.Data = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsAnnotatedInteractionsResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["data"] = o.Data + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsAnnotatedInteractionsResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *LLMObsAnnotatedInteractionsDataResponse `json:"data"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Data == nil { + return fmt.Errorf("required field data missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + + hasInvalidField := false + if all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = *all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_annotated_interactions_type.go b/api/datadogV2/model_llm_obs_annotated_interactions_type.go new file mode 100644 index 00000000000..f8594932fec --- /dev/null +++ b/api/datadogV2/model_llm_obs_annotated_interactions_type.go @@ -0,0 +1,64 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsAnnotatedInteractionsType Resource type for annotated interactions. +type LLMObsAnnotatedInteractionsType string + +// List of LLMObsAnnotatedInteractionsType. +const ( + LLMOBSANNOTATEDINTERACTIONSTYPE_ANNOTATED_INTERACTIONS LLMObsAnnotatedInteractionsType = "annotated_interactions" +) + +var allowedLLMObsAnnotatedInteractionsTypeEnumValues = []LLMObsAnnotatedInteractionsType{ + LLMOBSANNOTATEDINTERACTIONSTYPE_ANNOTATED_INTERACTIONS, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *LLMObsAnnotatedInteractionsType) GetAllowedValues() []LLMObsAnnotatedInteractionsType { + return allowedLLMObsAnnotatedInteractionsTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *LLMObsAnnotatedInteractionsType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = LLMObsAnnotatedInteractionsType(value) + return nil +} + +// NewLLMObsAnnotatedInteractionsTypeFromValue returns a pointer to a valid LLMObsAnnotatedInteractionsType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewLLMObsAnnotatedInteractionsTypeFromValue(v string) (*LLMObsAnnotatedInteractionsType, error) { + ev := LLMObsAnnotatedInteractionsType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for LLMObsAnnotatedInteractionsType: valid values are %v", v, allowedLLMObsAnnotatedInteractionsTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v LLMObsAnnotatedInteractionsType) IsValid() bool { + for _, existing := range allowedLLMObsAnnotatedInteractionsTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to LLMObsAnnotatedInteractionsType value. +func (v LLMObsAnnotatedInteractionsType) Ptr() *LLMObsAnnotatedInteractionsType { + return &v +} diff --git a/api/datadogV2/model_llm_obs_annotation_item.go b/api/datadogV2/model_llm_obs_annotation_item.go new file mode 100644 index 00000000000..539aae695f4 --- /dev/null +++ b/api/datadogV2/model_llm_obs_annotation_item.go @@ -0,0 +1,302 @@ +// 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 datadogV2 + +import ( + "fmt" + "time" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsAnnotationItem A single annotation on an interaction. +type LLMObsAnnotationItem struct { + // Timestamp when the annotation was created. + CreatedAt time.Time `json:"created_at"` + // Identifier of the user who created the annotation. + CreatedBy string `json:"created_by"` + // Unique identifier of the annotation. + Id string `json:"id"` + // Identifier of the interaction this annotation belongs to. + InteractionId string `json:"interaction_id"` + // The label values for this annotation. + LabelValues map[string]interface{} `json:"label_values"` + // Timestamp when the annotation was last modified. + ModifiedAt time.Time `json:"modified_at"` + // Identifier of the user who last modified the annotation. + ModifiedBy string `json:"modified_by"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsAnnotationItem instantiates a new LLMObsAnnotationItem object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsAnnotationItem(createdAt time.Time, createdBy string, id string, interactionId string, labelValues map[string]interface{}, modifiedAt time.Time, modifiedBy string) *LLMObsAnnotationItem { + this := LLMObsAnnotationItem{} + this.CreatedAt = createdAt + this.CreatedBy = createdBy + this.Id = id + this.InteractionId = interactionId + this.LabelValues = labelValues + this.ModifiedAt = modifiedAt + this.ModifiedBy = modifiedBy + return &this +} + +// NewLLMObsAnnotationItemWithDefaults instantiates a new LLMObsAnnotationItem object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsAnnotationItemWithDefaults() *LLMObsAnnotationItem { + this := LLMObsAnnotationItem{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value. +func (o *LLMObsAnnotationItem) GetCreatedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + return o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value +// and a boolean to check if the value has been set. +func (o *LLMObsAnnotationItem) GetCreatedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.CreatedAt, true +} + +// SetCreatedAt sets field value. +func (o *LLMObsAnnotationItem) SetCreatedAt(v time.Time) { + o.CreatedAt = v +} + +// GetCreatedBy returns the CreatedBy field value. +func (o *LLMObsAnnotationItem) GetCreatedBy() string { + if o == nil { + var ret string + return ret + } + return o.CreatedBy +} + +// GetCreatedByOk returns a tuple with the CreatedBy field value +// and a boolean to check if the value has been set. +func (o *LLMObsAnnotationItem) GetCreatedByOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CreatedBy, true +} + +// SetCreatedBy sets field value. +func (o *LLMObsAnnotationItem) SetCreatedBy(v string) { + o.CreatedBy = v +} + +// GetId returns the Id field value. +func (o *LLMObsAnnotationItem) GetId() string { + if o == nil { + var ret string + return ret + } + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *LLMObsAnnotationItem) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value. +func (o *LLMObsAnnotationItem) SetId(v string) { + o.Id = v +} + +// GetInteractionId returns the InteractionId field value. +func (o *LLMObsAnnotationItem) GetInteractionId() string { + if o == nil { + var ret string + return ret + } + return o.InteractionId +} + +// GetInteractionIdOk returns a tuple with the InteractionId field value +// and a boolean to check if the value has been set. +func (o *LLMObsAnnotationItem) GetInteractionIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.InteractionId, true +} + +// SetInteractionId sets field value. +func (o *LLMObsAnnotationItem) SetInteractionId(v string) { + o.InteractionId = v +} + +// GetLabelValues returns the LabelValues field value. +func (o *LLMObsAnnotationItem) GetLabelValues() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + return o.LabelValues +} + +// GetLabelValuesOk returns a tuple with the LabelValues field value +// and a boolean to check if the value has been set. +func (o *LLMObsAnnotationItem) GetLabelValuesOk() (*map[string]interface{}, bool) { + if o == nil { + return nil, false + } + return &o.LabelValues, true +} + +// SetLabelValues sets field value. +func (o *LLMObsAnnotationItem) SetLabelValues(v map[string]interface{}) { + o.LabelValues = v +} + +// GetModifiedAt returns the ModifiedAt field value. +func (o *LLMObsAnnotationItem) GetModifiedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + return o.ModifiedAt +} + +// GetModifiedAtOk returns a tuple with the ModifiedAt field value +// and a boolean to check if the value has been set. +func (o *LLMObsAnnotationItem) GetModifiedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.ModifiedAt, true +} + +// SetModifiedAt sets field value. +func (o *LLMObsAnnotationItem) SetModifiedAt(v time.Time) { + o.ModifiedAt = v +} + +// GetModifiedBy returns the ModifiedBy field value. +func (o *LLMObsAnnotationItem) GetModifiedBy() string { + if o == nil { + var ret string + return ret + } + return o.ModifiedBy +} + +// GetModifiedByOk returns a tuple with the ModifiedBy field value +// and a boolean to check if the value has been set. +func (o *LLMObsAnnotationItem) GetModifiedByOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ModifiedBy, true +} + +// SetModifiedBy sets field value. +func (o *LLMObsAnnotationItem) SetModifiedBy(v string) { + o.ModifiedBy = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsAnnotationItem) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.CreatedAt.Nanosecond() == 0 { + toSerialize["created_at"] = o.CreatedAt.Format("2006-01-02T15:04:05Z07:00") + } else { + toSerialize["created_at"] = o.CreatedAt.Format("2006-01-02T15:04:05.000Z07:00") + } + toSerialize["created_by"] = o.CreatedBy + toSerialize["id"] = o.Id + toSerialize["interaction_id"] = o.InteractionId + toSerialize["label_values"] = o.LabelValues + if o.ModifiedAt.Nanosecond() == 0 { + toSerialize["modified_at"] = o.ModifiedAt.Format("2006-01-02T15:04:05Z07:00") + } else { + toSerialize["modified_at"] = o.ModifiedAt.Format("2006-01-02T15:04:05.000Z07:00") + } + toSerialize["modified_by"] = o.ModifiedBy + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsAnnotationItem) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + CreatedAt *time.Time `json:"created_at"` + CreatedBy *string `json:"created_by"` + Id *string `json:"id"` + InteractionId *string `json:"interaction_id"` + LabelValues *map[string]interface{} `json:"label_values"` + ModifiedAt *time.Time `json:"modified_at"` + ModifiedBy *string `json:"modified_by"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.CreatedAt == nil { + return fmt.Errorf("required field created_at missing") + } + if all.CreatedBy == nil { + return fmt.Errorf("required field created_by missing") + } + if all.Id == nil { + return fmt.Errorf("required field id missing") + } + if all.InteractionId == nil { + return fmt.Errorf("required field interaction_id missing") + } + if all.LabelValues == nil { + return fmt.Errorf("required field label_values missing") + } + if all.ModifiedAt == nil { + return fmt.Errorf("required field modified_at missing") + } + if all.ModifiedBy == nil { + return fmt.Errorf("required field modified_by missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"created_at", "created_by", "id", "interaction_id", "label_values", "modified_at", "modified_by"}) + } else { + return err + } + o.CreatedAt = *all.CreatedAt + o.CreatedBy = *all.CreatedBy + o.Id = *all.Id + o.InteractionId = *all.InteractionId + o.LabelValues = *all.LabelValues + o.ModifiedAt = *all.ModifiedAt + o.ModifiedBy = *all.ModifiedBy + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_annotation_queue_data_attributes_request.go b/api/datadogV2/model_llm_obs_annotation_queue_data_attributes_request.go new file mode 100644 index 00000000000..b15bbc9b1d5 --- /dev/null +++ b/api/datadogV2/model_llm_obs_annotation_queue_data_attributes_request.go @@ -0,0 +1,168 @@ +// 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 datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsAnnotationQueueDataAttributesRequest Attributes for creating an LLM Observability annotation queue. +type LLMObsAnnotationQueueDataAttributesRequest struct { + // Description of the annotation queue. + Description *string `json:"description,omitempty"` + // Name of the annotation queue. + Name string `json:"name"` + // Identifier of the project this queue belongs to. + ProjectId string `json:"project_id"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsAnnotationQueueDataAttributesRequest instantiates a new LLMObsAnnotationQueueDataAttributesRequest object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsAnnotationQueueDataAttributesRequest(name string, projectId string) *LLMObsAnnotationQueueDataAttributesRequest { + this := LLMObsAnnotationQueueDataAttributesRequest{} + this.Name = name + this.ProjectId = projectId + return &this +} + +// NewLLMObsAnnotationQueueDataAttributesRequestWithDefaults instantiates a new LLMObsAnnotationQueueDataAttributesRequest object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsAnnotationQueueDataAttributesRequestWithDefaults() *LLMObsAnnotationQueueDataAttributesRequest { + this := LLMObsAnnotationQueueDataAttributesRequest{} + return &this +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *LLMObsAnnotationQueueDataAttributesRequest) GetDescription() string { + if o == nil || o.Description == nil { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsAnnotationQueueDataAttributesRequest) GetDescriptionOk() (*string, bool) { + if o == nil || o.Description == nil { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *LLMObsAnnotationQueueDataAttributesRequest) HasDescription() bool { + return o != nil && o.Description != nil +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *LLMObsAnnotationQueueDataAttributesRequest) SetDescription(v string) { + o.Description = &v +} + +// GetName returns the Name field value. +func (o *LLMObsAnnotationQueueDataAttributesRequest) GetName() string { + if o == nil { + var ret string + return ret + } + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *LLMObsAnnotationQueueDataAttributesRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value. +func (o *LLMObsAnnotationQueueDataAttributesRequest) SetName(v string) { + o.Name = v +} + +// GetProjectId returns the ProjectId field value. +func (o *LLMObsAnnotationQueueDataAttributesRequest) GetProjectId() string { + if o == nil { + var ret string + return ret + } + return o.ProjectId +} + +// GetProjectIdOk returns a tuple with the ProjectId field value +// and a boolean to check if the value has been set. +func (o *LLMObsAnnotationQueueDataAttributesRequest) GetProjectIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ProjectId, true +} + +// SetProjectId sets field value. +func (o *LLMObsAnnotationQueueDataAttributesRequest) SetProjectId(v string) { + o.ProjectId = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsAnnotationQueueDataAttributesRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Description != nil { + toSerialize["description"] = o.Description + } + toSerialize["name"] = o.Name + toSerialize["project_id"] = o.ProjectId + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsAnnotationQueueDataAttributesRequest) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Description *string `json:"description,omitempty"` + Name *string `json:"name"` + ProjectId *string `json:"project_id"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Name == nil { + return fmt.Errorf("required field name missing") + } + if all.ProjectId == nil { + return fmt.Errorf("required field project_id missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"description", "name", "project_id"}) + } else { + return err + } + o.Description = all.Description + o.Name = *all.Name + o.ProjectId = *all.ProjectId + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_annotation_queue_data_attributes_response.go b/api/datadogV2/model_llm_obs_annotation_queue_data_attributes_response.go new file mode 100644 index 00000000000..8e375b91f9a --- /dev/null +++ b/api/datadogV2/model_llm_obs_annotation_queue_data_attributes_response.go @@ -0,0 +1,334 @@ +// 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 datadogV2 + +import ( + "fmt" + "time" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsAnnotationQueueDataAttributesResponse Attributes of an LLM Observability annotation queue. +type LLMObsAnnotationQueueDataAttributesResponse struct { + // Timestamp when the queue was created. + CreatedAt time.Time `json:"created_at"` + // Identifier of the user who created the queue. + CreatedBy string `json:"created_by"` + // Description of the annotation queue. + Description string `json:"description"` + // Timestamp when the queue was last modified. + ModifiedAt time.Time `json:"modified_at"` + // Identifier of the user who last modified the queue. + ModifiedBy string `json:"modified_by"` + // Name of the annotation queue. + Name string `json:"name"` + // Identifier of the user who owns the queue. + OwnedBy string `json:"owned_by"` + // Identifier of the project this queue belongs to. + ProjectId string `json:"project_id"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsAnnotationQueueDataAttributesResponse instantiates a new LLMObsAnnotationQueueDataAttributesResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsAnnotationQueueDataAttributesResponse(createdAt time.Time, createdBy string, description string, modifiedAt time.Time, modifiedBy string, name string, ownedBy string, projectId string) *LLMObsAnnotationQueueDataAttributesResponse { + this := LLMObsAnnotationQueueDataAttributesResponse{} + this.CreatedAt = createdAt + this.CreatedBy = createdBy + this.Description = description + this.ModifiedAt = modifiedAt + this.ModifiedBy = modifiedBy + this.Name = name + this.OwnedBy = ownedBy + this.ProjectId = projectId + return &this +} + +// NewLLMObsAnnotationQueueDataAttributesResponseWithDefaults instantiates a new LLMObsAnnotationQueueDataAttributesResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsAnnotationQueueDataAttributesResponseWithDefaults() *LLMObsAnnotationQueueDataAttributesResponse { + this := LLMObsAnnotationQueueDataAttributesResponse{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value. +func (o *LLMObsAnnotationQueueDataAttributesResponse) GetCreatedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + return o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value +// and a boolean to check if the value has been set. +func (o *LLMObsAnnotationQueueDataAttributesResponse) GetCreatedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.CreatedAt, true +} + +// SetCreatedAt sets field value. +func (o *LLMObsAnnotationQueueDataAttributesResponse) SetCreatedAt(v time.Time) { + o.CreatedAt = v +} + +// GetCreatedBy returns the CreatedBy field value. +func (o *LLMObsAnnotationQueueDataAttributesResponse) GetCreatedBy() string { + if o == nil { + var ret string + return ret + } + return o.CreatedBy +} + +// GetCreatedByOk returns a tuple with the CreatedBy field value +// and a boolean to check if the value has been set. +func (o *LLMObsAnnotationQueueDataAttributesResponse) GetCreatedByOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CreatedBy, true +} + +// SetCreatedBy sets field value. +func (o *LLMObsAnnotationQueueDataAttributesResponse) SetCreatedBy(v string) { + o.CreatedBy = v +} + +// GetDescription returns the Description field value. +func (o *LLMObsAnnotationQueueDataAttributesResponse) GetDescription() string { + if o == nil { + var ret string + return ret + } + return o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value +// and a boolean to check if the value has been set. +func (o *LLMObsAnnotationQueueDataAttributesResponse) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Description, true +} + +// SetDescription sets field value. +func (o *LLMObsAnnotationQueueDataAttributesResponse) SetDescription(v string) { + o.Description = v +} + +// GetModifiedAt returns the ModifiedAt field value. +func (o *LLMObsAnnotationQueueDataAttributesResponse) GetModifiedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + return o.ModifiedAt +} + +// GetModifiedAtOk returns a tuple with the ModifiedAt field value +// and a boolean to check if the value has been set. +func (o *LLMObsAnnotationQueueDataAttributesResponse) GetModifiedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.ModifiedAt, true +} + +// SetModifiedAt sets field value. +func (o *LLMObsAnnotationQueueDataAttributesResponse) SetModifiedAt(v time.Time) { + o.ModifiedAt = v +} + +// GetModifiedBy returns the ModifiedBy field value. +func (o *LLMObsAnnotationQueueDataAttributesResponse) GetModifiedBy() string { + if o == nil { + var ret string + return ret + } + return o.ModifiedBy +} + +// GetModifiedByOk returns a tuple with the ModifiedBy field value +// and a boolean to check if the value has been set. +func (o *LLMObsAnnotationQueueDataAttributesResponse) GetModifiedByOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ModifiedBy, true +} + +// SetModifiedBy sets field value. +func (o *LLMObsAnnotationQueueDataAttributesResponse) SetModifiedBy(v string) { + o.ModifiedBy = v +} + +// GetName returns the Name field value. +func (o *LLMObsAnnotationQueueDataAttributesResponse) GetName() string { + if o == nil { + var ret string + return ret + } + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *LLMObsAnnotationQueueDataAttributesResponse) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value. +func (o *LLMObsAnnotationQueueDataAttributesResponse) SetName(v string) { + o.Name = v +} + +// GetOwnedBy returns the OwnedBy field value. +func (o *LLMObsAnnotationQueueDataAttributesResponse) GetOwnedBy() string { + if o == nil { + var ret string + return ret + } + return o.OwnedBy +} + +// GetOwnedByOk returns a tuple with the OwnedBy field value +// and a boolean to check if the value has been set. +func (o *LLMObsAnnotationQueueDataAttributesResponse) GetOwnedByOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.OwnedBy, true +} + +// SetOwnedBy sets field value. +func (o *LLMObsAnnotationQueueDataAttributesResponse) SetOwnedBy(v string) { + o.OwnedBy = v +} + +// GetProjectId returns the ProjectId field value. +func (o *LLMObsAnnotationQueueDataAttributesResponse) GetProjectId() string { + if o == nil { + var ret string + return ret + } + return o.ProjectId +} + +// GetProjectIdOk returns a tuple with the ProjectId field value +// and a boolean to check if the value has been set. +func (o *LLMObsAnnotationQueueDataAttributesResponse) GetProjectIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ProjectId, true +} + +// SetProjectId sets field value. +func (o *LLMObsAnnotationQueueDataAttributesResponse) SetProjectId(v string) { + o.ProjectId = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsAnnotationQueueDataAttributesResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.CreatedAt.Nanosecond() == 0 { + toSerialize["created_at"] = o.CreatedAt.Format("2006-01-02T15:04:05Z07:00") + } else { + toSerialize["created_at"] = o.CreatedAt.Format("2006-01-02T15:04:05.000Z07:00") + } + toSerialize["created_by"] = o.CreatedBy + toSerialize["description"] = o.Description + if o.ModifiedAt.Nanosecond() == 0 { + toSerialize["modified_at"] = o.ModifiedAt.Format("2006-01-02T15:04:05Z07:00") + } else { + toSerialize["modified_at"] = o.ModifiedAt.Format("2006-01-02T15:04:05.000Z07:00") + } + toSerialize["modified_by"] = o.ModifiedBy + toSerialize["name"] = o.Name + toSerialize["owned_by"] = o.OwnedBy + toSerialize["project_id"] = o.ProjectId + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsAnnotationQueueDataAttributesResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + CreatedAt *time.Time `json:"created_at"` + CreatedBy *string `json:"created_by"` + Description *string `json:"description"` + ModifiedAt *time.Time `json:"modified_at"` + ModifiedBy *string `json:"modified_by"` + Name *string `json:"name"` + OwnedBy *string `json:"owned_by"` + ProjectId *string `json:"project_id"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.CreatedAt == nil { + return fmt.Errorf("required field created_at missing") + } + if all.CreatedBy == nil { + return fmt.Errorf("required field created_by missing") + } + if all.Description == nil { + return fmt.Errorf("required field description missing") + } + if all.ModifiedAt == nil { + return fmt.Errorf("required field modified_at missing") + } + if all.ModifiedBy == nil { + return fmt.Errorf("required field modified_by missing") + } + if all.Name == nil { + return fmt.Errorf("required field name missing") + } + if all.OwnedBy == nil { + return fmt.Errorf("required field owned_by missing") + } + if all.ProjectId == nil { + return fmt.Errorf("required field project_id missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"created_at", "created_by", "description", "modified_at", "modified_by", "name", "owned_by", "project_id"}) + } else { + return err + } + o.CreatedAt = *all.CreatedAt + o.CreatedBy = *all.CreatedBy + o.Description = *all.Description + o.ModifiedAt = *all.ModifiedAt + o.ModifiedBy = *all.ModifiedBy + o.Name = *all.Name + o.OwnedBy = *all.OwnedBy + o.ProjectId = *all.ProjectId + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_annotation_queue_data_request.go b/api/datadogV2/model_llm_obs_annotation_queue_data_request.go new file mode 100644 index 00000000000..d5daa273a3c --- /dev/null +++ b/api/datadogV2/model_llm_obs_annotation_queue_data_request.go @@ -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 datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsAnnotationQueueDataRequest Data object for creating an LLM Observability annotation queue. +type LLMObsAnnotationQueueDataRequest struct { + // Attributes for creating an LLM Observability annotation queue. + Attributes LLMObsAnnotationQueueDataAttributesRequest `json:"attributes"` + // Resource type of an LLM Observability annotation queue. + Type LLMObsAnnotationQueueType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsAnnotationQueueDataRequest instantiates a new LLMObsAnnotationQueueDataRequest object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsAnnotationQueueDataRequest(attributes LLMObsAnnotationQueueDataAttributesRequest, typeVar LLMObsAnnotationQueueType) *LLMObsAnnotationQueueDataRequest { + this := LLMObsAnnotationQueueDataRequest{} + this.Attributes = attributes + this.Type = typeVar + return &this +} + +// NewLLMObsAnnotationQueueDataRequestWithDefaults instantiates a new LLMObsAnnotationQueueDataRequest object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsAnnotationQueueDataRequestWithDefaults() *LLMObsAnnotationQueueDataRequest { + this := LLMObsAnnotationQueueDataRequest{} + return &this +} + +// GetAttributes returns the Attributes field value. +func (o *LLMObsAnnotationQueueDataRequest) GetAttributes() LLMObsAnnotationQueueDataAttributesRequest { + if o == nil { + var ret LLMObsAnnotationQueueDataAttributesRequest + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value +// and a boolean to check if the value has been set. +func (o *LLMObsAnnotationQueueDataRequest) GetAttributesOk() (*LLMObsAnnotationQueueDataAttributesRequest, bool) { + if o == nil { + return nil, false + } + return &o.Attributes, true +} + +// SetAttributes sets field value. +func (o *LLMObsAnnotationQueueDataRequest) SetAttributes(v LLMObsAnnotationQueueDataAttributesRequest) { + o.Attributes = v +} + +// GetType returns the Type field value. +func (o *LLMObsAnnotationQueueDataRequest) GetType() LLMObsAnnotationQueueType { + if o == nil { + var ret LLMObsAnnotationQueueType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *LLMObsAnnotationQueueDataRequest) GetTypeOk() (*LLMObsAnnotationQueueType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *LLMObsAnnotationQueueDataRequest) SetType(v LLMObsAnnotationQueueType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsAnnotationQueueDataRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["attributes"] = o.Attributes + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsAnnotationQueueDataRequest) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *LLMObsAnnotationQueueDataAttributesRequest `json:"attributes"` + Type *LLMObsAnnotationQueueType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Attributes == nil { + return fmt.Errorf("required field attributes missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = *all.Attributes + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_annotation_queue_data_response.go b/api/datadogV2/model_llm_obs_annotation_queue_data_response.go new file mode 100644 index 00000000000..617264cbd30 --- /dev/null +++ b/api/datadogV2/model_llm_obs_annotation_queue_data_response.go @@ -0,0 +1,178 @@ +// 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 datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsAnnotationQueueDataResponse Data object for an LLM Observability annotation queue. +type LLMObsAnnotationQueueDataResponse struct { + // Attributes of an LLM Observability annotation queue. + Attributes LLMObsAnnotationQueueDataAttributesResponse `json:"attributes"` + // Unique identifier of the annotation queue. + Id string `json:"id"` + // Resource type of an LLM Observability annotation queue. + Type LLMObsAnnotationQueueType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsAnnotationQueueDataResponse instantiates a new LLMObsAnnotationQueueDataResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsAnnotationQueueDataResponse(attributes LLMObsAnnotationQueueDataAttributesResponse, id string, typeVar LLMObsAnnotationQueueType) *LLMObsAnnotationQueueDataResponse { + this := LLMObsAnnotationQueueDataResponse{} + this.Attributes = attributes + this.Id = id + this.Type = typeVar + return &this +} + +// NewLLMObsAnnotationQueueDataResponseWithDefaults instantiates a new LLMObsAnnotationQueueDataResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsAnnotationQueueDataResponseWithDefaults() *LLMObsAnnotationQueueDataResponse { + this := LLMObsAnnotationQueueDataResponse{} + return &this +} + +// GetAttributes returns the Attributes field value. +func (o *LLMObsAnnotationQueueDataResponse) GetAttributes() LLMObsAnnotationQueueDataAttributesResponse { + if o == nil { + var ret LLMObsAnnotationQueueDataAttributesResponse + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value +// and a boolean to check if the value has been set. +func (o *LLMObsAnnotationQueueDataResponse) GetAttributesOk() (*LLMObsAnnotationQueueDataAttributesResponse, bool) { + if o == nil { + return nil, false + } + return &o.Attributes, true +} + +// SetAttributes sets field value. +func (o *LLMObsAnnotationQueueDataResponse) SetAttributes(v LLMObsAnnotationQueueDataAttributesResponse) { + o.Attributes = v +} + +// GetId returns the Id field value. +func (o *LLMObsAnnotationQueueDataResponse) GetId() string { + if o == nil { + var ret string + return ret + } + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *LLMObsAnnotationQueueDataResponse) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value. +func (o *LLMObsAnnotationQueueDataResponse) SetId(v string) { + o.Id = v +} + +// GetType returns the Type field value. +func (o *LLMObsAnnotationQueueDataResponse) GetType() LLMObsAnnotationQueueType { + if o == nil { + var ret LLMObsAnnotationQueueType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *LLMObsAnnotationQueueDataResponse) GetTypeOk() (*LLMObsAnnotationQueueType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *LLMObsAnnotationQueueDataResponse) SetType(v LLMObsAnnotationQueueType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsAnnotationQueueDataResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["attributes"] = o.Attributes + toSerialize["id"] = o.Id + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsAnnotationQueueDataResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *LLMObsAnnotationQueueDataAttributesResponse `json:"attributes"` + Id *string `json:"id"` + Type *LLMObsAnnotationQueueType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Attributes == nil { + return fmt.Errorf("required field attributes missing") + } + if all.Id == nil { + return fmt.Errorf("required field id missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "id", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = *all.Attributes + o.Id = *all.Id + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_annotation_queue_interaction_item.go b/api/datadogV2/model_llm_obs_annotation_queue_interaction_item.go new file mode 100644 index 00000000000..8c767c23004 --- /dev/null +++ b/api/datadogV2/model_llm_obs_annotation_queue_interaction_item.go @@ -0,0 +1,143 @@ +// 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 datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsAnnotationQueueInteractionItem A single interaction to add to an annotation queue. +type LLMObsAnnotationQueueInteractionItem struct { + // Identifier of the content (such as trace ID) for this interaction. + ContentId string `json:"content_id"` + // Type of interaction in an annotation queue. + Type LLMObsInteractionType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsAnnotationQueueInteractionItem instantiates a new LLMObsAnnotationQueueInteractionItem object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsAnnotationQueueInteractionItem(contentId string, typeVar LLMObsInteractionType) *LLMObsAnnotationQueueInteractionItem { + this := LLMObsAnnotationQueueInteractionItem{} + this.ContentId = contentId + this.Type = typeVar + return &this +} + +// NewLLMObsAnnotationQueueInteractionItemWithDefaults instantiates a new LLMObsAnnotationQueueInteractionItem object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsAnnotationQueueInteractionItemWithDefaults() *LLMObsAnnotationQueueInteractionItem { + this := LLMObsAnnotationQueueInteractionItem{} + return &this +} + +// GetContentId returns the ContentId field value. +func (o *LLMObsAnnotationQueueInteractionItem) GetContentId() string { + if o == nil { + var ret string + return ret + } + return o.ContentId +} + +// GetContentIdOk returns a tuple with the ContentId field value +// and a boolean to check if the value has been set. +func (o *LLMObsAnnotationQueueInteractionItem) GetContentIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ContentId, true +} + +// SetContentId sets field value. +func (o *LLMObsAnnotationQueueInteractionItem) SetContentId(v string) { + o.ContentId = v +} + +// GetType returns the Type field value. +func (o *LLMObsAnnotationQueueInteractionItem) GetType() LLMObsInteractionType { + if o == nil { + var ret LLMObsInteractionType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *LLMObsAnnotationQueueInteractionItem) GetTypeOk() (*LLMObsInteractionType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *LLMObsAnnotationQueueInteractionItem) SetType(v LLMObsInteractionType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsAnnotationQueueInteractionItem) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["content_id"] = o.ContentId + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsAnnotationQueueInteractionItem) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + ContentId *string `json:"content_id"` + Type *LLMObsInteractionType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.ContentId == nil { + return fmt.Errorf("required field content_id missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"content_id", "type"}) + } else { + return err + } + + hasInvalidField := false + o.ContentId = *all.ContentId + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_annotation_queue_interaction_response_item.go b/api/datadogV2/model_llm_obs_annotation_queue_interaction_response_item.go new file mode 100644 index 00000000000..5b6787f4bb3 --- /dev/null +++ b/api/datadogV2/model_llm_obs_annotation_queue_interaction_response_item.go @@ -0,0 +1,207 @@ +// 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 datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsAnnotationQueueInteractionResponseItem A single interaction result. +type LLMObsAnnotationQueueInteractionResponseItem struct { + // Whether this interaction already existed in the queue. + AlreadyExisted bool `json:"already_existed"` + // Identifier of the content for this interaction. + ContentId string `json:"content_id"` + // Unique identifier of the interaction. + Id string `json:"id"` + // Type of interaction in an annotation queue. + Type LLMObsInteractionType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsAnnotationQueueInteractionResponseItem instantiates a new LLMObsAnnotationQueueInteractionResponseItem object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsAnnotationQueueInteractionResponseItem(alreadyExisted bool, contentId string, id string, typeVar LLMObsInteractionType) *LLMObsAnnotationQueueInteractionResponseItem { + this := LLMObsAnnotationQueueInteractionResponseItem{} + this.AlreadyExisted = alreadyExisted + this.ContentId = contentId + this.Id = id + this.Type = typeVar + return &this +} + +// NewLLMObsAnnotationQueueInteractionResponseItemWithDefaults instantiates a new LLMObsAnnotationQueueInteractionResponseItem object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsAnnotationQueueInteractionResponseItemWithDefaults() *LLMObsAnnotationQueueInteractionResponseItem { + this := LLMObsAnnotationQueueInteractionResponseItem{} + return &this +} + +// GetAlreadyExisted returns the AlreadyExisted field value. +func (o *LLMObsAnnotationQueueInteractionResponseItem) GetAlreadyExisted() bool { + if o == nil { + var ret bool + return ret + } + return o.AlreadyExisted +} + +// GetAlreadyExistedOk returns a tuple with the AlreadyExisted field value +// and a boolean to check if the value has been set. +func (o *LLMObsAnnotationQueueInteractionResponseItem) GetAlreadyExistedOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.AlreadyExisted, true +} + +// SetAlreadyExisted sets field value. +func (o *LLMObsAnnotationQueueInteractionResponseItem) SetAlreadyExisted(v bool) { + o.AlreadyExisted = v +} + +// GetContentId returns the ContentId field value. +func (o *LLMObsAnnotationQueueInteractionResponseItem) GetContentId() string { + if o == nil { + var ret string + return ret + } + return o.ContentId +} + +// GetContentIdOk returns a tuple with the ContentId field value +// and a boolean to check if the value has been set. +func (o *LLMObsAnnotationQueueInteractionResponseItem) GetContentIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ContentId, true +} + +// SetContentId sets field value. +func (o *LLMObsAnnotationQueueInteractionResponseItem) SetContentId(v string) { + o.ContentId = v +} + +// GetId returns the Id field value. +func (o *LLMObsAnnotationQueueInteractionResponseItem) GetId() string { + if o == nil { + var ret string + return ret + } + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *LLMObsAnnotationQueueInteractionResponseItem) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value. +func (o *LLMObsAnnotationQueueInteractionResponseItem) SetId(v string) { + o.Id = v +} + +// GetType returns the Type field value. +func (o *LLMObsAnnotationQueueInteractionResponseItem) GetType() LLMObsInteractionType { + if o == nil { + var ret LLMObsInteractionType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *LLMObsAnnotationQueueInteractionResponseItem) GetTypeOk() (*LLMObsInteractionType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *LLMObsAnnotationQueueInteractionResponseItem) SetType(v LLMObsInteractionType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsAnnotationQueueInteractionResponseItem) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["already_existed"] = o.AlreadyExisted + toSerialize["content_id"] = o.ContentId + toSerialize["id"] = o.Id + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsAnnotationQueueInteractionResponseItem) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + AlreadyExisted *bool `json:"already_existed"` + ContentId *string `json:"content_id"` + Id *string `json:"id"` + Type *LLMObsInteractionType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.AlreadyExisted == nil { + return fmt.Errorf("required field already_existed missing") + } + if all.ContentId == nil { + return fmt.Errorf("required field content_id missing") + } + if all.Id == nil { + return fmt.Errorf("required field id missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"already_existed", "content_id", "id", "type"}) + } else { + return err + } + + hasInvalidField := false + o.AlreadyExisted = *all.AlreadyExisted + o.ContentId = *all.ContentId + o.Id = *all.Id + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_annotation_queue_interactions_data_attributes_request.go b/api/datadogV2/model_llm_obs_annotation_queue_interactions_data_attributes_request.go new file mode 100644 index 00000000000..071bd587e1d --- /dev/null +++ b/api/datadogV2/model_llm_obs_annotation_queue_interactions_data_attributes_request.go @@ -0,0 +1,101 @@ +// 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 datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsAnnotationQueueInteractionsDataAttributesRequest Attributes for adding interactions to an annotation queue. +type LLMObsAnnotationQueueInteractionsDataAttributesRequest struct { + // List of interactions to add to the queue. Must contain at least one item. + Interactions []LLMObsAnnotationQueueInteractionItem `json:"interactions"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsAnnotationQueueInteractionsDataAttributesRequest instantiates a new LLMObsAnnotationQueueInteractionsDataAttributesRequest object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsAnnotationQueueInteractionsDataAttributesRequest(interactions []LLMObsAnnotationQueueInteractionItem) *LLMObsAnnotationQueueInteractionsDataAttributesRequest { + this := LLMObsAnnotationQueueInteractionsDataAttributesRequest{} + this.Interactions = interactions + return &this +} + +// NewLLMObsAnnotationQueueInteractionsDataAttributesRequestWithDefaults instantiates a new LLMObsAnnotationQueueInteractionsDataAttributesRequest object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsAnnotationQueueInteractionsDataAttributesRequestWithDefaults() *LLMObsAnnotationQueueInteractionsDataAttributesRequest { + this := LLMObsAnnotationQueueInteractionsDataAttributesRequest{} + return &this +} + +// GetInteractions returns the Interactions field value. +func (o *LLMObsAnnotationQueueInteractionsDataAttributesRequest) GetInteractions() []LLMObsAnnotationQueueInteractionItem { + if o == nil { + var ret []LLMObsAnnotationQueueInteractionItem + return ret + } + return o.Interactions +} + +// GetInteractionsOk returns a tuple with the Interactions field value +// and a boolean to check if the value has been set. +func (o *LLMObsAnnotationQueueInteractionsDataAttributesRequest) GetInteractionsOk() (*[]LLMObsAnnotationQueueInteractionItem, bool) { + if o == nil { + return nil, false + } + return &o.Interactions, true +} + +// SetInteractions sets field value. +func (o *LLMObsAnnotationQueueInteractionsDataAttributesRequest) SetInteractions(v []LLMObsAnnotationQueueInteractionItem) { + o.Interactions = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsAnnotationQueueInteractionsDataAttributesRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["interactions"] = o.Interactions + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsAnnotationQueueInteractionsDataAttributesRequest) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Interactions *[]LLMObsAnnotationQueueInteractionItem `json:"interactions"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Interactions == nil { + return fmt.Errorf("required field interactions missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"interactions"}) + } else { + return err + } + o.Interactions = *all.Interactions + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_annotation_queue_interactions_data_attributes_response.go b/api/datadogV2/model_llm_obs_annotation_queue_interactions_data_attributes_response.go new file mode 100644 index 00000000000..9a74420551e --- /dev/null +++ b/api/datadogV2/model_llm_obs_annotation_queue_interactions_data_attributes_response.go @@ -0,0 +1,101 @@ +// 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 datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsAnnotationQueueInteractionsDataAttributesResponse Attributes of the interaction addition response. +type LLMObsAnnotationQueueInteractionsDataAttributesResponse struct { + // List of interactions that were processed. + Interactions []LLMObsAnnotationQueueInteractionResponseItem `json:"interactions"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsAnnotationQueueInteractionsDataAttributesResponse instantiates a new LLMObsAnnotationQueueInteractionsDataAttributesResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsAnnotationQueueInteractionsDataAttributesResponse(interactions []LLMObsAnnotationQueueInteractionResponseItem) *LLMObsAnnotationQueueInteractionsDataAttributesResponse { + this := LLMObsAnnotationQueueInteractionsDataAttributesResponse{} + this.Interactions = interactions + return &this +} + +// NewLLMObsAnnotationQueueInteractionsDataAttributesResponseWithDefaults instantiates a new LLMObsAnnotationQueueInteractionsDataAttributesResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsAnnotationQueueInteractionsDataAttributesResponseWithDefaults() *LLMObsAnnotationQueueInteractionsDataAttributesResponse { + this := LLMObsAnnotationQueueInteractionsDataAttributesResponse{} + return &this +} + +// GetInteractions returns the Interactions field value. +func (o *LLMObsAnnotationQueueInteractionsDataAttributesResponse) GetInteractions() []LLMObsAnnotationQueueInteractionResponseItem { + if o == nil { + var ret []LLMObsAnnotationQueueInteractionResponseItem + return ret + } + return o.Interactions +} + +// GetInteractionsOk returns a tuple with the Interactions field value +// and a boolean to check if the value has been set. +func (o *LLMObsAnnotationQueueInteractionsDataAttributesResponse) GetInteractionsOk() (*[]LLMObsAnnotationQueueInteractionResponseItem, bool) { + if o == nil { + return nil, false + } + return &o.Interactions, true +} + +// SetInteractions sets field value. +func (o *LLMObsAnnotationQueueInteractionsDataAttributesResponse) SetInteractions(v []LLMObsAnnotationQueueInteractionResponseItem) { + o.Interactions = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsAnnotationQueueInteractionsDataAttributesResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["interactions"] = o.Interactions + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsAnnotationQueueInteractionsDataAttributesResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Interactions *[]LLMObsAnnotationQueueInteractionResponseItem `json:"interactions"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Interactions == nil { + return fmt.Errorf("required field interactions missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"interactions"}) + } else { + return err + } + o.Interactions = *all.Interactions + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_annotation_queue_interactions_data_request.go b/api/datadogV2/model_llm_obs_annotation_queue_interactions_data_request.go new file mode 100644 index 00000000000..ac2006a6551 --- /dev/null +++ b/api/datadogV2/model_llm_obs_annotation_queue_interactions_data_request.go @@ -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 datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsAnnotationQueueInteractionsDataRequest Data object for adding interactions to an annotation queue. +type LLMObsAnnotationQueueInteractionsDataRequest struct { + // Attributes for adding interactions to an annotation queue. + Attributes LLMObsAnnotationQueueInteractionsDataAttributesRequest `json:"attributes"` + // Resource type for annotation queue interactions. + Type LLMObsAnnotationQueueInteractionsType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsAnnotationQueueInteractionsDataRequest instantiates a new LLMObsAnnotationQueueInteractionsDataRequest object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsAnnotationQueueInteractionsDataRequest(attributes LLMObsAnnotationQueueInteractionsDataAttributesRequest, typeVar LLMObsAnnotationQueueInteractionsType) *LLMObsAnnotationQueueInteractionsDataRequest { + this := LLMObsAnnotationQueueInteractionsDataRequest{} + this.Attributes = attributes + this.Type = typeVar + return &this +} + +// NewLLMObsAnnotationQueueInteractionsDataRequestWithDefaults instantiates a new LLMObsAnnotationQueueInteractionsDataRequest object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsAnnotationQueueInteractionsDataRequestWithDefaults() *LLMObsAnnotationQueueInteractionsDataRequest { + this := LLMObsAnnotationQueueInteractionsDataRequest{} + return &this +} + +// GetAttributes returns the Attributes field value. +func (o *LLMObsAnnotationQueueInteractionsDataRequest) GetAttributes() LLMObsAnnotationQueueInteractionsDataAttributesRequest { + if o == nil { + var ret LLMObsAnnotationQueueInteractionsDataAttributesRequest + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value +// and a boolean to check if the value has been set. +func (o *LLMObsAnnotationQueueInteractionsDataRequest) GetAttributesOk() (*LLMObsAnnotationQueueInteractionsDataAttributesRequest, bool) { + if o == nil { + return nil, false + } + return &o.Attributes, true +} + +// SetAttributes sets field value. +func (o *LLMObsAnnotationQueueInteractionsDataRequest) SetAttributes(v LLMObsAnnotationQueueInteractionsDataAttributesRequest) { + o.Attributes = v +} + +// GetType returns the Type field value. +func (o *LLMObsAnnotationQueueInteractionsDataRequest) GetType() LLMObsAnnotationQueueInteractionsType { + if o == nil { + var ret LLMObsAnnotationQueueInteractionsType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *LLMObsAnnotationQueueInteractionsDataRequest) GetTypeOk() (*LLMObsAnnotationQueueInteractionsType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *LLMObsAnnotationQueueInteractionsDataRequest) SetType(v LLMObsAnnotationQueueInteractionsType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsAnnotationQueueInteractionsDataRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["attributes"] = o.Attributes + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsAnnotationQueueInteractionsDataRequest) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *LLMObsAnnotationQueueInteractionsDataAttributesRequest `json:"attributes"` + Type *LLMObsAnnotationQueueInteractionsType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Attributes == nil { + return fmt.Errorf("required field attributes missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = *all.Attributes + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_annotation_queue_interactions_data_response.go b/api/datadogV2/model_llm_obs_annotation_queue_interactions_data_response.go new file mode 100644 index 00000000000..dea33a57d74 --- /dev/null +++ b/api/datadogV2/model_llm_obs_annotation_queue_interactions_data_response.go @@ -0,0 +1,178 @@ +// 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 datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsAnnotationQueueInteractionsDataResponse Data object for the interaction addition response. +type LLMObsAnnotationQueueInteractionsDataResponse struct { + // Attributes of the interaction addition response. + Attributes LLMObsAnnotationQueueInteractionsDataAttributesResponse `json:"attributes"` + // The queue ID the interactions were added to. + Id string `json:"id"` + // Resource type for annotation queue interactions. + Type LLMObsAnnotationQueueInteractionsType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsAnnotationQueueInteractionsDataResponse instantiates a new LLMObsAnnotationQueueInteractionsDataResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsAnnotationQueueInteractionsDataResponse(attributes LLMObsAnnotationQueueInteractionsDataAttributesResponse, id string, typeVar LLMObsAnnotationQueueInteractionsType) *LLMObsAnnotationQueueInteractionsDataResponse { + this := LLMObsAnnotationQueueInteractionsDataResponse{} + this.Attributes = attributes + this.Id = id + this.Type = typeVar + return &this +} + +// NewLLMObsAnnotationQueueInteractionsDataResponseWithDefaults instantiates a new LLMObsAnnotationQueueInteractionsDataResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsAnnotationQueueInteractionsDataResponseWithDefaults() *LLMObsAnnotationQueueInteractionsDataResponse { + this := LLMObsAnnotationQueueInteractionsDataResponse{} + return &this +} + +// GetAttributes returns the Attributes field value. +func (o *LLMObsAnnotationQueueInteractionsDataResponse) GetAttributes() LLMObsAnnotationQueueInteractionsDataAttributesResponse { + if o == nil { + var ret LLMObsAnnotationQueueInteractionsDataAttributesResponse + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value +// and a boolean to check if the value has been set. +func (o *LLMObsAnnotationQueueInteractionsDataResponse) GetAttributesOk() (*LLMObsAnnotationQueueInteractionsDataAttributesResponse, bool) { + if o == nil { + return nil, false + } + return &o.Attributes, true +} + +// SetAttributes sets field value. +func (o *LLMObsAnnotationQueueInteractionsDataResponse) SetAttributes(v LLMObsAnnotationQueueInteractionsDataAttributesResponse) { + o.Attributes = v +} + +// GetId returns the Id field value. +func (o *LLMObsAnnotationQueueInteractionsDataResponse) GetId() string { + if o == nil { + var ret string + return ret + } + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *LLMObsAnnotationQueueInteractionsDataResponse) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value. +func (o *LLMObsAnnotationQueueInteractionsDataResponse) SetId(v string) { + o.Id = v +} + +// GetType returns the Type field value. +func (o *LLMObsAnnotationQueueInteractionsDataResponse) GetType() LLMObsAnnotationQueueInteractionsType { + if o == nil { + var ret LLMObsAnnotationQueueInteractionsType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *LLMObsAnnotationQueueInteractionsDataResponse) GetTypeOk() (*LLMObsAnnotationQueueInteractionsType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *LLMObsAnnotationQueueInteractionsDataResponse) SetType(v LLMObsAnnotationQueueInteractionsType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsAnnotationQueueInteractionsDataResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["attributes"] = o.Attributes + toSerialize["id"] = o.Id + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsAnnotationQueueInteractionsDataResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *LLMObsAnnotationQueueInteractionsDataAttributesResponse `json:"attributes"` + Id *string `json:"id"` + Type *LLMObsAnnotationQueueInteractionsType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Attributes == nil { + return fmt.Errorf("required field attributes missing") + } + if all.Id == nil { + return fmt.Errorf("required field id missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "id", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = *all.Attributes + o.Id = *all.Id + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_annotation_queue_interactions_request.go b/api/datadogV2/model_llm_obs_annotation_queue_interactions_request.go new file mode 100644 index 00000000000..4863999db4d --- /dev/null +++ b/api/datadogV2/model_llm_obs_annotation_queue_interactions_request.go @@ -0,0 +1,110 @@ +// 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 datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsAnnotationQueueInteractionsRequest Request to add interactions to an LLM Observability annotation queue. +type LLMObsAnnotationQueueInteractionsRequest struct { + // Data object for adding interactions to an annotation queue. + Data LLMObsAnnotationQueueInteractionsDataRequest `json:"data"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsAnnotationQueueInteractionsRequest instantiates a new LLMObsAnnotationQueueInteractionsRequest object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsAnnotationQueueInteractionsRequest(data LLMObsAnnotationQueueInteractionsDataRequest) *LLMObsAnnotationQueueInteractionsRequest { + this := LLMObsAnnotationQueueInteractionsRequest{} + this.Data = data + return &this +} + +// NewLLMObsAnnotationQueueInteractionsRequestWithDefaults instantiates a new LLMObsAnnotationQueueInteractionsRequest object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsAnnotationQueueInteractionsRequestWithDefaults() *LLMObsAnnotationQueueInteractionsRequest { + this := LLMObsAnnotationQueueInteractionsRequest{} + return &this +} + +// GetData returns the Data field value. +func (o *LLMObsAnnotationQueueInteractionsRequest) GetData() LLMObsAnnotationQueueInteractionsDataRequest { + if o == nil { + var ret LLMObsAnnotationQueueInteractionsDataRequest + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *LLMObsAnnotationQueueInteractionsRequest) GetDataOk() (*LLMObsAnnotationQueueInteractionsDataRequest, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value. +func (o *LLMObsAnnotationQueueInteractionsRequest) SetData(v LLMObsAnnotationQueueInteractionsDataRequest) { + o.Data = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsAnnotationQueueInteractionsRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["data"] = o.Data + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsAnnotationQueueInteractionsRequest) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *LLMObsAnnotationQueueInteractionsDataRequest `json:"data"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Data == nil { + return fmt.Errorf("required field data missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + + hasInvalidField := false + if all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = *all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_annotation_queue_interactions_response.go b/api/datadogV2/model_llm_obs_annotation_queue_interactions_response.go new file mode 100644 index 00000000000..f9b0ce57c01 --- /dev/null +++ b/api/datadogV2/model_llm_obs_annotation_queue_interactions_response.go @@ -0,0 +1,110 @@ +// 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 datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsAnnotationQueueInteractionsResponse Response containing the result of adding interactions to an annotation queue. +type LLMObsAnnotationQueueInteractionsResponse struct { + // Data object for the interaction addition response. + Data LLMObsAnnotationQueueInteractionsDataResponse `json:"data"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsAnnotationQueueInteractionsResponse instantiates a new LLMObsAnnotationQueueInteractionsResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsAnnotationQueueInteractionsResponse(data LLMObsAnnotationQueueInteractionsDataResponse) *LLMObsAnnotationQueueInteractionsResponse { + this := LLMObsAnnotationQueueInteractionsResponse{} + this.Data = data + return &this +} + +// NewLLMObsAnnotationQueueInteractionsResponseWithDefaults instantiates a new LLMObsAnnotationQueueInteractionsResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsAnnotationQueueInteractionsResponseWithDefaults() *LLMObsAnnotationQueueInteractionsResponse { + this := LLMObsAnnotationQueueInteractionsResponse{} + return &this +} + +// GetData returns the Data field value. +func (o *LLMObsAnnotationQueueInteractionsResponse) GetData() LLMObsAnnotationQueueInteractionsDataResponse { + if o == nil { + var ret LLMObsAnnotationQueueInteractionsDataResponse + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *LLMObsAnnotationQueueInteractionsResponse) GetDataOk() (*LLMObsAnnotationQueueInteractionsDataResponse, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value. +func (o *LLMObsAnnotationQueueInteractionsResponse) SetData(v LLMObsAnnotationQueueInteractionsDataResponse) { + o.Data = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsAnnotationQueueInteractionsResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["data"] = o.Data + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsAnnotationQueueInteractionsResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *LLMObsAnnotationQueueInteractionsDataResponse `json:"data"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Data == nil { + return fmt.Errorf("required field data missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + + hasInvalidField := false + if all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = *all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_annotation_queue_interactions_type.go b/api/datadogV2/model_llm_obs_annotation_queue_interactions_type.go new file mode 100644 index 00000000000..4b3e378561d --- /dev/null +++ b/api/datadogV2/model_llm_obs_annotation_queue_interactions_type.go @@ -0,0 +1,64 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsAnnotationQueueInteractionsType Resource type for annotation queue interactions. +type LLMObsAnnotationQueueInteractionsType string + +// List of LLMObsAnnotationQueueInteractionsType. +const ( + LLMOBSANNOTATIONQUEUEINTERACTIONSTYPE_INTERACTIONS LLMObsAnnotationQueueInteractionsType = "interactions" +) + +var allowedLLMObsAnnotationQueueInteractionsTypeEnumValues = []LLMObsAnnotationQueueInteractionsType{ + LLMOBSANNOTATIONQUEUEINTERACTIONSTYPE_INTERACTIONS, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *LLMObsAnnotationQueueInteractionsType) GetAllowedValues() []LLMObsAnnotationQueueInteractionsType { + return allowedLLMObsAnnotationQueueInteractionsTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *LLMObsAnnotationQueueInteractionsType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = LLMObsAnnotationQueueInteractionsType(value) + return nil +} + +// NewLLMObsAnnotationQueueInteractionsTypeFromValue returns a pointer to a valid LLMObsAnnotationQueueInteractionsType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewLLMObsAnnotationQueueInteractionsTypeFromValue(v string) (*LLMObsAnnotationQueueInteractionsType, error) { + ev := LLMObsAnnotationQueueInteractionsType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for LLMObsAnnotationQueueInteractionsType: valid values are %v", v, allowedLLMObsAnnotationQueueInteractionsTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v LLMObsAnnotationQueueInteractionsType) IsValid() bool { + for _, existing := range allowedLLMObsAnnotationQueueInteractionsTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to LLMObsAnnotationQueueInteractionsType value. +func (v LLMObsAnnotationQueueInteractionsType) Ptr() *LLMObsAnnotationQueueInteractionsType { + return &v +} diff --git a/api/datadogV2/model_llm_obs_annotation_queue_request.go b/api/datadogV2/model_llm_obs_annotation_queue_request.go new file mode 100644 index 00000000000..16d93a00800 --- /dev/null +++ b/api/datadogV2/model_llm_obs_annotation_queue_request.go @@ -0,0 +1,110 @@ +// 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 datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsAnnotationQueueRequest Request to create an LLM Observability annotation queue. +type LLMObsAnnotationQueueRequest struct { + // Data object for creating an LLM Observability annotation queue. + Data LLMObsAnnotationQueueDataRequest `json:"data"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsAnnotationQueueRequest instantiates a new LLMObsAnnotationQueueRequest object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsAnnotationQueueRequest(data LLMObsAnnotationQueueDataRequest) *LLMObsAnnotationQueueRequest { + this := LLMObsAnnotationQueueRequest{} + this.Data = data + return &this +} + +// NewLLMObsAnnotationQueueRequestWithDefaults instantiates a new LLMObsAnnotationQueueRequest object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsAnnotationQueueRequestWithDefaults() *LLMObsAnnotationQueueRequest { + this := LLMObsAnnotationQueueRequest{} + return &this +} + +// GetData returns the Data field value. +func (o *LLMObsAnnotationQueueRequest) GetData() LLMObsAnnotationQueueDataRequest { + if o == nil { + var ret LLMObsAnnotationQueueDataRequest + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *LLMObsAnnotationQueueRequest) GetDataOk() (*LLMObsAnnotationQueueDataRequest, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value. +func (o *LLMObsAnnotationQueueRequest) SetData(v LLMObsAnnotationQueueDataRequest) { + o.Data = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsAnnotationQueueRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["data"] = o.Data + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsAnnotationQueueRequest) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *LLMObsAnnotationQueueDataRequest `json:"data"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Data == nil { + return fmt.Errorf("required field data missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + + hasInvalidField := false + if all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = *all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_annotation_queue_response.go b/api/datadogV2/model_llm_obs_annotation_queue_response.go new file mode 100644 index 00000000000..a4f4111af30 --- /dev/null +++ b/api/datadogV2/model_llm_obs_annotation_queue_response.go @@ -0,0 +1,110 @@ +// 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 datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsAnnotationQueueResponse Response containing a single LLM Observability annotation queue. +type LLMObsAnnotationQueueResponse struct { + // Data object for an LLM Observability annotation queue. + Data LLMObsAnnotationQueueDataResponse `json:"data"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsAnnotationQueueResponse instantiates a new LLMObsAnnotationQueueResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsAnnotationQueueResponse(data LLMObsAnnotationQueueDataResponse) *LLMObsAnnotationQueueResponse { + this := LLMObsAnnotationQueueResponse{} + this.Data = data + return &this +} + +// NewLLMObsAnnotationQueueResponseWithDefaults instantiates a new LLMObsAnnotationQueueResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsAnnotationQueueResponseWithDefaults() *LLMObsAnnotationQueueResponse { + this := LLMObsAnnotationQueueResponse{} + return &this +} + +// GetData returns the Data field value. +func (o *LLMObsAnnotationQueueResponse) GetData() LLMObsAnnotationQueueDataResponse { + if o == nil { + var ret LLMObsAnnotationQueueDataResponse + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *LLMObsAnnotationQueueResponse) GetDataOk() (*LLMObsAnnotationQueueDataResponse, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value. +func (o *LLMObsAnnotationQueueResponse) SetData(v LLMObsAnnotationQueueDataResponse) { + o.Data = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsAnnotationQueueResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["data"] = o.Data + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsAnnotationQueueResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *LLMObsAnnotationQueueDataResponse `json:"data"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Data == nil { + return fmt.Errorf("required field data missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + + hasInvalidField := false + if all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = *all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_annotation_queue_type.go b/api/datadogV2/model_llm_obs_annotation_queue_type.go new file mode 100644 index 00000000000..81f81eeae44 --- /dev/null +++ b/api/datadogV2/model_llm_obs_annotation_queue_type.go @@ -0,0 +1,64 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsAnnotationQueueType Resource type of an LLM Observability annotation queue. +type LLMObsAnnotationQueueType string + +// List of LLMObsAnnotationQueueType. +const ( + LLMOBSANNOTATIONQUEUETYPE_QUEUES LLMObsAnnotationQueueType = "queues" +) + +var allowedLLMObsAnnotationQueueTypeEnumValues = []LLMObsAnnotationQueueType{ + LLMOBSANNOTATIONQUEUETYPE_QUEUES, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *LLMObsAnnotationQueueType) GetAllowedValues() []LLMObsAnnotationQueueType { + return allowedLLMObsAnnotationQueueTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *LLMObsAnnotationQueueType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = LLMObsAnnotationQueueType(value) + return nil +} + +// NewLLMObsAnnotationQueueTypeFromValue returns a pointer to a valid LLMObsAnnotationQueueType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewLLMObsAnnotationQueueTypeFromValue(v string) (*LLMObsAnnotationQueueType, error) { + ev := LLMObsAnnotationQueueType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for LLMObsAnnotationQueueType: valid values are %v", v, allowedLLMObsAnnotationQueueTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v LLMObsAnnotationQueueType) IsValid() bool { + for _, existing := range allowedLLMObsAnnotationQueueTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to LLMObsAnnotationQueueType value. +func (v LLMObsAnnotationQueueType) Ptr() *LLMObsAnnotationQueueType { + return &v +} diff --git a/api/datadogV2/model_llm_obs_annotation_queue_update_data_attributes_request.go b/api/datadogV2/model_llm_obs_annotation_queue_update_data_attributes_request.go new file mode 100644 index 00000000000..a1c6f15594d --- /dev/null +++ b/api/datadogV2/model_llm_obs_annotation_queue_update_data_attributes_request.go @@ -0,0 +1,137 @@ +// 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 datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsAnnotationQueueUpdateDataAttributesRequest Attributes for updating an LLM Observability annotation queue. All fields are optional. +type LLMObsAnnotationQueueUpdateDataAttributesRequest struct { + // Updated description of the annotation queue. + Description *string `json:"description,omitempty"` + // Updated name of the annotation queue. + Name *string `json:"name,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsAnnotationQueueUpdateDataAttributesRequest instantiates a new LLMObsAnnotationQueueUpdateDataAttributesRequest object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsAnnotationQueueUpdateDataAttributesRequest() *LLMObsAnnotationQueueUpdateDataAttributesRequest { + this := LLMObsAnnotationQueueUpdateDataAttributesRequest{} + return &this +} + +// NewLLMObsAnnotationQueueUpdateDataAttributesRequestWithDefaults instantiates a new LLMObsAnnotationQueueUpdateDataAttributesRequest object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsAnnotationQueueUpdateDataAttributesRequestWithDefaults() *LLMObsAnnotationQueueUpdateDataAttributesRequest { + this := LLMObsAnnotationQueueUpdateDataAttributesRequest{} + return &this +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *LLMObsAnnotationQueueUpdateDataAttributesRequest) GetDescription() string { + if o == nil || o.Description == nil { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsAnnotationQueueUpdateDataAttributesRequest) GetDescriptionOk() (*string, bool) { + if o == nil || o.Description == nil { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *LLMObsAnnotationQueueUpdateDataAttributesRequest) HasDescription() bool { + return o != nil && o.Description != nil +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *LLMObsAnnotationQueueUpdateDataAttributesRequest) SetDescription(v string) { + o.Description = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *LLMObsAnnotationQueueUpdateDataAttributesRequest) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LLMObsAnnotationQueueUpdateDataAttributesRequest) GetNameOk() (*string, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *LLMObsAnnotationQueueUpdateDataAttributesRequest) HasName() bool { + return o != nil && o.Name != nil +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *LLMObsAnnotationQueueUpdateDataAttributesRequest) SetName(v string) { + o.Name = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsAnnotationQueueUpdateDataAttributesRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Description != nil { + toSerialize["description"] = o.Description + } + if o.Name != nil { + toSerialize["name"] = o.Name + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsAnnotationQueueUpdateDataAttributesRequest) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Description *string `json:"description,omitempty"` + Name *string `json:"name,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"description", "name"}) + } else { + return err + } + o.Description = all.Description + o.Name = all.Name + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_annotation_queue_update_data_request.go b/api/datadogV2/model_llm_obs_annotation_queue_update_data_request.go new file mode 100644 index 00000000000..d26a7cfaf81 --- /dev/null +++ b/api/datadogV2/model_llm_obs_annotation_queue_update_data_request.go @@ -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 datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsAnnotationQueueUpdateDataRequest Data object for updating an LLM Observability annotation queue. +type LLMObsAnnotationQueueUpdateDataRequest struct { + // Attributes for updating an LLM Observability annotation queue. All fields are optional. + Attributes LLMObsAnnotationQueueUpdateDataAttributesRequest `json:"attributes"` + // Resource type of an LLM Observability annotation queue. + Type LLMObsAnnotationQueueType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsAnnotationQueueUpdateDataRequest instantiates a new LLMObsAnnotationQueueUpdateDataRequest object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsAnnotationQueueUpdateDataRequest(attributes LLMObsAnnotationQueueUpdateDataAttributesRequest, typeVar LLMObsAnnotationQueueType) *LLMObsAnnotationQueueUpdateDataRequest { + this := LLMObsAnnotationQueueUpdateDataRequest{} + this.Attributes = attributes + this.Type = typeVar + return &this +} + +// NewLLMObsAnnotationQueueUpdateDataRequestWithDefaults instantiates a new LLMObsAnnotationQueueUpdateDataRequest object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsAnnotationQueueUpdateDataRequestWithDefaults() *LLMObsAnnotationQueueUpdateDataRequest { + this := LLMObsAnnotationQueueUpdateDataRequest{} + return &this +} + +// GetAttributes returns the Attributes field value. +func (o *LLMObsAnnotationQueueUpdateDataRequest) GetAttributes() LLMObsAnnotationQueueUpdateDataAttributesRequest { + if o == nil { + var ret LLMObsAnnotationQueueUpdateDataAttributesRequest + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value +// and a boolean to check if the value has been set. +func (o *LLMObsAnnotationQueueUpdateDataRequest) GetAttributesOk() (*LLMObsAnnotationQueueUpdateDataAttributesRequest, bool) { + if o == nil { + return nil, false + } + return &o.Attributes, true +} + +// SetAttributes sets field value. +func (o *LLMObsAnnotationQueueUpdateDataRequest) SetAttributes(v LLMObsAnnotationQueueUpdateDataAttributesRequest) { + o.Attributes = v +} + +// GetType returns the Type field value. +func (o *LLMObsAnnotationQueueUpdateDataRequest) GetType() LLMObsAnnotationQueueType { + if o == nil { + var ret LLMObsAnnotationQueueType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *LLMObsAnnotationQueueUpdateDataRequest) GetTypeOk() (*LLMObsAnnotationQueueType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *LLMObsAnnotationQueueUpdateDataRequest) SetType(v LLMObsAnnotationQueueType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsAnnotationQueueUpdateDataRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["attributes"] = o.Attributes + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsAnnotationQueueUpdateDataRequest) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *LLMObsAnnotationQueueUpdateDataAttributesRequest `json:"attributes"` + Type *LLMObsAnnotationQueueType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Attributes == nil { + return fmt.Errorf("required field attributes missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = *all.Attributes + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_annotation_queue_update_request.go b/api/datadogV2/model_llm_obs_annotation_queue_update_request.go new file mode 100644 index 00000000000..dc993018453 --- /dev/null +++ b/api/datadogV2/model_llm_obs_annotation_queue_update_request.go @@ -0,0 +1,110 @@ +// 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 datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsAnnotationQueueUpdateRequest Request to update an LLM Observability annotation queue. +type LLMObsAnnotationQueueUpdateRequest struct { + // Data object for updating an LLM Observability annotation queue. + Data LLMObsAnnotationQueueUpdateDataRequest `json:"data"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsAnnotationQueueUpdateRequest instantiates a new LLMObsAnnotationQueueUpdateRequest object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsAnnotationQueueUpdateRequest(data LLMObsAnnotationQueueUpdateDataRequest) *LLMObsAnnotationQueueUpdateRequest { + this := LLMObsAnnotationQueueUpdateRequest{} + this.Data = data + return &this +} + +// NewLLMObsAnnotationQueueUpdateRequestWithDefaults instantiates a new LLMObsAnnotationQueueUpdateRequest object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsAnnotationQueueUpdateRequestWithDefaults() *LLMObsAnnotationQueueUpdateRequest { + this := LLMObsAnnotationQueueUpdateRequest{} + return &this +} + +// GetData returns the Data field value. +func (o *LLMObsAnnotationQueueUpdateRequest) GetData() LLMObsAnnotationQueueUpdateDataRequest { + if o == nil { + var ret LLMObsAnnotationQueueUpdateDataRequest + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *LLMObsAnnotationQueueUpdateRequest) GetDataOk() (*LLMObsAnnotationQueueUpdateDataRequest, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value. +func (o *LLMObsAnnotationQueueUpdateRequest) SetData(v LLMObsAnnotationQueueUpdateDataRequest) { + o.Data = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsAnnotationQueueUpdateRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["data"] = o.Data + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsAnnotationQueueUpdateRequest) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *LLMObsAnnotationQueueUpdateDataRequest `json:"data"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Data == nil { + return fmt.Errorf("required field data missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + + hasInvalidField := false + if all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = *all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_annotation_queues_response.go b/api/datadogV2/model_llm_obs_annotation_queues_response.go new file mode 100644 index 00000000000..1c40aeeae2e --- /dev/null +++ b/api/datadogV2/model_llm_obs_annotation_queues_response.go @@ -0,0 +1,101 @@ +// 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 datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsAnnotationQueuesResponse Response containing a list of LLM Observability annotation queues. +type LLMObsAnnotationQueuesResponse struct { + // List of annotation queues. + Data []LLMObsAnnotationQueueDataResponse `json:"data"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsAnnotationQueuesResponse instantiates a new LLMObsAnnotationQueuesResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsAnnotationQueuesResponse(data []LLMObsAnnotationQueueDataResponse) *LLMObsAnnotationQueuesResponse { + this := LLMObsAnnotationQueuesResponse{} + this.Data = data + return &this +} + +// NewLLMObsAnnotationQueuesResponseWithDefaults instantiates a new LLMObsAnnotationQueuesResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsAnnotationQueuesResponseWithDefaults() *LLMObsAnnotationQueuesResponse { + this := LLMObsAnnotationQueuesResponse{} + return &this +} + +// GetData returns the Data field value. +func (o *LLMObsAnnotationQueuesResponse) GetData() []LLMObsAnnotationQueueDataResponse { + if o == nil { + var ret []LLMObsAnnotationQueueDataResponse + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *LLMObsAnnotationQueuesResponse) GetDataOk() (*[]LLMObsAnnotationQueueDataResponse, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value. +func (o *LLMObsAnnotationQueuesResponse) SetData(v []LLMObsAnnotationQueueDataResponse) { + o.Data = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsAnnotationQueuesResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["data"] = o.Data + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsAnnotationQueuesResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *[]LLMObsAnnotationQueueDataResponse `json:"data"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Data == nil { + return fmt.Errorf("required field data missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + o.Data = *all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_delete_annotation_queue_interactions_data_attributes_request.go b/api/datadogV2/model_llm_obs_delete_annotation_queue_interactions_data_attributes_request.go new file mode 100644 index 00000000000..cdad6f165d0 --- /dev/null +++ b/api/datadogV2/model_llm_obs_delete_annotation_queue_interactions_data_attributes_request.go @@ -0,0 +1,101 @@ +// 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 datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsDeleteAnnotationQueueInteractionsDataAttributesRequest Attributes for deleting interactions from an annotation queue. +type LLMObsDeleteAnnotationQueueInteractionsDataAttributesRequest struct { + // List of interaction IDs to delete. Must contain at least one item. + InteractionIds []string `json:"interaction_ids"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsDeleteAnnotationQueueInteractionsDataAttributesRequest instantiates a new LLMObsDeleteAnnotationQueueInteractionsDataAttributesRequest object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsDeleteAnnotationQueueInteractionsDataAttributesRequest(interactionIds []string) *LLMObsDeleteAnnotationQueueInteractionsDataAttributesRequest { + this := LLMObsDeleteAnnotationQueueInteractionsDataAttributesRequest{} + this.InteractionIds = interactionIds + return &this +} + +// NewLLMObsDeleteAnnotationQueueInteractionsDataAttributesRequestWithDefaults instantiates a new LLMObsDeleteAnnotationQueueInteractionsDataAttributesRequest object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsDeleteAnnotationQueueInteractionsDataAttributesRequestWithDefaults() *LLMObsDeleteAnnotationQueueInteractionsDataAttributesRequest { + this := LLMObsDeleteAnnotationQueueInteractionsDataAttributesRequest{} + return &this +} + +// GetInteractionIds returns the InteractionIds field value. +func (o *LLMObsDeleteAnnotationQueueInteractionsDataAttributesRequest) GetInteractionIds() []string { + if o == nil { + var ret []string + return ret + } + return o.InteractionIds +} + +// GetInteractionIdsOk returns a tuple with the InteractionIds field value +// and a boolean to check if the value has been set. +func (o *LLMObsDeleteAnnotationQueueInteractionsDataAttributesRequest) GetInteractionIdsOk() (*[]string, bool) { + if o == nil { + return nil, false + } + return &o.InteractionIds, true +} + +// SetInteractionIds sets field value. +func (o *LLMObsDeleteAnnotationQueueInteractionsDataAttributesRequest) SetInteractionIds(v []string) { + o.InteractionIds = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsDeleteAnnotationQueueInteractionsDataAttributesRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["interaction_ids"] = o.InteractionIds + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsDeleteAnnotationQueueInteractionsDataAttributesRequest) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + InteractionIds *[]string `json:"interaction_ids"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.InteractionIds == nil { + return fmt.Errorf("required field interaction_ids missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"interaction_ids"}) + } else { + return err + } + o.InteractionIds = *all.InteractionIds + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_delete_annotation_queue_interactions_data_request.go b/api/datadogV2/model_llm_obs_delete_annotation_queue_interactions_data_request.go new file mode 100644 index 00000000000..f7a46af7818 --- /dev/null +++ b/api/datadogV2/model_llm_obs_delete_annotation_queue_interactions_data_request.go @@ -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 datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsDeleteAnnotationQueueInteractionsDataRequest Data object for deleting interactions from an annotation queue. +type LLMObsDeleteAnnotationQueueInteractionsDataRequest struct { + // Attributes for deleting interactions from an annotation queue. + Attributes LLMObsDeleteAnnotationQueueInteractionsDataAttributesRequest `json:"attributes"` + // Resource type for annotation queue interactions. + Type LLMObsAnnotationQueueInteractionsType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsDeleteAnnotationQueueInteractionsDataRequest instantiates a new LLMObsDeleteAnnotationQueueInteractionsDataRequest object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsDeleteAnnotationQueueInteractionsDataRequest(attributes LLMObsDeleteAnnotationQueueInteractionsDataAttributesRequest, typeVar LLMObsAnnotationQueueInteractionsType) *LLMObsDeleteAnnotationQueueInteractionsDataRequest { + this := LLMObsDeleteAnnotationQueueInteractionsDataRequest{} + this.Attributes = attributes + this.Type = typeVar + return &this +} + +// NewLLMObsDeleteAnnotationQueueInteractionsDataRequestWithDefaults instantiates a new LLMObsDeleteAnnotationQueueInteractionsDataRequest object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsDeleteAnnotationQueueInteractionsDataRequestWithDefaults() *LLMObsDeleteAnnotationQueueInteractionsDataRequest { + this := LLMObsDeleteAnnotationQueueInteractionsDataRequest{} + return &this +} + +// GetAttributes returns the Attributes field value. +func (o *LLMObsDeleteAnnotationQueueInteractionsDataRequest) GetAttributes() LLMObsDeleteAnnotationQueueInteractionsDataAttributesRequest { + if o == nil { + var ret LLMObsDeleteAnnotationQueueInteractionsDataAttributesRequest + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value +// and a boolean to check if the value has been set. +func (o *LLMObsDeleteAnnotationQueueInteractionsDataRequest) GetAttributesOk() (*LLMObsDeleteAnnotationQueueInteractionsDataAttributesRequest, bool) { + if o == nil { + return nil, false + } + return &o.Attributes, true +} + +// SetAttributes sets field value. +func (o *LLMObsDeleteAnnotationQueueInteractionsDataRequest) SetAttributes(v LLMObsDeleteAnnotationQueueInteractionsDataAttributesRequest) { + o.Attributes = v +} + +// GetType returns the Type field value. +func (o *LLMObsDeleteAnnotationQueueInteractionsDataRequest) GetType() LLMObsAnnotationQueueInteractionsType { + if o == nil { + var ret LLMObsAnnotationQueueInteractionsType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *LLMObsDeleteAnnotationQueueInteractionsDataRequest) GetTypeOk() (*LLMObsAnnotationQueueInteractionsType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *LLMObsDeleteAnnotationQueueInteractionsDataRequest) SetType(v LLMObsAnnotationQueueInteractionsType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsDeleteAnnotationQueueInteractionsDataRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["attributes"] = o.Attributes + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsDeleteAnnotationQueueInteractionsDataRequest) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *LLMObsDeleteAnnotationQueueInteractionsDataAttributesRequest `json:"attributes"` + Type *LLMObsAnnotationQueueInteractionsType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Attributes == nil { + return fmt.Errorf("required field attributes missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = *all.Attributes + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_delete_annotation_queue_interactions_request.go b/api/datadogV2/model_llm_obs_delete_annotation_queue_interactions_request.go new file mode 100644 index 00000000000..b79a7940090 --- /dev/null +++ b/api/datadogV2/model_llm_obs_delete_annotation_queue_interactions_request.go @@ -0,0 +1,110 @@ +// 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 datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsDeleteAnnotationQueueInteractionsRequest Request to delete interactions from an LLM Observability annotation queue. +type LLMObsDeleteAnnotationQueueInteractionsRequest struct { + // Data object for deleting interactions from an annotation queue. + Data LLMObsDeleteAnnotationQueueInteractionsDataRequest `json:"data"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewLLMObsDeleteAnnotationQueueInteractionsRequest instantiates a new LLMObsDeleteAnnotationQueueInteractionsRequest object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewLLMObsDeleteAnnotationQueueInteractionsRequest(data LLMObsDeleteAnnotationQueueInteractionsDataRequest) *LLMObsDeleteAnnotationQueueInteractionsRequest { + this := LLMObsDeleteAnnotationQueueInteractionsRequest{} + this.Data = data + return &this +} + +// NewLLMObsDeleteAnnotationQueueInteractionsRequestWithDefaults instantiates a new LLMObsDeleteAnnotationQueueInteractionsRequest object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewLLMObsDeleteAnnotationQueueInteractionsRequestWithDefaults() *LLMObsDeleteAnnotationQueueInteractionsRequest { + this := LLMObsDeleteAnnotationQueueInteractionsRequest{} + return &this +} + +// GetData returns the Data field value. +func (o *LLMObsDeleteAnnotationQueueInteractionsRequest) GetData() LLMObsDeleteAnnotationQueueInteractionsDataRequest { + if o == nil { + var ret LLMObsDeleteAnnotationQueueInteractionsDataRequest + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *LLMObsDeleteAnnotationQueueInteractionsRequest) GetDataOk() (*LLMObsDeleteAnnotationQueueInteractionsDataRequest, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value. +func (o *LLMObsDeleteAnnotationQueueInteractionsRequest) SetData(v LLMObsDeleteAnnotationQueueInteractionsDataRequest) { + o.Data = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o LLMObsDeleteAnnotationQueueInteractionsRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["data"] = o.Data + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *LLMObsDeleteAnnotationQueueInteractionsRequest) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *LLMObsDeleteAnnotationQueueInteractionsDataRequest `json:"data"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Data == nil { + return fmt.Errorf("required field data missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + + hasInvalidField := false + if all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = *all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_llm_obs_interaction_type.go b/api/datadogV2/model_llm_obs_interaction_type.go new file mode 100644 index 00000000000..7e38b4f8339 --- /dev/null +++ b/api/datadogV2/model_llm_obs_interaction_type.go @@ -0,0 +1,66 @@ +// 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 datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// LLMObsInteractionType Type of interaction in an annotation queue. +type LLMObsInteractionType string + +// List of LLMObsInteractionType. +const ( + LLMOBSINTERACTIONTYPE_TRACE LLMObsInteractionType = "trace" + LLMOBSINTERACTIONTYPE_EXPERIMENT_TRACE LLMObsInteractionType = "experiment_trace" +) + +var allowedLLMObsInteractionTypeEnumValues = []LLMObsInteractionType{ + LLMOBSINTERACTIONTYPE_TRACE, + LLMOBSINTERACTIONTYPE_EXPERIMENT_TRACE, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *LLMObsInteractionType) GetAllowedValues() []LLMObsInteractionType { + return allowedLLMObsInteractionTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *LLMObsInteractionType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = LLMObsInteractionType(value) + return nil +} + +// NewLLMObsInteractionTypeFromValue returns a pointer to a valid LLMObsInteractionType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewLLMObsInteractionTypeFromValue(v string) (*LLMObsInteractionType, error) { + ev := LLMObsInteractionType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for LLMObsInteractionType: valid values are %v", v, allowedLLMObsInteractionTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v LLMObsInteractionType) IsValid() bool { + for _, existing := range allowedLLMObsInteractionTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to LLMObsInteractionType value. +func (v LLMObsInteractionType) Ptr() *LLMObsInteractionType { + return &v +} diff --git a/api/datadogV2/model_observability_pipeline_config_destination_item.go b/api/datadogV2/model_observability_pipeline_config_destination_item.go index 69f232620cd..5b8058eebf5 100644 --- a/api/datadogV2/model_observability_pipeline_config_destination_item.go +++ b/api/datadogV2/model_observability_pipeline_config_destination_item.go @@ -10,6 +10,7 @@ import ( // ObservabilityPipelineConfigDestinationItem - A destination for the pipeline. type ObservabilityPipelineConfigDestinationItem struct { + ObservabilityPipelineElasticsearchDestination *ObservabilityPipelineElasticsearchDestination ObservabilityPipelineHttpClientDestination *ObservabilityPipelineHttpClientDestination ObservabilityPipelineAmazonOpenSearchDestination *ObservabilityPipelineAmazonOpenSearchDestination ObservabilityPipelineAmazonS3Destination *ObservabilityPipelineAmazonS3Destination @@ -19,7 +20,6 @@ type ObservabilityPipelineConfigDestinationItem struct { ObservabilityPipelineCloudPremDestination *ObservabilityPipelineCloudPremDestination ObservabilityPipelineCrowdStrikeNextGenSiemDestination *ObservabilityPipelineCrowdStrikeNextGenSiemDestination ObservabilityPipelineDatadogLogsDestination *ObservabilityPipelineDatadogLogsDestination - ObservabilityPipelineElasticsearchDestination *ObservabilityPipelineElasticsearchDestination ObservabilityPipelineGoogleChronicleDestination *ObservabilityPipelineGoogleChronicleDestination ObservabilityPipelineGoogleCloudStorageDestination *ObservabilityPipelineGoogleCloudStorageDestination ObservabilityPipelineGooglePubSubDestination *ObservabilityPipelineGooglePubSubDestination @@ -39,6 +39,11 @@ type ObservabilityPipelineConfigDestinationItem struct { UnparsedObject interface{} } +// ObservabilityPipelineElasticsearchDestinationAsObservabilityPipelineConfigDestinationItem is a convenience function that returns ObservabilityPipelineElasticsearchDestination wrapped in ObservabilityPipelineConfigDestinationItem. +func ObservabilityPipelineElasticsearchDestinationAsObservabilityPipelineConfigDestinationItem(v *ObservabilityPipelineElasticsearchDestination) ObservabilityPipelineConfigDestinationItem { + return ObservabilityPipelineConfigDestinationItem{ObservabilityPipelineElasticsearchDestination: v} +} + // ObservabilityPipelineHttpClientDestinationAsObservabilityPipelineConfigDestinationItem is a convenience function that returns ObservabilityPipelineHttpClientDestination wrapped in ObservabilityPipelineConfigDestinationItem. func ObservabilityPipelineHttpClientDestinationAsObservabilityPipelineConfigDestinationItem(v *ObservabilityPipelineHttpClientDestination) ObservabilityPipelineConfigDestinationItem { return ObservabilityPipelineConfigDestinationItem{ObservabilityPipelineHttpClientDestination: v} @@ -84,11 +89,6 @@ func ObservabilityPipelineDatadogLogsDestinationAsObservabilityPipelineConfigDes return ObservabilityPipelineConfigDestinationItem{ObservabilityPipelineDatadogLogsDestination: v} } -// ObservabilityPipelineElasticsearchDestinationAsObservabilityPipelineConfigDestinationItem is a convenience function that returns ObservabilityPipelineElasticsearchDestination wrapped in ObservabilityPipelineConfigDestinationItem. -func ObservabilityPipelineElasticsearchDestinationAsObservabilityPipelineConfigDestinationItem(v *ObservabilityPipelineElasticsearchDestination) ObservabilityPipelineConfigDestinationItem { - return ObservabilityPipelineConfigDestinationItem{ObservabilityPipelineElasticsearchDestination: v} -} - // ObservabilityPipelineGoogleChronicleDestinationAsObservabilityPipelineConfigDestinationItem is a convenience function that returns ObservabilityPipelineGoogleChronicleDestination wrapped in ObservabilityPipelineConfigDestinationItem. func ObservabilityPipelineGoogleChronicleDestinationAsObservabilityPipelineConfigDestinationItem(v *ObservabilityPipelineGoogleChronicleDestination) ObservabilityPipelineConfigDestinationItem { return ObservabilityPipelineConfigDestinationItem{ObservabilityPipelineGoogleChronicleDestination: v} @@ -163,6 +163,23 @@ func ObservabilityPipelineDatadogMetricsDestinationAsObservabilityPipelineConfig func (obj *ObservabilityPipelineConfigDestinationItem) UnmarshalJSON(data []byte) error { var err error match := 0 + // try to unmarshal data into ObservabilityPipelineElasticsearchDestination + err = datadog.Unmarshal(data, &obj.ObservabilityPipelineElasticsearchDestination) + if err == nil { + if obj.ObservabilityPipelineElasticsearchDestination != nil && obj.ObservabilityPipelineElasticsearchDestination.UnparsedObject == nil { + jsonObservabilityPipelineElasticsearchDestination, _ := datadog.Marshal(obj.ObservabilityPipelineElasticsearchDestination) + if string(jsonObservabilityPipelineElasticsearchDestination) == "{}" { // empty struct + obj.ObservabilityPipelineElasticsearchDestination = nil + } else { + match++ + } + } else { + obj.ObservabilityPipelineElasticsearchDestination = nil + } + } else { + obj.ObservabilityPipelineElasticsearchDestination = nil + } + // try to unmarshal data into ObservabilityPipelineHttpClientDestination err = datadog.Unmarshal(data, &obj.ObservabilityPipelineHttpClientDestination) if err == nil { @@ -316,23 +333,6 @@ func (obj *ObservabilityPipelineConfigDestinationItem) UnmarshalJSON(data []byte obj.ObservabilityPipelineDatadogLogsDestination = nil } - // try to unmarshal data into ObservabilityPipelineElasticsearchDestination - err = datadog.Unmarshal(data, &obj.ObservabilityPipelineElasticsearchDestination) - if err == nil { - if obj.ObservabilityPipelineElasticsearchDestination != nil && obj.ObservabilityPipelineElasticsearchDestination.UnparsedObject == nil { - jsonObservabilityPipelineElasticsearchDestination, _ := datadog.Marshal(obj.ObservabilityPipelineElasticsearchDestination) - if string(jsonObservabilityPipelineElasticsearchDestination) == "{}" { // empty struct - obj.ObservabilityPipelineElasticsearchDestination = nil - } else { - match++ - } - } else { - obj.ObservabilityPipelineElasticsearchDestination = nil - } - } else { - obj.ObservabilityPipelineElasticsearchDestination = nil - } - // try to unmarshal data into ObservabilityPipelineGoogleChronicleDestination err = datadog.Unmarshal(data, &obj.ObservabilityPipelineGoogleChronicleDestination) if err == nil { @@ -573,6 +573,7 @@ func (obj *ObservabilityPipelineConfigDestinationItem) UnmarshalJSON(data []byte if match != 1 { // more than 1 match // reset to nil + obj.ObservabilityPipelineElasticsearchDestination = nil obj.ObservabilityPipelineHttpClientDestination = nil obj.ObservabilityPipelineAmazonOpenSearchDestination = nil obj.ObservabilityPipelineAmazonS3Destination = nil @@ -582,7 +583,6 @@ func (obj *ObservabilityPipelineConfigDestinationItem) UnmarshalJSON(data []byte obj.ObservabilityPipelineCloudPremDestination = nil obj.ObservabilityPipelineCrowdStrikeNextGenSiemDestination = nil obj.ObservabilityPipelineDatadogLogsDestination = nil - obj.ObservabilityPipelineElasticsearchDestination = nil obj.ObservabilityPipelineGoogleChronicleDestination = nil obj.ObservabilityPipelineGoogleCloudStorageDestination = nil obj.ObservabilityPipelineGooglePubSubDestination = nil @@ -604,6 +604,10 @@ func (obj *ObservabilityPipelineConfigDestinationItem) UnmarshalJSON(data []byte // MarshalJSON turns data from the first non-nil pointers in the struct to JSON. func (obj ObservabilityPipelineConfigDestinationItem) MarshalJSON() ([]byte, error) { + if obj.ObservabilityPipelineElasticsearchDestination != nil { + return datadog.Marshal(&obj.ObservabilityPipelineElasticsearchDestination) + } + if obj.ObservabilityPipelineHttpClientDestination != nil { return datadog.Marshal(&obj.ObservabilityPipelineHttpClientDestination) } @@ -640,10 +644,6 @@ func (obj ObservabilityPipelineConfigDestinationItem) MarshalJSON() ([]byte, err return datadog.Marshal(&obj.ObservabilityPipelineDatadogLogsDestination) } - if obj.ObservabilityPipelineElasticsearchDestination != nil { - return datadog.Marshal(&obj.ObservabilityPipelineElasticsearchDestination) - } - if obj.ObservabilityPipelineGoogleChronicleDestination != nil { return datadog.Marshal(&obj.ObservabilityPipelineGoogleChronicleDestination) } @@ -708,6 +708,10 @@ func (obj ObservabilityPipelineConfigDestinationItem) MarshalJSON() ([]byte, err // GetActualInstance returns the actual instance. func (obj *ObservabilityPipelineConfigDestinationItem) GetActualInstance() interface{} { + if obj.ObservabilityPipelineElasticsearchDestination != nil { + return obj.ObservabilityPipelineElasticsearchDestination + } + if obj.ObservabilityPipelineHttpClientDestination != nil { return obj.ObservabilityPipelineHttpClientDestination } @@ -744,10 +748,6 @@ func (obj *ObservabilityPipelineConfigDestinationItem) GetActualInstance() inter return obj.ObservabilityPipelineDatadogLogsDestination } - if obj.ObservabilityPipelineElasticsearchDestination != nil { - return obj.ObservabilityPipelineElasticsearchDestination - } - if obj.ObservabilityPipelineGoogleChronicleDestination != nil { return obj.ObservabilityPipelineGoogleChronicleDestination } diff --git a/api/datadogV2/model_observability_pipeline_elasticsearch_destination.go b/api/datadogV2/model_observability_pipeline_elasticsearch_destination.go index f547453b4c7..9ff68c9ba83 100644 --- a/api/datadogV2/model_observability_pipeline_elasticsearch_destination.go +++ b/api/datadogV2/model_observability_pipeline_elasticsearch_destination.go @@ -10,9 +10,9 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// ObservabilityPipelineElasticsearchDestination The `elasticsearch` destination writes logs to an Elasticsearch cluster. +// ObservabilityPipelineElasticsearchDestination The `elasticsearch` destination writes logs or metrics to an Elasticsearch cluster. // -// **Supported pipeline types:** logs +// **Supported pipeline types:** logs, metrics type ObservabilityPipelineElasticsearchDestination struct { // The Elasticsearch API version to use. Set to `auto` to auto-detect. ApiVersion *ObservabilityPipelineElasticsearchDestinationApiVersion `json:"api_version,omitempty"` @@ -21,16 +21,26 @@ type ObservabilityPipelineElasticsearchDestination struct { Auth *ObservabilityPipelineElasticsearchDestinationAuth `json:"auth,omitempty"` // Configuration for buffer settings on destination components. Buffer *ObservabilityPipelineBufferOptions `json:"buffer,omitempty"` - // The index to write logs to in Elasticsearch. + // The name of the index to write events to in Elasticsearch. BulkIndex *string `json:"bulk_index,omitempty"` + // Compression configuration for the Elasticsearch destination. + Compression *ObservabilityPipelineElasticsearchDestinationCompression `json:"compression,omitempty"` // Configuration options for writing to Elasticsearch Data Streams instead of a fixed index. DataStream *ObservabilityPipelineElasticsearchDestinationDataStream `json:"data_stream,omitempty"` // Name of the environment variable or secret that holds the Elasticsearch endpoint URL. EndpointUrlKey *string `json:"endpoint_url_key,omitempty"` // The unique identifier for this component. Id string `json:"id"` + // The name of the field used as the document ID in Elasticsearch. + IdKey *string `json:"id_key,omitempty"` // A list of component IDs whose output is used as the `input` for this component. Inputs []string `json:"inputs"` + // The name of an Elasticsearch ingest pipeline to apply to events before indexing. + Pipeline *string `json:"pipeline,omitempty"` + // When `true`, retries failed partial bulk requests when some events in a batch fail while others succeed. + RequestRetryPartial *bool `json:"request_retry_partial,omitempty"` + // Configuration for enabling TLS encryption between the pipeline component and external services. + Tls *ObservabilityPipelineTls `json:"tls,omitempty"` // The destination type. The value should always be `elasticsearch`. Type ObservabilityPipelineElasticsearchDestinationType `json:"type"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct @@ -172,6 +182,34 @@ func (o *ObservabilityPipelineElasticsearchDestination) SetBulkIndex(v string) { o.BulkIndex = &v } +// GetCompression returns the Compression field value if set, zero value otherwise. +func (o *ObservabilityPipelineElasticsearchDestination) GetCompression() ObservabilityPipelineElasticsearchDestinationCompression { + if o == nil || o.Compression == nil { + var ret ObservabilityPipelineElasticsearchDestinationCompression + return ret + } + return *o.Compression +} + +// GetCompressionOk returns a tuple with the Compression field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ObservabilityPipelineElasticsearchDestination) GetCompressionOk() (*ObservabilityPipelineElasticsearchDestinationCompression, bool) { + if o == nil || o.Compression == nil { + return nil, false + } + return o.Compression, true +} + +// HasCompression returns a boolean if a field has been set. +func (o *ObservabilityPipelineElasticsearchDestination) HasCompression() bool { + return o != nil && o.Compression != nil +} + +// SetCompression gets a reference to the given ObservabilityPipelineElasticsearchDestinationCompression and assigns it to the Compression field. +func (o *ObservabilityPipelineElasticsearchDestination) SetCompression(v ObservabilityPipelineElasticsearchDestinationCompression) { + o.Compression = &v +} + // GetDataStream returns the DataStream field value if set, zero value otherwise. func (o *ObservabilityPipelineElasticsearchDestination) GetDataStream() ObservabilityPipelineElasticsearchDestinationDataStream { if o == nil || o.DataStream == nil { @@ -251,6 +289,34 @@ func (o *ObservabilityPipelineElasticsearchDestination) SetId(v string) { o.Id = v } +// GetIdKey returns the IdKey field value if set, zero value otherwise. +func (o *ObservabilityPipelineElasticsearchDestination) GetIdKey() string { + if o == nil || o.IdKey == nil { + var ret string + return ret + } + return *o.IdKey +} + +// GetIdKeyOk returns a tuple with the IdKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ObservabilityPipelineElasticsearchDestination) GetIdKeyOk() (*string, bool) { + if o == nil || o.IdKey == nil { + return nil, false + } + return o.IdKey, true +} + +// HasIdKey returns a boolean if a field has been set. +func (o *ObservabilityPipelineElasticsearchDestination) HasIdKey() bool { + return o != nil && o.IdKey != nil +} + +// SetIdKey gets a reference to the given string and assigns it to the IdKey field. +func (o *ObservabilityPipelineElasticsearchDestination) SetIdKey(v string) { + o.IdKey = &v +} + // GetInputs returns the Inputs field value. func (o *ObservabilityPipelineElasticsearchDestination) GetInputs() []string { if o == nil { @@ -274,6 +340,90 @@ func (o *ObservabilityPipelineElasticsearchDestination) SetInputs(v []string) { o.Inputs = v } +// GetPipeline returns the Pipeline field value if set, zero value otherwise. +func (o *ObservabilityPipelineElasticsearchDestination) GetPipeline() string { + if o == nil || o.Pipeline == nil { + var ret string + return ret + } + return *o.Pipeline +} + +// GetPipelineOk returns a tuple with the Pipeline field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ObservabilityPipelineElasticsearchDestination) GetPipelineOk() (*string, bool) { + if o == nil || o.Pipeline == nil { + return nil, false + } + return o.Pipeline, true +} + +// HasPipeline returns a boolean if a field has been set. +func (o *ObservabilityPipelineElasticsearchDestination) HasPipeline() bool { + return o != nil && o.Pipeline != nil +} + +// SetPipeline gets a reference to the given string and assigns it to the Pipeline field. +func (o *ObservabilityPipelineElasticsearchDestination) SetPipeline(v string) { + o.Pipeline = &v +} + +// GetRequestRetryPartial returns the RequestRetryPartial field value if set, zero value otherwise. +func (o *ObservabilityPipelineElasticsearchDestination) GetRequestRetryPartial() bool { + if o == nil || o.RequestRetryPartial == nil { + var ret bool + return ret + } + return *o.RequestRetryPartial +} + +// GetRequestRetryPartialOk returns a tuple with the RequestRetryPartial field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ObservabilityPipelineElasticsearchDestination) GetRequestRetryPartialOk() (*bool, bool) { + if o == nil || o.RequestRetryPartial == nil { + return nil, false + } + return o.RequestRetryPartial, true +} + +// HasRequestRetryPartial returns a boolean if a field has been set. +func (o *ObservabilityPipelineElasticsearchDestination) HasRequestRetryPartial() bool { + return o != nil && o.RequestRetryPartial != nil +} + +// SetRequestRetryPartial gets a reference to the given bool and assigns it to the RequestRetryPartial field. +func (o *ObservabilityPipelineElasticsearchDestination) SetRequestRetryPartial(v bool) { + o.RequestRetryPartial = &v +} + +// GetTls returns the Tls field value if set, zero value otherwise. +func (o *ObservabilityPipelineElasticsearchDestination) GetTls() ObservabilityPipelineTls { + if o == nil || o.Tls == nil { + var ret ObservabilityPipelineTls + return ret + } + return *o.Tls +} + +// GetTlsOk returns a tuple with the Tls field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ObservabilityPipelineElasticsearchDestination) GetTlsOk() (*ObservabilityPipelineTls, bool) { + if o == nil || o.Tls == nil { + return nil, false + } + return o.Tls, true +} + +// HasTls returns a boolean if a field has been set. +func (o *ObservabilityPipelineElasticsearchDestination) HasTls() bool { + return o != nil && o.Tls != nil +} + +// SetTls gets a reference to the given ObservabilityPipelineTls and assigns it to the Tls field. +func (o *ObservabilityPipelineElasticsearchDestination) SetTls(v ObservabilityPipelineTls) { + o.Tls = &v +} + // GetType returns the Type field value. func (o *ObservabilityPipelineElasticsearchDestination) GetType() ObservabilityPipelineElasticsearchDestinationType { if o == nil { @@ -315,6 +465,9 @@ func (o ObservabilityPipelineElasticsearchDestination) MarshalJSON() ([]byte, er if o.BulkIndex != nil { toSerialize["bulk_index"] = o.BulkIndex } + if o.Compression != nil { + toSerialize["compression"] = o.Compression + } if o.DataStream != nil { toSerialize["data_stream"] = o.DataStream } @@ -322,7 +475,19 @@ func (o ObservabilityPipelineElasticsearchDestination) MarshalJSON() ([]byte, er toSerialize["endpoint_url_key"] = o.EndpointUrlKey } toSerialize["id"] = o.Id + if o.IdKey != nil { + toSerialize["id_key"] = o.IdKey + } toSerialize["inputs"] = o.Inputs + if o.Pipeline != nil { + toSerialize["pipeline"] = o.Pipeline + } + if o.RequestRetryPartial != nil { + toSerialize["request_retry_partial"] = o.RequestRetryPartial + } + if o.Tls != nil { + toSerialize["tls"] = o.Tls + } toSerialize["type"] = o.Type for key, value := range o.AdditionalProperties { @@ -334,15 +499,20 @@ func (o ObservabilityPipelineElasticsearchDestination) MarshalJSON() ([]byte, er // UnmarshalJSON deserializes the given payload. func (o *ObservabilityPipelineElasticsearchDestination) UnmarshalJSON(bytes []byte) (err error) { all := struct { - ApiVersion *ObservabilityPipelineElasticsearchDestinationApiVersion `json:"api_version,omitempty"` - Auth *ObservabilityPipelineElasticsearchDestinationAuth `json:"auth,omitempty"` - Buffer *ObservabilityPipelineBufferOptions `json:"buffer,omitempty"` - BulkIndex *string `json:"bulk_index,omitempty"` - DataStream *ObservabilityPipelineElasticsearchDestinationDataStream `json:"data_stream,omitempty"` - EndpointUrlKey *string `json:"endpoint_url_key,omitempty"` - Id *string `json:"id"` - Inputs *[]string `json:"inputs"` - Type *ObservabilityPipelineElasticsearchDestinationType `json:"type"` + ApiVersion *ObservabilityPipelineElasticsearchDestinationApiVersion `json:"api_version,omitempty"` + Auth *ObservabilityPipelineElasticsearchDestinationAuth `json:"auth,omitempty"` + Buffer *ObservabilityPipelineBufferOptions `json:"buffer,omitempty"` + BulkIndex *string `json:"bulk_index,omitempty"` + Compression *ObservabilityPipelineElasticsearchDestinationCompression `json:"compression,omitempty"` + DataStream *ObservabilityPipelineElasticsearchDestinationDataStream `json:"data_stream,omitempty"` + EndpointUrlKey *string `json:"endpoint_url_key,omitempty"` + Id *string `json:"id"` + IdKey *string `json:"id_key,omitempty"` + Inputs *[]string `json:"inputs"` + Pipeline *string `json:"pipeline,omitempty"` + RequestRetryPartial *bool `json:"request_retry_partial,omitempty"` + Tls *ObservabilityPipelineTls `json:"tls,omitempty"` + Type *ObservabilityPipelineElasticsearchDestinationType `json:"type"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { return datadog.Unmarshal(bytes, &o.UnparsedObject) @@ -358,7 +528,7 @@ func (o *ObservabilityPipelineElasticsearchDestination) UnmarshalJSON(bytes []by } additionalProperties := make(map[string]interface{}) if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"api_version", "auth", "buffer", "bulk_index", "data_stream", "endpoint_url_key", "id", "inputs", "type"}) + datadog.DeleteKeys(additionalProperties, &[]string{"api_version", "auth", "buffer", "bulk_index", "compression", "data_stream", "endpoint_url_key", "id", "id_key", "inputs", "pipeline", "request_retry_partial", "tls", "type"}) } else { return err } @@ -375,13 +545,24 @@ func (o *ObservabilityPipelineElasticsearchDestination) UnmarshalJSON(bytes []by o.Auth = all.Auth o.Buffer = all.Buffer o.BulkIndex = all.BulkIndex + if all.Compression != nil && all.Compression.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Compression = all.Compression if all.DataStream != nil && all.DataStream.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } o.DataStream = all.DataStream o.EndpointUrlKey = all.EndpointUrlKey o.Id = *all.Id + o.IdKey = all.IdKey o.Inputs = *all.Inputs + o.Pipeline = all.Pipeline + o.RequestRetryPartial = all.RequestRetryPartial + if all.Tls != nil && all.Tls.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Tls = all.Tls if !all.Type.IsValid() { hasInvalidField = true } else { diff --git a/api/datadogV2/model_observability_pipeline_elasticsearch_destination_compression.go b/api/datadogV2/model_observability_pipeline_elasticsearch_destination_compression.go new file mode 100644 index 00000000000..59dcf8254b2 --- /dev/null +++ b/api/datadogV2/model_observability_pipeline_elasticsearch_destination_compression.go @@ -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 datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ObservabilityPipelineElasticsearchDestinationCompression Compression configuration for the Elasticsearch destination. +type ObservabilityPipelineElasticsearchDestinationCompression struct { + // The compression algorithm applied when sending data to Elasticsearch. + Algorithm ObservabilityPipelineElasticsearchDestinationCompressionAlgorithm `json:"algorithm"` + // The compression level. Only applicable for `gzip`, `zlib`, and `zstd` algorithms. + Level *int64 `json:"level,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewObservabilityPipelineElasticsearchDestinationCompression instantiates a new ObservabilityPipelineElasticsearchDestinationCompression object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewObservabilityPipelineElasticsearchDestinationCompression(algorithm ObservabilityPipelineElasticsearchDestinationCompressionAlgorithm) *ObservabilityPipelineElasticsearchDestinationCompression { + this := ObservabilityPipelineElasticsearchDestinationCompression{} + this.Algorithm = algorithm + return &this +} + +// NewObservabilityPipelineElasticsearchDestinationCompressionWithDefaults instantiates a new ObservabilityPipelineElasticsearchDestinationCompression object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewObservabilityPipelineElasticsearchDestinationCompressionWithDefaults() *ObservabilityPipelineElasticsearchDestinationCompression { + this := ObservabilityPipelineElasticsearchDestinationCompression{} + return &this +} + +// GetAlgorithm returns the Algorithm field value. +func (o *ObservabilityPipelineElasticsearchDestinationCompression) GetAlgorithm() ObservabilityPipelineElasticsearchDestinationCompressionAlgorithm { + if o == nil { + var ret ObservabilityPipelineElasticsearchDestinationCompressionAlgorithm + return ret + } + return o.Algorithm +} + +// GetAlgorithmOk returns a tuple with the Algorithm field value +// and a boolean to check if the value has been set. +func (o *ObservabilityPipelineElasticsearchDestinationCompression) GetAlgorithmOk() (*ObservabilityPipelineElasticsearchDestinationCompressionAlgorithm, bool) { + if o == nil { + return nil, false + } + return &o.Algorithm, true +} + +// SetAlgorithm sets field value. +func (o *ObservabilityPipelineElasticsearchDestinationCompression) SetAlgorithm(v ObservabilityPipelineElasticsearchDestinationCompressionAlgorithm) { + o.Algorithm = v +} + +// GetLevel returns the Level field value if set, zero value otherwise. +func (o *ObservabilityPipelineElasticsearchDestinationCompression) GetLevel() int64 { + if o == nil || o.Level == nil { + var ret int64 + return ret + } + return *o.Level +} + +// GetLevelOk returns a tuple with the Level field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ObservabilityPipelineElasticsearchDestinationCompression) GetLevelOk() (*int64, bool) { + if o == nil || o.Level == nil { + return nil, false + } + return o.Level, true +} + +// HasLevel returns a boolean if a field has been set. +func (o *ObservabilityPipelineElasticsearchDestinationCompression) HasLevel() bool { + return o != nil && o.Level != nil +} + +// SetLevel gets a reference to the given int64 and assigns it to the Level field. +func (o *ObservabilityPipelineElasticsearchDestinationCompression) SetLevel(v int64) { + o.Level = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o ObservabilityPipelineElasticsearchDestinationCompression) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["algorithm"] = o.Algorithm + if o.Level != nil { + toSerialize["level"] = o.Level + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *ObservabilityPipelineElasticsearchDestinationCompression) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Algorithm *ObservabilityPipelineElasticsearchDestinationCompressionAlgorithm `json:"algorithm"` + Level *int64 `json:"level,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Algorithm == nil { + return fmt.Errorf("required field algorithm missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"algorithm", "level"}) + } else { + return err + } + + hasInvalidField := false + if !all.Algorithm.IsValid() { + hasInvalidField = true + } else { + o.Algorithm = *all.Algorithm + } + o.Level = all.Level + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_observability_pipeline_elasticsearch_destination_compression_algorithm.go b/api/datadogV2/model_observability_pipeline_elasticsearch_destination_compression_algorithm.go new file mode 100644 index 00000000000..dd7b0cfa890 --- /dev/null +++ b/api/datadogV2/model_observability_pipeline_elasticsearch_destination_compression_algorithm.go @@ -0,0 +1,72 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ObservabilityPipelineElasticsearchDestinationCompressionAlgorithm The compression algorithm applied when sending data to Elasticsearch. +type ObservabilityPipelineElasticsearchDestinationCompressionAlgorithm string + +// List of ObservabilityPipelineElasticsearchDestinationCompressionAlgorithm. +const ( + OBSERVABILITYPIPELINEELASTICSEARCHDESTINATIONCOMPRESSIONALGORITHM_NONE ObservabilityPipelineElasticsearchDestinationCompressionAlgorithm = "none" + OBSERVABILITYPIPELINEELASTICSEARCHDESTINATIONCOMPRESSIONALGORITHM_GZIP ObservabilityPipelineElasticsearchDestinationCompressionAlgorithm = "gzip" + OBSERVABILITYPIPELINEELASTICSEARCHDESTINATIONCOMPRESSIONALGORITHM_ZLIB ObservabilityPipelineElasticsearchDestinationCompressionAlgorithm = "zlib" + OBSERVABILITYPIPELINEELASTICSEARCHDESTINATIONCOMPRESSIONALGORITHM_ZSTD ObservabilityPipelineElasticsearchDestinationCompressionAlgorithm = "zstd" + OBSERVABILITYPIPELINEELASTICSEARCHDESTINATIONCOMPRESSIONALGORITHM_SNAPPY ObservabilityPipelineElasticsearchDestinationCompressionAlgorithm = "snappy" +) + +var allowedObservabilityPipelineElasticsearchDestinationCompressionAlgorithmEnumValues = []ObservabilityPipelineElasticsearchDestinationCompressionAlgorithm{ + OBSERVABILITYPIPELINEELASTICSEARCHDESTINATIONCOMPRESSIONALGORITHM_NONE, + OBSERVABILITYPIPELINEELASTICSEARCHDESTINATIONCOMPRESSIONALGORITHM_GZIP, + OBSERVABILITYPIPELINEELASTICSEARCHDESTINATIONCOMPRESSIONALGORITHM_ZLIB, + OBSERVABILITYPIPELINEELASTICSEARCHDESTINATIONCOMPRESSIONALGORITHM_ZSTD, + OBSERVABILITYPIPELINEELASTICSEARCHDESTINATIONCOMPRESSIONALGORITHM_SNAPPY, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *ObservabilityPipelineElasticsearchDestinationCompressionAlgorithm) GetAllowedValues() []ObservabilityPipelineElasticsearchDestinationCompressionAlgorithm { + return allowedObservabilityPipelineElasticsearchDestinationCompressionAlgorithmEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *ObservabilityPipelineElasticsearchDestinationCompressionAlgorithm) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = ObservabilityPipelineElasticsearchDestinationCompressionAlgorithm(value) + return nil +} + +// NewObservabilityPipelineElasticsearchDestinationCompressionAlgorithmFromValue returns a pointer to a valid ObservabilityPipelineElasticsearchDestinationCompressionAlgorithm +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewObservabilityPipelineElasticsearchDestinationCompressionAlgorithmFromValue(v string) (*ObservabilityPipelineElasticsearchDestinationCompressionAlgorithm, error) { + ev := ObservabilityPipelineElasticsearchDestinationCompressionAlgorithm(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for ObservabilityPipelineElasticsearchDestinationCompressionAlgorithm: valid values are %v", v, allowedObservabilityPipelineElasticsearchDestinationCompressionAlgorithmEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v ObservabilityPipelineElasticsearchDestinationCompressionAlgorithm) IsValid() bool { + for _, existing := range allowedObservabilityPipelineElasticsearchDestinationCompressionAlgorithmEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ObservabilityPipelineElasticsearchDestinationCompressionAlgorithm value. +func (v ObservabilityPipelineElasticsearchDestinationCompressionAlgorithm) Ptr() *ObservabilityPipelineElasticsearchDestinationCompressionAlgorithm { + return &v +} diff --git a/api/datadogV2/model_observability_pipeline_elasticsearch_destination_data_stream.go b/api/datadogV2/model_observability_pipeline_elasticsearch_destination_data_stream.go index 510fe2be861..f7a5a1f41e1 100644 --- a/api/datadogV2/model_observability_pipeline_elasticsearch_destination_data_stream.go +++ b/api/datadogV2/model_observability_pipeline_elasticsearch_destination_data_stream.go @@ -10,12 +10,16 @@ import ( // ObservabilityPipelineElasticsearchDestinationDataStream Configuration options for writing to Elasticsearch Data Streams instead of a fixed index. type ObservabilityPipelineElasticsearchDestinationDataStream struct { - // The data stream dataset for your logs. This groups logs by their source or application. + // When `true`, automatically routes events to the appropriate data stream based on the event content. + AutoRouting *bool `json:"auto_routing,omitempty"` + // The data stream dataset. This groups events by their source or application. Dataset *string `json:"dataset,omitempty"` - // The data stream type for your logs. This determines how logs are categorized within the data stream. + // The data stream type. This determines how events are categorized within the data stream. Dtype *string `json:"dtype,omitempty"` - // The data stream namespace for your logs. This separates logs into different environments or domains. + // The data stream namespace. This separates events into different environments or domains. Namespace *string `json:"namespace,omitempty"` + // When `true`, synchronizes data stream fields with the Elasticsearch index mapping. + SyncFields *bool `json:"sync_fields,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` @@ -38,6 +42,34 @@ func NewObservabilityPipelineElasticsearchDestinationDataStreamWithDefaults() *O return &this } +// GetAutoRouting returns the AutoRouting field value if set, zero value otherwise. +func (o *ObservabilityPipelineElasticsearchDestinationDataStream) GetAutoRouting() bool { + if o == nil || o.AutoRouting == nil { + var ret bool + return ret + } + return *o.AutoRouting +} + +// GetAutoRoutingOk returns a tuple with the AutoRouting field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ObservabilityPipelineElasticsearchDestinationDataStream) GetAutoRoutingOk() (*bool, bool) { + if o == nil || o.AutoRouting == nil { + return nil, false + } + return o.AutoRouting, true +} + +// HasAutoRouting returns a boolean if a field has been set. +func (o *ObservabilityPipelineElasticsearchDestinationDataStream) HasAutoRouting() bool { + return o != nil && o.AutoRouting != nil +} + +// SetAutoRouting gets a reference to the given bool and assigns it to the AutoRouting field. +func (o *ObservabilityPipelineElasticsearchDestinationDataStream) SetAutoRouting(v bool) { + o.AutoRouting = &v +} + // GetDataset returns the Dataset field value if set, zero value otherwise. func (o *ObservabilityPipelineElasticsearchDestinationDataStream) GetDataset() string { if o == nil || o.Dataset == nil { @@ -122,12 +154,43 @@ func (o *ObservabilityPipelineElasticsearchDestinationDataStream) SetNamespace(v o.Namespace = &v } +// GetSyncFields returns the SyncFields field value if set, zero value otherwise. +func (o *ObservabilityPipelineElasticsearchDestinationDataStream) GetSyncFields() bool { + if o == nil || o.SyncFields == nil { + var ret bool + return ret + } + return *o.SyncFields +} + +// GetSyncFieldsOk returns a tuple with the SyncFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ObservabilityPipelineElasticsearchDestinationDataStream) GetSyncFieldsOk() (*bool, bool) { + if o == nil || o.SyncFields == nil { + return nil, false + } + return o.SyncFields, true +} + +// HasSyncFields returns a boolean if a field has been set. +func (o *ObservabilityPipelineElasticsearchDestinationDataStream) HasSyncFields() bool { + return o != nil && o.SyncFields != nil +} + +// SetSyncFields gets a reference to the given bool and assigns it to the SyncFields field. +func (o *ObservabilityPipelineElasticsearchDestinationDataStream) SetSyncFields(v bool) { + o.SyncFields = &v +} + // MarshalJSON serializes the struct using spec logic. func (o ObservabilityPipelineElasticsearchDestinationDataStream) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.UnparsedObject != nil { return datadog.Marshal(o.UnparsedObject) } + if o.AutoRouting != nil { + toSerialize["auto_routing"] = o.AutoRouting + } if o.Dataset != nil { toSerialize["dataset"] = o.Dataset } @@ -137,6 +200,9 @@ func (o ObservabilityPipelineElasticsearchDestinationDataStream) MarshalJSON() ( if o.Namespace != nil { toSerialize["namespace"] = o.Namespace } + if o.SyncFields != nil { + toSerialize["sync_fields"] = o.SyncFields + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -147,22 +213,26 @@ func (o ObservabilityPipelineElasticsearchDestinationDataStream) MarshalJSON() ( // UnmarshalJSON deserializes the given payload. func (o *ObservabilityPipelineElasticsearchDestinationDataStream) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Dataset *string `json:"dataset,omitempty"` - Dtype *string `json:"dtype,omitempty"` - Namespace *string `json:"namespace,omitempty"` + AutoRouting *bool `json:"auto_routing,omitempty"` + Dataset *string `json:"dataset,omitempty"` + Dtype *string `json:"dtype,omitempty"` + Namespace *string `json:"namespace,omitempty"` + SyncFields *bool `json:"sync_fields,omitempty"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { return datadog.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"dataset", "dtype", "namespace"}) + datadog.DeleteKeys(additionalProperties, &[]string{"auto_routing", "dataset", "dtype", "namespace", "sync_fields"}) } else { return err } + o.AutoRouting = all.AutoRouting o.Dataset = all.Dataset o.Dtype = all.Dtype o.Namespace = all.Namespace + o.SyncFields = all.SyncFields if len(additionalProperties) > 0 { o.AdditionalProperties = additionalProperties diff --git a/examples/v2/llm-observability/CreateLLMObsAnnotationQueue.go b/examples/v2/llm-observability/CreateLLMObsAnnotationQueue.go new file mode 100644 index 00000000000..31bf624e955 --- /dev/null +++ b/examples/v2/llm-observability/CreateLLMObsAnnotationQueue.go @@ -0,0 +1,40 @@ +// Create an LLM Observability annotation queue returns "Created" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + body := datadogV2.LLMObsAnnotationQueueRequest{ + Data: datadogV2.LLMObsAnnotationQueueDataRequest{ + Attributes: datadogV2.LLMObsAnnotationQueueDataAttributesRequest{ + Description: datadog.PtrString("Queue for annotating customer support traces"), + Name: "My annotation queue", + ProjectId: "a33671aa-24fd-4dcd-9b33-a8ec7dde7751", + }, + Type: datadogV2.LLMOBSANNOTATIONQUEUETYPE_QUEUES, + }, + } + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.CreateLLMObsAnnotationQueue", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewLLMObservabilityApi(apiClient) + resp, r, err := api.CreateLLMObsAnnotationQueue(ctx, body) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LLMObservabilityApi.CreateLLMObsAnnotationQueue`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `LLMObservabilityApi.CreateLLMObsAnnotationQueue`:\n%s\n", responseContent) +} diff --git a/examples/v2/llm-observability/CreateLLMObsAnnotationQueueInteractions.go b/examples/v2/llm-observability/CreateLLMObsAnnotationQueueInteractions.go new file mode 100644 index 00000000000..359bdc40549 --- /dev/null +++ b/examples/v2/llm-observability/CreateLLMObsAnnotationQueueInteractions.go @@ -0,0 +1,43 @@ +// Add annotation queue interactions returns "Created" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + body := datadogV2.LLMObsAnnotationQueueInteractionsRequest{ + Data: datadogV2.LLMObsAnnotationQueueInteractionsDataRequest{ + Attributes: datadogV2.LLMObsAnnotationQueueInteractionsDataAttributesRequest{ + Interactions: []datadogV2.LLMObsAnnotationQueueInteractionItem{ + { + ContentId: "trace-abc-123", + Type: datadogV2.LLMOBSINTERACTIONTYPE_TRACE, + }, + }, + }, + Type: datadogV2.LLMOBSANNOTATIONQUEUEINTERACTIONSTYPE_INTERACTIONS, + }, + } + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.CreateLLMObsAnnotationQueueInteractions", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewLLMObservabilityApi(apiClient) + resp, r, err := api.CreateLLMObsAnnotationQueueInteractions(ctx, "queue_id", body) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LLMObservabilityApi.CreateLLMObsAnnotationQueueInteractions`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `LLMObservabilityApi.CreateLLMObsAnnotationQueueInteractions`:\n%s\n", responseContent) +} diff --git a/examples/v2/llm-observability/DeleteLLMObsAnnotationQueue.go b/examples/v2/llm-observability/DeleteLLMObsAnnotationQueue.go new file mode 100644 index 00000000000..564521652e2 --- /dev/null +++ b/examples/v2/llm-observability/DeleteLLMObsAnnotationQueue.go @@ -0,0 +1,26 @@ +// Delete an LLM Observability annotation queue returns "No Content" response + +package main + +import ( + "context" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.DeleteLLMObsAnnotationQueue", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewLLMObservabilityApi(apiClient) + r, err := api.DeleteLLMObsAnnotationQueue(ctx, "queue_id") + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LLMObservabilityApi.DeleteLLMObsAnnotationQueue`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} diff --git a/examples/v2/llm-observability/DeleteLLMObsAnnotationQueueInteractions.go b/examples/v2/llm-observability/DeleteLLMObsAnnotationQueueInteractions.go new file mode 100644 index 00000000000..732b9695f55 --- /dev/null +++ b/examples/v2/llm-observability/DeleteLLMObsAnnotationQueueInteractions.go @@ -0,0 +1,37 @@ +// Delete annotation queue interactions returns "No Content" response + +package main + +import ( + "context" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + body := datadogV2.LLMObsDeleteAnnotationQueueInteractionsRequest{ + Data: datadogV2.LLMObsDeleteAnnotationQueueInteractionsDataRequest{ + Attributes: datadogV2.LLMObsDeleteAnnotationQueueInteractionsDataAttributesRequest{ + InteractionIds: []string{ + "00000000-0000-0000-0000-000000000000", + "00000000-0000-0000-0000-000000000001", + }, + }, + Type: datadogV2.LLMOBSANNOTATIONQUEUEINTERACTIONSTYPE_INTERACTIONS, + }, + } + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.DeleteLLMObsAnnotationQueueInteractions", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewLLMObservabilityApi(apiClient) + r, err := api.DeleteLLMObsAnnotationQueueInteractions(ctx, "queue_id", body) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LLMObservabilityApi.DeleteLLMObsAnnotationQueueInteractions`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} diff --git a/examples/v2/llm-observability/GetLLMObsAnnotatedInteractions.go b/examples/v2/llm-observability/GetLLMObsAnnotatedInteractions.go new file mode 100644 index 00000000000..8835b13089c --- /dev/null +++ b/examples/v2/llm-observability/GetLLMObsAnnotatedInteractions.go @@ -0,0 +1,30 @@ +// Get annotated queue interactions returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.GetLLMObsAnnotatedInteractions", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewLLMObservabilityApi(apiClient) + resp, r, err := api.GetLLMObsAnnotatedInteractions(ctx, "queue_id") + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LLMObservabilityApi.GetLLMObsAnnotatedInteractions`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `LLMObservabilityApi.GetLLMObsAnnotatedInteractions`:\n%s\n", responseContent) +} diff --git a/examples/v2/llm-observability/ListLLMObsAnnotationQueues.go b/examples/v2/llm-observability/ListLLMObsAnnotationQueues.go new file mode 100644 index 00000000000..71d86484ce0 --- /dev/null +++ b/examples/v2/llm-observability/ListLLMObsAnnotationQueues.go @@ -0,0 +1,30 @@ +// List LLM Observability annotation queues returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.ListLLMObsAnnotationQueues", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewLLMObservabilityApi(apiClient) + resp, r, err := api.ListLLMObsAnnotationQueues(ctx, *datadogV2.NewListLLMObsAnnotationQueuesOptionalParameters()) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LLMObservabilityApi.ListLLMObsAnnotationQueues`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `LLMObservabilityApi.ListLLMObsAnnotationQueues`:\n%s\n", responseContent) +} diff --git a/examples/v2/llm-observability/UpdateLLMObsAnnotationQueue.go b/examples/v2/llm-observability/UpdateLLMObsAnnotationQueue.go new file mode 100644 index 00000000000..d16fd7b6b14 --- /dev/null +++ b/examples/v2/llm-observability/UpdateLLMObsAnnotationQueue.go @@ -0,0 +1,39 @@ +// Update an LLM Observability annotation queue returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + body := datadogV2.LLMObsAnnotationQueueUpdateRequest{ + Data: datadogV2.LLMObsAnnotationQueueUpdateDataRequest{ + Attributes: datadogV2.LLMObsAnnotationQueueUpdateDataAttributesRequest{ + Description: datadog.PtrString("Updated description"), + Name: datadog.PtrString("Updated queue name"), + }, + Type: datadogV2.LLMOBSANNOTATIONQUEUETYPE_QUEUES, + }, + } + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.UpdateLLMObsAnnotationQueue", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewLLMObservabilityApi(apiClient) + resp, r, err := api.UpdateLLMObsAnnotationQueue(ctx, "queue_id", body) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LLMObservabilityApi.UpdateLLMObsAnnotationQueue`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `LLMObservabilityApi.UpdateLLMObsAnnotationQueue`:\n%s\n", responseContent) +} diff --git a/tests/scenarios/features/v2/llm_observability.feature b/tests/scenarios/features/v2/llm_observability.feature index f1a56f818da..a3906289988 100644 --- a/tests/scenarios/features/v2/llm_observability.feature +++ b/tests/scenarios/features/v2/llm_observability.feature @@ -1,13 +1,40 @@ @endpoint(llm-observability) @endpoint(llm-observability-v2) Feature: LLM Observability - Manage LLM Observability projects, datasets, dataset records, and - experiments via the Experiments API. + Manage LLM Observability projects, datasets, dataset records, experiments, + and annotations. Background: Given a valid "apiKeyAuth" key in the system And a valid "appKeyAuth" key in the system And an instance of "LLMObservability" API + @generated @skip @team:DataDog/ml-observability + Scenario: Add annotation queue interactions returns "Bad Request" response + Given operation "CreateLLMObsAnnotationQueueInteractions" enabled + And new "CreateLLMObsAnnotationQueueInteractions" request + And request contains "queue_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"interactions": [{"content_id": "trace-abc-123", "type": "trace"}]}, "type": "interactions"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/ml-observability + Scenario: Add annotation queue interactions returns "Created" response + Given operation "CreateLLMObsAnnotationQueueInteractions" enabled + And new "CreateLLMObsAnnotationQueueInteractions" request + And request contains "queue_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"interactions": [{"content_id": "trace-abc-123", "type": "trace"}]}, "type": "interactions"}} + When the request is sent + Then the response status is 201 Created + + @generated @skip @team:DataDog/ml-observability + Scenario: Add annotation queue interactions returns "Not Found" response + Given operation "CreateLLMObsAnnotationQueueInteractions" enabled + And new "CreateLLMObsAnnotationQueueInteractions" request + And request contains "queue_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"interactions": [{"content_id": "trace-abc-123", "type": "trace"}]}, "type": "interactions"}} + When the request is sent + Then the response status is 404 Not Found + @generated @skip @team:DataDog/ml-observability Scenario: Append records to an LLM Observability dataset returns "Bad Request" response Given operation "CreateLLMObsDatasetRecords" enabled @@ -48,6 +75,22 @@ Feature: LLM Observability When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/ml-observability + Scenario: Create an LLM Observability annotation queue returns "Bad Request" response + Given operation "CreateLLMObsAnnotationQueue" enabled + And new "CreateLLMObsAnnotationQueue" request + And body with value {"data": {"attributes": {"description": "Queue for annotating customer support traces", "name": "My annotation queue", "project_id": "a33671aa-24fd-4dcd-9b33-a8ec7dde7751"}, "type": "queues"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/ml-observability + Scenario: Create an LLM Observability annotation queue returns "Created" response + Given operation "CreateLLMObsAnnotationQueue" enabled + And new "CreateLLMObsAnnotationQueue" request + And body with value {"data": {"attributes": {"description": "Queue for annotating customer support traces", "name": "My annotation queue", "project_id": "a33671aa-24fd-4dcd-9b33-a8ec7dde7751"}, "type": "queues"}} + When the request is sent + Then the response status is 201 Created + @generated @skip @team:DataDog/ml-observability Scenario: Create an LLM Observability dataset returns "Bad Request" response Given operation "CreateLLMObsDataset" enabled @@ -221,6 +264,87 @@ Feature: LLM Observability When the request is sent Then the response status is 204 No Content + @generated @skip @team:DataDog/ml-observability + Scenario: Delete an LLM Observability annotation queue returns "No Content" response + Given operation "DeleteLLMObsAnnotationQueue" enabled + And new "DeleteLLMObsAnnotationQueue" request + And request contains "queue_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:DataDog/ml-observability + Scenario: Delete an LLM Observability annotation queue returns "Not Found" response + Given operation "DeleteLLMObsAnnotationQueue" enabled + And new "DeleteLLMObsAnnotationQueue" request + And request contains "queue_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/ml-observability + Scenario: Delete annotation queue interactions returns "Bad Request" response + Given operation "DeleteLLMObsAnnotationQueueInteractions" enabled + And new "DeleteLLMObsAnnotationQueueInteractions" request + And request contains "queue_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"interaction_ids": ["00000000-0000-0000-0000-000000000000", "00000000-0000-0000-0000-000000000001"]}, "type": "interactions"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/ml-observability + Scenario: Delete annotation queue interactions returns "No Content" response + Given operation "DeleteLLMObsAnnotationQueueInteractions" enabled + And new "DeleteLLMObsAnnotationQueueInteractions" request + And request contains "queue_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"interaction_ids": ["00000000-0000-0000-0000-000000000000", "00000000-0000-0000-0000-000000000001"]}, "type": "interactions"}} + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:DataDog/ml-observability + Scenario: Delete annotation queue interactions returns "Not Found" response + Given operation "DeleteLLMObsAnnotationQueueInteractions" enabled + And new "DeleteLLMObsAnnotationQueueInteractions" request + And request contains "queue_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"interaction_ids": ["00000000-0000-0000-0000-000000000000", "00000000-0000-0000-0000-000000000001"]}, "type": "interactions"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/ml-observability + Scenario: Get annotated queue interactions returns "Bad Request" response + Given operation "GetLLMObsAnnotatedInteractions" enabled + And new "GetLLMObsAnnotatedInteractions" request + And request contains "queue_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/ml-observability + Scenario: Get annotated queue interactions returns "Not Found" response + Given operation "GetLLMObsAnnotatedInteractions" enabled + And new "GetLLMObsAnnotatedInteractions" request + And request contains "queue_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/ml-observability + Scenario: Get annotated queue interactions returns "OK" response + Given operation "GetLLMObsAnnotatedInteractions" enabled + And new "GetLLMObsAnnotatedInteractions" request + And request contains "queue_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/ml-observability + Scenario: List LLM Observability annotation queues returns "Bad Request" response + Given operation "ListLLMObsAnnotationQueues" enabled + And new "ListLLMObsAnnotationQueues" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/ml-observability + Scenario: List LLM Observability annotation queues returns "OK" response + Given operation "ListLLMObsAnnotationQueues" enabled + And new "ListLLMObsAnnotationQueues" request + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/ml-observability Scenario: List LLM Observability dataset records returns "Bad Request" response Given operation "ListLLMObsDatasetRecords" enabled @@ -357,6 +481,33 @@ Feature: LLM Observability When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/ml-observability + Scenario: Update an LLM Observability annotation queue returns "Bad Request" response + Given operation "UpdateLLMObsAnnotationQueue" enabled + And new "UpdateLLMObsAnnotationQueue" request + And request contains "queue_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"description": "Updated description", "name": "Updated queue name"}, "type": "queues"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/ml-observability + Scenario: Update an LLM Observability annotation queue returns "Not Found" response + Given operation "UpdateLLMObsAnnotationQueue" enabled + And new "UpdateLLMObsAnnotationQueue" request + And request contains "queue_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"description": "Updated description", "name": "Updated queue name"}, "type": "queues"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/ml-observability + Scenario: Update an LLM Observability annotation queue returns "OK" response + Given operation "UpdateLLMObsAnnotationQueue" enabled + And new "UpdateLLMObsAnnotationQueue" request + And request contains "queue_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"description": "Updated description", "name": "Updated queue name"}, "type": "queues"}} + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/ml-observability Scenario: Update an LLM Observability dataset returns "Bad Request" response Given operation "UpdateLLMObsDataset" enabled diff --git a/tests/scenarios/features/v2/undo.json b/tests/scenarios/features/v2/undo.json index 02afc91a4bb..078ced2bd84 100644 --- a/tests/scenarios/features/v2/undo.json +++ b/tests/scenarios/features/v2/undo.json @@ -3087,6 +3087,66 @@ "type": "idempotent" } }, + "ListLLMObsAnnotationQueues": { + "tag": "LLM Observability", + "undo": { + "type": "safe" + } + }, + "CreateLLMObsAnnotationQueue": { + "tag": "LLM Observability", + "undo": { + "operationId": "DeleteLLMObsAnnotationQueue", + "parameters": [ + { + "name": "queue_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "DeleteLLMObsAnnotationQueue": { + "tag": "LLM Observability", + "undo": { + "type": "idempotent" + } + }, + "UpdateLLMObsAnnotationQueue": { + "tag": "LLM Observability", + "undo": { + "type": "idempotent" + } + }, + "GetLLMObsAnnotatedInteractions": { + "tag": "LLM Observability", + "undo": { + "type": "safe" + } + }, + "CreateLLMObsAnnotationQueueInteractions": { + "tag": "LLM Observability", + "undo": { + "operationId": "DeleteLLMObsAnnotationQueueInteractions", + "parameters": [ + { + "name": "queue_id", + "source": "path.queue_id" + }, + { + "name": "body", + "template": "{\"data\": {\"type\": \"interactions\", \"attributes\": {\"interaction_ids\": [\"{{ data.attributes.interactions[0].id }}\"]}}}" + } + ], + "type": "unsafe" + } + }, + "DeleteLLMObsAnnotationQueueInteractions": { + "tag": "LLM Observability", + "undo": { + "type": "idempotent" + } + }, "ListLLMObsExperiments": { "tag": "LLM Observability", "undo": {