Skip to content

Commit 7379379

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 1fe3e9c6 of spec repo
1 parent 357841c commit 7379379

23 files changed

+3108
-12
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2024-10-31 16:41:33.862946",
8-
"spec_repo_commit": "63c441b2"
7+
"regenerated": "2024-11-01 15:02:39.354825",
8+
"spec_repo_commit": "1fe3e9c6"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-10-31 16:41:33.881242",
13-
"spec_repo_commit": "63c441b2"
12+
"regenerated": "2024-11-01 15:02:39.373632",
13+
"spec_repo_commit": "1fe3e9c6"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 273 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3997,6 +3997,241 @@ components:
39973997
format: int64
39983998
type: integer
39993999
type: object
4000+
ChangeEvent:
4001+
description: Event attributes.
4002+
properties:
4003+
aggregation_key:
4004+
description: An arbitrary string to use for aggregation when correlating
4005+
events. Limited to 100 characters.
4006+
maxLength: 100
4007+
type: string
4008+
attributes:
4009+
$ref: '#/components/schemas/ChangeEventCustomAttributes'
4010+
category:
4011+
$ref: '#/components/schemas/ChangeEventCategory'
4012+
message:
4013+
description: The body of the event. Limited to 4000 characters.
4014+
example: payment_processed feature flag has been enabled
4015+
maxLength: 4000
4016+
type: string
4017+
tags:
4018+
description: 'A list of tags to apply to the event.
4019+
4020+
Refer to [Tags docs](https://docs.datadoghq.com/getting_started/tagging/).'
4021+
example:
4022+
- environment:test
4023+
items:
4024+
description: A tag.
4025+
type: string
4026+
type: array
4027+
timestamp:
4028+
description: 'Timestamp when the event occurred. Must follow [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html)
4029+
format.
4030+
4031+
For example `"2017-01-15T01:30:15.010000Z"`.
4032+
4033+
Defaults to the timestamp of receipt. Limited to values no older than
4034+
18 hours.'
4035+
type: string
4036+
title:
4037+
description: The event title. Limited to 500 characters.
4038+
example: payment_processed feature flag updated
4039+
maxLength: 500
4040+
type: string
4041+
required:
4042+
- title
4043+
- category
4044+
- attributes
4045+
type: object
4046+
ChangeEventCategory:
4047+
description: Event category to identify the type of event. Only the value `change`
4048+
is supported.
4049+
enum:
4050+
- change
4051+
example: change
4052+
type: string
4053+
x-enum-varnames:
4054+
- CHANGE
4055+
ChangeEventCreateRequest:
4056+
description: Object representing an event.
4057+
properties:
4058+
attributes:
4059+
$ref: '#/components/schemas/ChangeEvent'
4060+
type:
4061+
$ref: '#/components/schemas/ChangeEventCreateRequestType'
4062+
type: object
4063+
ChangeEventCreateRequestPayload:
4064+
description: Create an event.
4065+
properties:
4066+
data:
4067+
$ref: '#/components/schemas/ChangeEventCreateRequest'
4068+
type: object
4069+
ChangeEventCreateRequestType:
4070+
description: Entity type.
4071+
enum:
4072+
- event
4073+
example: event
4074+
type: string
4075+
x-enum-varnames:
4076+
- EVENT
4077+
ChangeEventCreateResponse:
4078+
description: Object containing an event response.
4079+
properties:
4080+
attributes:
4081+
$ref: '#/components/schemas/ChangeEventCreateResponseAttributes'
4082+
type:
4083+
description: Event type
4084+
example: event
4085+
type: string
4086+
type: object
4087+
ChangeEventCreateResponseAttributes:
4088+
description: Event response attributes.
4089+
properties:
4090+
attributes:
4091+
$ref: '#/components/schemas/ChangeEventCreateResponseAttributesAttributes'
4092+
type: object
4093+
ChangeEventCreateResponseAttributesAttributes:
4094+
description: The definition of `ChangeEventCreateResponseAttributesAttributes`
4095+
object.
4096+
properties:
4097+
evt:
4098+
$ref: '#/components/schemas/ChangeEventCreateResponseAttributesAttributesEvt'
4099+
type: object
4100+
ChangeEventCreateResponseAttributesAttributesEvt:
4101+
description: The definition of `ChangeEventCreateResponseAttributesAttributesEvt`
4102+
object.
4103+
properties:
4104+
id:
4105+
description: Event id
4106+
type: string
4107+
type: object
4108+
ChangeEventCreateResponsePayload:
4109+
description: Response containing information about created event.
4110+
properties:
4111+
data:
4112+
$ref: '#/components/schemas/ChangeEventCreateResponse'
4113+
type: object
4114+
ChangeEventCustomAttributes:
4115+
description: Object representing custom event attributes.
4116+
properties:
4117+
author:
4118+
$ref: '#/components/schemas/ChangeEventCustomAttributesAuthor'
4119+
change_metadata:
4120+
additionalProperties: {}
4121+
description: Free form object with information related to the `change` event.
4122+
Can be arbitrarily nested and contain any valid JSON.
4123+
example:
4124+
dd:
4125+
team: datadog_team
4126+
user_email: datadog@datadog.com
4127+
user_id: datadog_user_id
4128+
user_name: datadog_username
4129+
resource_link: datadog.com/feature/fallback_payments_test
4130+
type: object
4131+
changed_resource:
4132+
$ref: '#/components/schemas/ChangeEventCustomAttributesChangedResource'
4133+
impacted_resources:
4134+
description: 'A list of resources impacted by this change. It is recommended
4135+
to provide an impacted resource to display
4136+
4137+
the change event at the right location. Only resources of type `service`
4138+
are supported.'
4139+
example:
4140+
- name: payments_api
4141+
type: service
4142+
items:
4143+
$ref: '#/components/schemas/ChangeEventCustomAttributesImpactedResourcesItems'
4144+
type: array
4145+
new_value:
4146+
additionalProperties: {}
4147+
description: Free form object to track new value of the changed resource.
4148+
example:
4149+
enabled: true
4150+
percentage: 50%
4151+
rule:
4152+
datacenter: devcycle.us1.prod
4153+
type: object
4154+
prev_value:
4155+
additionalProperties: {}
4156+
description: Free form object to track previous value of the changed resource.
4157+
example:
4158+
enabled: true
4159+
percentage: 10%
4160+
rule:
4161+
datacenter: devcycle.us1.prod
4162+
type: object
4163+
required:
4164+
- changed_resource
4165+
type: object
4166+
ChangeEventCustomAttributesAuthor:
4167+
description: Object representing the entity which made the change. Optional
4168+
field but if provided should include `type` and `name`.
4169+
properties:
4170+
name:
4171+
description: Author's name. Limited to 128 characters.
4172+
example: datadog@datadog.com
4173+
maxLength: 128
4174+
type: string
4175+
type:
4176+
$ref: '#/components/schemas/ChangeEventCustomAttributesAuthorType'
4177+
required:
4178+
- name
4179+
- type
4180+
type: object
4181+
ChangeEventCustomAttributesAuthorType:
4182+
description: Author's type.
4183+
enum:
4184+
- user
4185+
- system
4186+
example: user
4187+
type: string
4188+
x-enum-varnames:
4189+
- USER
4190+
- SYSTEM
4191+
ChangeEventCustomAttributesChangedResource:
4192+
description: Object representing a uniquely identified resource. Only the resource
4193+
type `feature_flag` is supported.
4194+
properties:
4195+
name:
4196+
description: Resource's name.
4197+
example: fallback_payments_test
4198+
type: string
4199+
type:
4200+
$ref: '#/components/schemas/ChangeEventCustomAttributesChangedResourceType'
4201+
required:
4202+
- type
4203+
- name
4204+
type: object
4205+
ChangeEventCustomAttributesChangedResourceType:
4206+
description: Resource's type.
4207+
enum:
4208+
- feature_flag
4209+
example: feature_flag
4210+
type: string
4211+
x-enum-varnames:
4212+
- FEATURE_FLAG
4213+
ChangeEventCustomAttributesImpactedResourcesItems:
4214+
description: Object representing a uniquely identified resource. Only the resource
4215+
type `service` is supported.
4216+
properties:
4217+
name:
4218+
description: Resource's name.
4219+
example: payments_api
4220+
type: string
4221+
type:
4222+
$ref: '#/components/schemas/ChangeEventCustomAttributesImpactedResourcesItemsType'
4223+
required:
4224+
- type
4225+
- name
4226+
type: object
4227+
ChangeEventCustomAttributesImpactedResourcesItemsType:
4228+
description: Resource's type.
4229+
enum:
4230+
- service
4231+
example: service
4232+
type: string
4233+
x-enum-varnames:
4234+
- SERVICE
40004235
ChargebackBreakdown:
40014236
description: Charges breakdown.
40024237
properties:
@@ -30287,6 +30522,44 @@ paths:
3028730522
operator: OR
3028830523
permissions:
3028930524
- events_read
30525+
post:
30526+
description: This endpoint allows you to post events. Only events with `change`
30527+
category are under General Availability.
30528+
operationId: CreateEvent
30529+
requestBody:
30530+
content:
30531+
application/json:
30532+
schema:
30533+
$ref: '#/components/schemas/ChangeEventCreateRequestPayload'
30534+
description: Event request object
30535+
required: true
30536+
responses:
30537+
'200':
30538+
content:
30539+
application/json:
30540+
schema:
30541+
$ref: '#/components/schemas/ChangeEventCreateResponsePayload'
30542+
description: OK
30543+
'400':
30544+
content:
30545+
application/json:
30546+
schema:
30547+
$ref: '#/components/schemas/JSONAPIErrorResponse'
30548+
description: Bad request
30549+
'403':
30550+
content:
30551+
application/json:
30552+
schema:
30553+
$ref: '#/components/schemas/JSONAPIErrorResponse'
30554+
description: Forbidden
30555+
'429':
30556+
$ref: '#/components/responses/TooManyRequestsResponse'
30557+
security:
30558+
- apiKeyAuth: []
30559+
summary: Post a change event
30560+
tags:
30561+
- Events
30562+
x-codegen-request-body-name: body
3029030563
/api/v2/events/search:
3029130564
post:
3029230565
description: 'List endpoint returns events that match an events search query.
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
// Post a change event returns "OK" response
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v2.api.EventsApi;
6+
import com.datadog.api.client.v2.model.ChangeEvent;
7+
import com.datadog.api.client.v2.model.ChangeEventCategory;
8+
import com.datadog.api.client.v2.model.ChangeEventCreateRequest;
9+
import com.datadog.api.client.v2.model.ChangeEventCreateRequestPayload;
10+
import com.datadog.api.client.v2.model.ChangeEventCreateRequestType;
11+
import com.datadog.api.client.v2.model.ChangeEventCreateResponsePayload;
12+
import com.datadog.api.client.v2.model.ChangeEventCustomAttributes;
13+
import com.datadog.api.client.v2.model.ChangeEventCustomAttributesAuthor;
14+
import com.datadog.api.client.v2.model.ChangeEventCustomAttributesAuthorType;
15+
import com.datadog.api.client.v2.model.ChangeEventCustomAttributesChangedResource;
16+
import com.datadog.api.client.v2.model.ChangeEventCustomAttributesChangedResourceType;
17+
import com.datadog.api.client.v2.model.ChangeEventCustomAttributesImpactedResourcesItems;
18+
import com.datadog.api.client.v2.model.ChangeEventCustomAttributesImpactedResourcesItemsType;
19+
import java.util.Collections;
20+
import java.util.Map;
21+
22+
public class Example {
23+
public static void main(String[] args) {
24+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
25+
EventsApi apiInstance = new EventsApi(defaultClient);
26+
27+
ChangeEventCreateRequestPayload body =
28+
new ChangeEventCreateRequestPayload()
29+
.data(
30+
new ChangeEventCreateRequest()
31+
.attributes(
32+
new ChangeEvent()
33+
.attributes(
34+
new ChangeEventCustomAttributes()
35+
.author(
36+
new ChangeEventCustomAttributesAuthor()
37+
.name("datadog@datadog.com")
38+
.type(ChangeEventCustomAttributesAuthorType.USER))
39+
.changeMetadata(
40+
Map.ofEntries(
41+
Map.entry(
42+
"dd",
43+
"{'team': 'datadog_team', 'user_email':"
44+
+ " 'datadog@datadog.com', 'user_id':"
45+
+ " 'datadog_user_id', 'user_name':"
46+
+ " 'datadog_username'}"),
47+
Map.entry(
48+
"resource_link",
49+
"datadog.com/feature/fallback_payments_test")))
50+
.changedResource(
51+
new ChangeEventCustomAttributesChangedResource()
52+
.name("fallback_payments_test")
53+
.type(
54+
ChangeEventCustomAttributesChangedResourceType
55+
.FEATURE_FLAG))
56+
.impactedResources(
57+
Collections.singletonList(
58+
new ChangeEventCustomAttributesImpactedResourcesItems()
59+
.name("payments_api")
60+
.type(
61+
ChangeEventCustomAttributesImpactedResourcesItemsType
62+
.SERVICE)))
63+
.newValue(
64+
Map.ofEntries(
65+
Map.entry("enabled", "True"),
66+
Map.entry("percentage", "50%"),
67+
Map.entry(
68+
"rule", "{'datacenter': 'devcycle.us1.prod'}")))
69+
.prevValue(
70+
Map.ofEntries(
71+
Map.entry("enabled", "True"),
72+
Map.entry("percentage", "10%"),
73+
Map.entry(
74+
"rule", "{'datacenter': 'devcycle.us1.prod'}"))))
75+
.category(ChangeEventCategory.CHANGE)
76+
.message("payment_processed feature flag has been enabled")
77+
.tags(Collections.singletonList("environment:test"))
78+
.title("payment_processed feature flag updated"))
79+
.type(ChangeEventCreateRequestType.EVENT));
80+
81+
try {
82+
ChangeEventCreateResponsePayload result = apiInstance.createEvent(body);
83+
System.out.println(result);
84+
} catch (ApiException e) {
85+
System.err.println("Exception when calling EventsApi#createEvent");
86+
System.err.println("Status code: " + e.getCode());
87+
System.err.println("Reason: " + e.getResponseBody());
88+
System.err.println("Response headers: " + e.getResponseHeaders());
89+
e.printStackTrace();
90+
}
91+
}
92+
}

0 commit comments

Comments
 (0)