Skip to content

Commit 91dbf0c

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 1998a4d of spec repo
1 parent 7abcc07 commit 91dbf0c

19 files changed

+1803
-0
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 332 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41237,6 +41237,114 @@ components:
4123741237
type: string
4123841238
x-enum-varnames:
4123941239
- PROCESS
41240+
ProductAnalyticsServerSideEventError:
41241+
description: Error details.
41242+
properties:
41243+
detail:
41244+
description: Error message.
41245+
example: Malformed payload
41246+
type: string
41247+
status:
41248+
description: Error code.
41249+
example: '400'
41250+
type: string
41251+
title:
41252+
description: Error title.
41253+
example: Bad Request
41254+
type: string
41255+
type: object
41256+
ProductAnalyticsServerSideEventErrors:
41257+
description: Error response.
41258+
properties:
41259+
errors:
41260+
description: Structured errors.
41261+
items:
41262+
$ref: '#/components/schemas/ProductAnalyticsServerSideEventError'
41263+
type: array
41264+
type: object
41265+
ProductAnalyticsServerSideEventItem:
41266+
description: A Product Analytics server-side event.
41267+
properties:
41268+
account:
41269+
$ref: '#/components/schemas/ProductAnalyticsServerSideEventItemAccount'
41270+
application:
41271+
$ref: '#/components/schemas/ProductAnalyticsServerSideEventItemApplication'
41272+
event:
41273+
$ref: '#/components/schemas/ProductAnalyticsServerSideEventItemEvent'
41274+
session:
41275+
$ref: '#/components/schemas/ProductAnalyticsServerSideEventItemSession'
41276+
type:
41277+
$ref: '#/components/schemas/ProductAnalyticsServerSideEventItemType'
41278+
usr:
41279+
$ref: '#/components/schemas/ProductAnalyticsServerSideEventItemUsr'
41280+
required:
41281+
- application
41282+
- event
41283+
- type
41284+
type: object
41285+
ProductAnalyticsServerSideEventItemAccount:
41286+
description: The account linked to your event.
41287+
properties:
41288+
id:
41289+
description: The account ID used in Datadog.
41290+
example: account-67890
41291+
type: string
41292+
required:
41293+
- id
41294+
type: object
41295+
ProductAnalyticsServerSideEventItemApplication:
41296+
description: The application in which you want to send your events.
41297+
properties:
41298+
id:
41299+
description: 'The application ID of your application. It can be found in
41300+
your
41301+
41302+
[application management page](https://app.datadoghq.com/rum/list).'
41303+
example: 123abcde-123a-123b-1234-123456789abc
41304+
type: string
41305+
required:
41306+
- id
41307+
type: object
41308+
ProductAnalyticsServerSideEventItemEvent:
41309+
description: Fields used for the event.
41310+
properties:
41311+
name:
41312+
description: The name of your event, which is used for search in the same
41313+
way as view or action names.
41314+
example: payment.processed
41315+
type: string
41316+
required:
41317+
- name
41318+
type: object
41319+
ProductAnalyticsServerSideEventItemSession:
41320+
description: The session linked to your event.
41321+
properties:
41322+
id:
41323+
description: The session ID captured by the SDK.
41324+
example: session-abcdef
41325+
type: string
41326+
required:
41327+
- id
41328+
type: object
41329+
ProductAnalyticsServerSideEventItemType:
41330+
description: The type of Product Analytics event. Must be `server` for server-side
41331+
events.
41332+
enum:
41333+
- server
41334+
example: server
41335+
type: string
41336+
x-enum-varnames:
41337+
- SERVER
41338+
ProductAnalyticsServerSideEventItemUsr:
41339+
description: The user linked to your event.
41340+
properties:
41341+
id:
41342+
description: The user ID used in Datadog.
41343+
example: user-12345
41344+
type: string
41345+
required:
41346+
- id
41347+
type: object
4124041348
Project:
4124141349
description: A Project
4124241350
properties:
@@ -78009,6 +78117,218 @@ paths:
7800978117
x-permission:
7801078118
operator: OPEN
7801178119
permissions: []
78120+
/api/v2/prodlytics:
78121+
post:
78122+
description: 'Send server-side events to Product Analytics. Server-side events
78123+
are retained for 15 months.
78124+
78125+
78126+
Server-Side events in Product Analytics are helpful for tracking events that
78127+
occur on the server,
78128+
78129+
as opposed to client-side events, which are captured by Real User Monitoring
78130+
(RUM) SDKs.
78131+
78132+
This allows for a more comprehensive view of the user journey by including
78133+
actions that happen on the server.
78134+
78135+
Typical examples could be `checkout.completed` or `payment.processed`.
78136+
78137+
78138+
Ingested server-side events are integrated into Product Analytics to allow
78139+
users to select and filter
78140+
78141+
these events in the event picker, similar to how views or actions are handled.
78142+
78143+
78144+
**Requirements:**
78145+
78146+
- At least one of `usr`, `account`, or `session` must be provided with a valid
78147+
ID.
78148+
78149+
- The `application.id` must reference a Product Analytics-enabled application.
78150+
78151+
78152+
**Custom Attributes:**
78153+
78154+
Any additional fields in the payload are flattened and searchable as facets.
78155+
78156+
For example, a payload with `{"customer": {"tier": "premium"}}` is searchable
78157+
with
78158+
78159+
the syntax `@customer.tier:premium` in Datadog.
78160+
78161+
78162+
The status codes answered by the HTTP API are:
78163+
78164+
- 202: Accepted: The request has been accepted for processing
78165+
78166+
- 400: Bad request (likely an issue in the payload formatting)
78167+
78168+
- 401: Unauthorized (likely a missing API Key)
78169+
78170+
- 403: Permission issue (likely using an invalid API Key)
78171+
78172+
- 408: Request Timeout, request should be retried after some time
78173+
78174+
- 413: Payload too large (batch is above 5MB uncompressed)
78175+
78176+
- 429: Too Many Requests, request should be retried after some time
78177+
78178+
- 500: Internal Server Error, the server encountered an unexpected condition
78179+
that prevented it from fulfilling the request, request should be retried after
78180+
some time
78181+
78182+
- 503: Service Unavailable, the server is not ready to handle the request
78183+
probably because it is overloaded, request should be retried after some time'
78184+
operationId: SubmitProductAnalyticsEvent
78185+
requestBody:
78186+
content:
78187+
application/json:
78188+
examples:
78189+
event-with-account:
78190+
description: Send a server-side event linked to an account.
78191+
summary: Event with account ID
78192+
value:
78193+
account:
78194+
id: account-456
78195+
application:
78196+
id: 123abcde-123a-123b-1234-123456789abc
78197+
event:
78198+
name: checkout.completed
78199+
type: server
78200+
event-with-custom-attributes:
78201+
description: Send a server-side event with additional custom attributes.
78202+
summary: Event with custom attributes
78203+
value:
78204+
application:
78205+
id: 123abcde-123a-123b-1234-123456789abc
78206+
customer:
78207+
tier: premium
78208+
event:
78209+
name: payment.processed
78210+
type: server
78211+
usr:
78212+
id: '123'
78213+
event-with-session:
78214+
description: Send a server-side event linked to a session.
78215+
summary: Event with session ID
78216+
value:
78217+
application:
78218+
id: 123abcde-123a-123b-1234-123456789abc
78219+
event:
78220+
name: form.submitted
78221+
session:
78222+
id: session-789
78223+
type: server
78224+
simple-event-with-user:
78225+
description: Send a server-side event linked to a user.
78226+
summary: Simple event with user ID
78227+
value:
78228+
application:
78229+
id: 123abcde-123a-123b-1234-123456789abc
78230+
event:
78231+
name: payment.processed
78232+
type: server
78233+
usr:
78234+
id: '123'
78235+
schema:
78236+
$ref: '#/components/schemas/ProductAnalyticsServerSideEventItem'
78237+
description: Server-side event to send (JSON format).
78238+
required: true
78239+
responses:
78240+
'202':
78241+
content:
78242+
application/json:
78243+
schema:
78244+
type: object
78245+
description: Request accepted for processing (always 202 empty JSON).
78246+
'400':
78247+
content:
78248+
application/json:
78249+
schema:
78250+
$ref: '#/components/schemas/ProductAnalyticsServerSideEventErrors'
78251+
description: Bad Request
78252+
'401':
78253+
content:
78254+
application/json:
78255+
schema:
78256+
$ref: '#/components/schemas/ProductAnalyticsServerSideEventErrors'
78257+
description: Unauthorized
78258+
'403':
78259+
content:
78260+
application/json:
78261+
schema:
78262+
$ref: '#/components/schemas/ProductAnalyticsServerSideEventErrors'
78263+
description: Forbidden
78264+
'408':
78265+
content:
78266+
application/json:
78267+
schema:
78268+
$ref: '#/components/schemas/ProductAnalyticsServerSideEventErrors'
78269+
description: Request Timeout
78270+
'413':
78271+
content:
78272+
application/json:
78273+
schema:
78274+
$ref: '#/components/schemas/ProductAnalyticsServerSideEventErrors'
78275+
description: Payload Too Large
78276+
'429':
78277+
content:
78278+
application/json:
78279+
schema:
78280+
$ref: '#/components/schemas/ProductAnalyticsServerSideEventErrors'
78281+
description: Too Many Requests
78282+
'500':
78283+
content:
78284+
application/json:
78285+
schema:
78286+
$ref: '#/components/schemas/ProductAnalyticsServerSideEventErrors'
78287+
description: Internal Server Error
78288+
'503':
78289+
content:
78290+
application/json:
78291+
schema:
78292+
$ref: '#/components/schemas/ProductAnalyticsServerSideEventErrors'
78293+
description: Service Unavailable
78294+
security:
78295+
- apiKeyAuth: []
78296+
servers:
78297+
- url: https://{subdomain}.{site}
78298+
variables:
78299+
site:
78300+
default: datadoghq.com
78301+
description: The regional site for customers.
78302+
enum:
78303+
- datadoghq.com
78304+
- us3.datadoghq.com
78305+
- us5.datadoghq.com
78306+
- ap1.datadoghq.com
78307+
- ap2.datadoghq.com
78308+
- datadoghq.eu
78309+
subdomain:
78310+
default: browser-intake
78311+
description: The subdomain where the API is deployed.
78312+
- url: '{protocol}://{name}'
78313+
variables:
78314+
name:
78315+
default: browser-intake-datadoghq.com
78316+
description: Full site DNS name.
78317+
protocol:
78318+
default: https
78319+
description: The protocol for accessing the API.
78320+
- url: https://{subdomain}.{site}
78321+
variables:
78322+
site:
78323+
default: datadoghq.com
78324+
description: Any Datadog deployment.
78325+
subdomain:
78326+
default: browser-intake
78327+
description: The subdomain where the API is deployed.
78328+
summary: Send server-side events
78329+
tags:
78330+
- Product Analytics
78331+
x-codegen-request-body-name: body
7801278332
/api/v2/product-analytics/accounts/facet_info:
7801378333
post:
7801478334
description: Get facet information for account attributes including possible
@@ -90205,6 +90525,18 @@ tags:
9020590525
See the [Live Processes page](https://docs.datadoghq.com/infrastructure/process/)
9020690526
for more information.
9020790527
name: Processes
90528+
- description: 'Send server-side events to Product Analytics. Server-Side Events Ingestion
90529+
allows you to collect custom events
90530+
90531+
from any server-side source, and retains events for 15 months. Server-side events
90532+
are helpful for understanding
90533+
90534+
causes of a funnel drop-off which are external to the client-side (for example,
90535+
payment processing error).
90536+
90537+
See the [Product Analytics page](https://docs.datadoghq.com/product_analytics/)
90538+
for more information.'
90539+
name: Product Analytics
9020890540
- description: Manage your Real User Monitoring (RUM) applications, and search or
9020990541
aggregate your RUM events over HTTP. See the [RUM & Session Replay page](https://docs.datadoghq.com/real_user_monitoring/)
9021090542
for more information
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// Send server-side events returns "Request accepted for processing (always 202
2+
// empty JSON)." response
3+
use datadog_api_client::datadog;
4+
use datadog_api_client::datadogV2::api_product_analytics::ProductAnalyticsAPI;
5+
use datadog_api_client::datadogV2::model::ProductAnalyticsServerSideEventItem;
6+
use datadog_api_client::datadogV2::model::ProductAnalyticsServerSideEventItemAccount;
7+
use datadog_api_client::datadogV2::model::ProductAnalyticsServerSideEventItemApplication;
8+
use datadog_api_client::datadogV2::model::ProductAnalyticsServerSideEventItemEvent;
9+
use datadog_api_client::datadogV2::model::ProductAnalyticsServerSideEventItemSession;
10+
use datadog_api_client::datadogV2::model::ProductAnalyticsServerSideEventItemType;
11+
use datadog_api_client::datadogV2::model::ProductAnalyticsServerSideEventItemUsr;
12+
13+
#[tokio::main]
14+
async fn main() {
15+
let body = ProductAnalyticsServerSideEventItem::new(
16+
ProductAnalyticsServerSideEventItemApplication::new(
17+
"123abcde-123a-123b-1234-123456789abc".to_string(),
18+
),
19+
ProductAnalyticsServerSideEventItemEvent::new("payment.processed".to_string()),
20+
ProductAnalyticsServerSideEventItemType::SERVER,
21+
)
22+
.account(ProductAnalyticsServerSideEventItemAccount::new(
23+
"account-67890".to_string(),
24+
))
25+
.session(ProductAnalyticsServerSideEventItemSession::new(
26+
"session-abcdef".to_string(),
27+
))
28+
.usr(ProductAnalyticsServerSideEventItemUsr::new(
29+
"user-12345".to_string(),
30+
));
31+
let configuration = datadog::Configuration::new();
32+
let api = ProductAnalyticsAPI::with_config(configuration);
33+
let resp = api.submit_product_analytics_event(body).await;
34+
if let Ok(value) = resp {
35+
println!("{:#?}", value);
36+
} else {
37+
println!("{:#?}", resp.unwrap_err());
38+
}
39+
}

0 commit comments

Comments
 (0)