Skip to content

Commit d59967f

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit a6640b21 of spec repo
1 parent fe66ded commit d59967f

25 files changed

+2176
-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-30 18:58:10.241853",
8-
"spec_repo_commit": "755120dd"
7+
"regenerated": "2024-10-31 11:33:44.057335",
8+
"spec_repo_commit": "a6640b21"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-10-30 18:58:10.260831",
13-
"spec_repo_commit": "755120dd"
12+
"regenerated": "2024-10-31 11:33:44.075920",
13+
"spec_repo_commit": "a6640b21"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 273 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3965,6 +3965,241 @@ components:
39653965
format: int64
39663966
type: integer
39673967
type: object
3968+
ChangeEvent:
3969+
description: Event attributes.
3970+
properties:
3971+
aggregation_key:
3972+
description: An arbitrary string to use for aggregation when correlating
3973+
events. Limited to 100 characters.
3974+
maxLength: 100
3975+
type: string
3976+
attributes:
3977+
$ref: '#/components/schemas/ChangeEventCustomAttributes'
3978+
category:
3979+
$ref: '#/components/schemas/ChangeEventCategory'
3980+
message:
3981+
description: The body of the event. Limited to 4000 characters.
3982+
example: payment_processed feature flag has been enabled
3983+
maxLength: 4000
3984+
type: string
3985+
tags:
3986+
description: 'A list of tags to apply to the event.
3987+
3988+
Refer to [Tags docs](https://docs.datadoghq.com/getting_started/tagging/).'
3989+
example:
3990+
- environment:test
3991+
items:
3992+
description: A tag.
3993+
type: string
3994+
type: array
3995+
timestamp:
3996+
description: 'Timestamp when the event occurred. Must follow [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html)
3997+
format.
3998+
3999+
For example `"2017-01-15T01:30:15.010000Z"`.
4000+
4001+
Defaults to the timestamp of receipt. Limited to values no older than
4002+
18 hours.'
4003+
type: string
4004+
title:
4005+
description: The event title. Limited to 500 characters.
4006+
example: payment_processed feature flag updated
4007+
maxLength: 500
4008+
type: string
4009+
required:
4010+
- title
4011+
- category
4012+
- attributes
4013+
type: object
4014+
ChangeEventCategory:
4015+
description: Event category to identify the type of event. Only the value `change`
4016+
is supported.
4017+
enum:
4018+
- change
4019+
example: change
4020+
type: string
4021+
x-enum-varnames:
4022+
- CHANGE
4023+
ChangeEventCreateRequest:
4024+
description: Object representing an event.
4025+
properties:
4026+
attributes:
4027+
$ref: '#/components/schemas/ChangeEvent'
4028+
type:
4029+
$ref: '#/components/schemas/ChangeEventCreateRequestType'
4030+
type: object
4031+
ChangeEventCreateRequestPayload:
4032+
description: Create an event.
4033+
properties:
4034+
data:
4035+
$ref: '#/components/schemas/ChangeEventCreateRequest'
4036+
type: object
4037+
ChangeEventCreateRequestType:
4038+
description: Entity type.
4039+
enum:
4040+
- event
4041+
example: event
4042+
type: string
4043+
x-enum-varnames:
4044+
- EVENT
4045+
ChangeEventCreateResponse:
4046+
description: Object containing an event response.
4047+
properties:
4048+
attributes:
4049+
$ref: '#/components/schemas/ChangeEventCreateResponseAttributes'
4050+
type:
4051+
description: Event type
4052+
example: event
4053+
type: string
4054+
type: object
4055+
ChangeEventCreateResponseAttributes:
4056+
description: Event response attributes.
4057+
properties:
4058+
attributes:
4059+
$ref: '#/components/schemas/ChangeEventCreateResponseAttributesAttributes'
4060+
type: object
4061+
ChangeEventCreateResponseAttributesAttributes:
4062+
description: The definition of `ChangeEventCreateResponseAttributesAttributes`
4063+
object.
4064+
properties:
4065+
evt:
4066+
$ref: '#/components/schemas/ChangeEventCreateResponseAttributesAttributesEvt'
4067+
type: object
4068+
ChangeEventCreateResponseAttributesAttributesEvt:
4069+
description: The definition of `ChangeEventCreateResponseAttributesAttributesEvt`
4070+
object.
4071+
properties:
4072+
id:
4073+
description: Event id
4074+
type: string
4075+
type: object
4076+
ChangeEventCreateResponsePayload:
4077+
description: Response containing information about created event.
4078+
properties:
4079+
data:
4080+
$ref: '#/components/schemas/ChangeEventCreateResponse'
4081+
type: object
4082+
ChangeEventCustomAttributes:
4083+
description: Object representing custom event attributes.
4084+
properties:
4085+
author:
4086+
$ref: '#/components/schemas/ChangeEventCustomAttributesAuthor'
4087+
change_metadata:
4088+
additionalProperties: {}
4089+
description: Free form object with information related to the `change` event.
4090+
Can be arbitrarily nested and contain any valid JSON.
4091+
example:
4092+
dd:
4093+
team: datadog_team
4094+
user_email: [email protected]
4095+
user_id: datadog_user_id
4096+
user_name: datadog_username
4097+
resource_link: datadog.com/feature/fallback_payments_test
4098+
type: object
4099+
changed_resource:
4100+
$ref: '#/components/schemas/ChangeEventCustomAttributesChangedResource'
4101+
impacted_resources:
4102+
description: 'A list of resources impacted by this change. It is recommended
4103+
to provide an impacted resource to display
4104+
4105+
the change event at the right location. Only resources of type `service`
4106+
are supported.'
4107+
example:
4108+
- name: payments_api
4109+
type: service
4110+
items:
4111+
$ref: '#/components/schemas/ChangeEventCustomAttributesImpactedResourcesItems'
4112+
type: array
4113+
new_value:
4114+
additionalProperties: {}
4115+
description: Free form object to track new value of the changed resource.
4116+
example:
4117+
enabled: true
4118+
percentage: 50%
4119+
rule:
4120+
datacenter: devcycle.us1.prod
4121+
type: object
4122+
prev_value:
4123+
additionalProperties: {}
4124+
description: Free form object to track previous value of the changed resource.
4125+
example:
4126+
enabled: true
4127+
percentage: 10%
4128+
rule:
4129+
datacenter: devcycle.us1.prod
4130+
type: object
4131+
required:
4132+
- changed_resource
4133+
type: object
4134+
ChangeEventCustomAttributesAuthor:
4135+
description: Object representing the entity which made the change. Optional
4136+
field but if provided should include `type` and `name`.
4137+
properties:
4138+
name:
4139+
description: Author's name. Limited to 128 characters.
4140+
4141+
maxLength: 128
4142+
type: string
4143+
type:
4144+
$ref: '#/components/schemas/ChangeEventCustomAttributesAuthorType'
4145+
required:
4146+
- name
4147+
- type
4148+
type: object
4149+
ChangeEventCustomAttributesAuthorType:
4150+
description: Author's type.
4151+
enum:
4152+
- user
4153+
- system
4154+
example: user
4155+
type: string
4156+
x-enum-varnames:
4157+
- USER
4158+
- SYSTEM
4159+
ChangeEventCustomAttributesChangedResource:
4160+
description: Object representing a uniquely identified resource. Only the resource
4161+
type `feature_flag` is supported.
4162+
properties:
4163+
name:
4164+
description: Resource's name.
4165+
example: fallback_payments_test
4166+
type: string
4167+
type:
4168+
$ref: '#/components/schemas/ChangeEventCustomAttributesChangedResourceType'
4169+
required:
4170+
- type
4171+
- name
4172+
type: object
4173+
ChangeEventCustomAttributesChangedResourceType:
4174+
description: Resource's type.
4175+
enum:
4176+
- feature_flag
4177+
example: feature_flag
4178+
type: string
4179+
x-enum-varnames:
4180+
- FEATURE_FLAG
4181+
ChangeEventCustomAttributesImpactedResourcesItems:
4182+
description: Object representing a uniquely identified resource. Only the resource
4183+
type `service` is supported.
4184+
properties:
4185+
name:
4186+
description: Resource's name.
4187+
example: payments_api
4188+
type: string
4189+
type:
4190+
$ref: '#/components/schemas/ChangeEventCustomAttributesImpactedResourcesItemsType'
4191+
required:
4192+
- type
4193+
- name
4194+
type: object
4195+
ChangeEventCustomAttributesImpactedResourcesItemsType:
4196+
description: Resource's type.
4197+
enum:
4198+
- service
4199+
example: service
4200+
type: string
4201+
x-enum-varnames:
4202+
- SERVICE
39684203
ChargebackBreakdown:
39694204
description: Charges breakdown.
39704205
properties:
@@ -30012,6 +30247,44 @@ paths:
3001230247
operator: OR
3001330248
permissions:
3001430249
- events_read
30250+
post:
30251+
description: This endpoint allows you to post events. Only events with `change`
30252+
category are under General Availability.
30253+
operationId: CreateEvent
30254+
requestBody:
30255+
content:
30256+
application/json:
30257+
schema:
30258+
$ref: '#/components/schemas/ChangeEventCreateRequestPayload'
30259+
description: Event request object
30260+
required: true
30261+
responses:
30262+
'200':
30263+
content:
30264+
application/json:
30265+
schema:
30266+
$ref: '#/components/schemas/ChangeEventCreateResponsePayload'
30267+
description: OK
30268+
'400':
30269+
content:
30270+
application/json:
30271+
schema:
30272+
$ref: '#/components/schemas/JSONAPIErrorResponse'
30273+
description: Bad request
30274+
'403':
30275+
content:
30276+
application/json:
30277+
schema:
30278+
$ref: '#/components/schemas/JSONAPIErrorResponse'
30279+
description: Forbidden
30280+
'429':
30281+
$ref: '#/components/responses/TooManyRequestsResponse'
30282+
security:
30283+
- apiKeyAuth: []
30284+
summary: Post a change event
30285+
tags:
30286+
- Events
30287+
x-codegen-request-body-name: body
3001530288
/api/v2/events/search:
3001630289
post:
3001730290
description: 'List endpoint returns events that match an events search query.

examples/v2/events/CreateEvent.rb

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Post a change event returns "OK" response
2+
3+
require "datadog_api_client"
4+
api_instance = DatadogAPIClient::V2::EventsAPI.new
5+
6+
body = DatadogAPIClient::V2::ChangeEventCreateRequestPayload.new({
7+
data: DatadogAPIClient::V2::ChangeEventCreateRequest.new({
8+
attributes: DatadogAPIClient::V2::ChangeEvent.new({
9+
attributes: DatadogAPIClient::V2::ChangeEventCustomAttributes.new({
10+
author: DatadogAPIClient::V2::ChangeEventCustomAttributesAuthor.new({
11+
12+
type: DatadogAPIClient::V2::ChangeEventCustomAttributesAuthorType::USER,
13+
}),
14+
change_metadata: {
15+
"dd": "{'team': 'datadog_team', 'user_email': '[email protected]', 'user_id': 'datadog_user_id', 'user_name': 'datadog_username'}", "resource_link": "datadog.com/feature/fallback_payments_test",
16+
},
17+
changed_resource: DatadogAPIClient::V2::ChangeEventCustomAttributesChangedResource.new({
18+
name: "fallback_payments_test",
19+
type: DatadogAPIClient::V2::ChangeEventCustomAttributesChangedResourceType::FEATURE_FLAG,
20+
}),
21+
impacted_resources: [
22+
DatadogAPIClient::V2::ChangeEventCustomAttributesImpactedResourcesItems.new({
23+
name: "payments_api",
24+
type: DatadogAPIClient::V2::ChangeEventCustomAttributesImpactedResourcesItemsType::SERVICE,
25+
}),
26+
],
27+
new_value: {
28+
"enabled": "True", "percentage": "50%", "rule": "{'datacenter': 'devcycle.us1.prod'}",
29+
},
30+
prev_value: {
31+
"enabled": "True", "percentage": "10%", "rule": "{'datacenter': 'devcycle.us1.prod'}",
32+
},
33+
}),
34+
category: DatadogAPIClient::V2::ChangeEventCategory::CHANGE,
35+
message: "payment_processed feature flag has been enabled",
36+
tags: [
37+
"environment:test",
38+
],
39+
title: "payment_processed feature flag updated",
40+
}),
41+
type: DatadogAPIClient::V2::ChangeEventCreateRequestType::EVENT,
42+
}),
43+
})
44+
p api_instance.create_event(body)

features/scenarios_model_mapping.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1227,6 +1227,9 @@
12271227
"page_cursor" => "String",
12281228
"page_limit" => "Integer",
12291229
},
1230+
"v2.CreateEvent" => {
1231+
"body" => "ChangeEventCreateRequestPayload",
1232+
},
12301233
"v2.SearchEvents" => {
12311234
"body" => "EventsListRequest",
12321235
},

0 commit comments

Comments
 (0)