Skip to content

Commit 17d1de4

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
and
ci.datadog-api-spec
authored
Add user status to schema and fix escalation policy included (#2362)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent 2f90ee5 commit 17d1de4

9 files changed

+398
-13
lines changed

.apigentools-info

+4-4
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": "2025-05-01 18:50:10.027451",
8-
"spec_repo_commit": "7eb88f6a"
7+
"regenerated": "2025-05-02 04:31:13.587503",
8+
"spec_repo_commit": "272cce39"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-05-01 18:50:10.046435",
13-
"spec_repo_commit": "7eb88f6a"
12+
"regenerated": "2025-05-02 04:31:13.603582",
13+
"spec_repo_commit": "272cce39"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

+53-3
Original file line numberDiff line numberDiff line change
@@ -13547,9 +13547,8 @@ components:
1354713547
oneOf:
1354813548
- $ref: '#/components/schemas/TeamReference'
1354913549
- $ref: '#/components/schemas/EscalationPolicyStep'
13550-
- $ref: '#/components/schemas/UserTarget'
13551-
- $ref: '#/components/schemas/ScheduleTarget'
13552-
- $ref: '#/components/schemas/TeamTarget'
13550+
- $ref: '#/components/schemas/EscalationPolicyUser'
13551+
- $ref: '#/components/schemas/ScheduleData'
1355313552
EscalationPolicyStep:
1355413553
description: Represents a single step in an escalation policy, including its
1355513554
attributes, relationships, and resource type.
@@ -13795,6 +13794,44 @@ components:
1379513794
type: string
1379613795
x-enum-varnames:
1379713796
- POLICIES
13797+
EscalationPolicyUser:
13798+
description: Represents a user object in the context of an escalation policy,
13799+
including their `id`, type, and basic attributes.
13800+
properties:
13801+
attributes:
13802+
$ref: '#/components/schemas/EscalationPolicyUserAttributes'
13803+
id:
13804+
description: The unique user identifier.
13805+
type: string
13806+
type:
13807+
$ref: '#/components/schemas/EscalationPolicyUserType'
13808+
required:
13809+
- type
13810+
type: object
13811+
EscalationPolicyUserAttributes:
13812+
description: Provides basic user information for an escalation policy, including
13813+
a name and email address.
13814+
properties:
13815+
email:
13816+
description: The user's email address.
13817+
13818+
type: string
13819+
name:
13820+
description: The user's name.
13821+
example: Jane Doe
13822+
type: string
13823+
status:
13824+
$ref: '#/components/schemas/UserAttributesStatus'
13825+
type: object
13826+
EscalationPolicyUserType:
13827+
default: users
13828+
description: Users resource type.
13829+
enum:
13830+
- users
13831+
example: users
13832+
type: string
13833+
x-enum-varnames:
13834+
- USERS
1379813835
EscalationTarget:
1379913836
description: Represents an escalation target, which can be a team, user, or
1380013837
schedule.
@@ -31730,6 +31767,8 @@ components:
3173031767
description: The user's name.
3173131768
example: Jane Doe
3173231769
type: string
31770+
status:
31771+
$ref: '#/components/schemas/UserAttributesStatus'
3173331772
type: object
3173431773
ScheduleUserType:
3173531774
default: users
@@ -38564,6 +38603,17 @@ components:
3856438603
description: Whether the user is verified.
3856538604
type: boolean
3856638605
type: object
38606+
UserAttributesStatus:
38607+
description: The user's status.
38608+
enum:
38609+
- active
38610+
- deactivated
38611+
- pending
38612+
type: string
38613+
x-enum-varnames:
38614+
- ACTIVE
38615+
- DEACTIVATED
38616+
- PENDING
3856738617
UserCreateAttributes:
3856838618
description: Attributes of the created user.
3856938619
properties:

lib/datadog_api_client/inflector.rb

+4
Original file line numberDiff line numberDiff line change
@@ -1727,6 +1727,9 @@ def overrides
17271727
"v2.escalation_policy_update_request_data_relationships_teams_data_items" => "EscalationPolicyUpdateRequestDataRelationshipsTeamsDataItems",
17281728
"v2.escalation_policy_update_request_data_relationships_teams_data_items_type" => "EscalationPolicyUpdateRequestDataRelationshipsTeamsDataItemsType",
17291729
"v2.escalation_policy_update_request_data_type" => "EscalationPolicyUpdateRequestDataType",
1730+
"v2.escalation_policy_user" => "EscalationPolicyUser",
1731+
"v2.escalation_policy_user_attributes" => "EscalationPolicyUserAttributes",
1732+
"v2.escalation_policy_user_type" => "EscalationPolicyUserType",
17301733
"v2.escalation_target" => "EscalationTarget",
17311734
"v2.event" => "Event",
17321735
"v2.event_attributes" => "EventAttributes",
@@ -3303,6 +3306,7 @@ def overrides
33033306
"v2.usage_time_series_type" => "UsageTimeSeriesType",
33043307
"v2.user" => "User",
33053308
"v2.user_attributes" => "UserAttributes",
3309+
"v2.user_attributes_status" => "UserAttributesStatus",
33063310
"v2.user_create_attributes" => "UserCreateAttributes",
33073311
"v2.user_create_data" => "UserCreateData",
33083312
"v2.user_create_request" => "UserCreateRequest",

lib/datadog_api_client/v2/models/escalation_policy_included.rb

+2-3
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,8 @@ def openapi_one_of
2828
[
2929
:'TeamReference',
3030
:'EscalationPolicyStep',
31-
:'UserTarget',
32-
:'ScheduleTarget',
33-
:'TeamTarget'
31+
:'EscalationPolicyUser',
32+
:'ScheduleData'
3433
]
3534
end
3635
# Builds the object
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
=begin
2+
#Datadog API V2 Collection
3+
4+
#Collection of all Datadog Public endpoints.
5+
6+
The version of the OpenAPI document: 1.0
7+
8+
Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator
9+
10+
Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
11+
This product includes software developed at Datadog (https://www.datadoghq.com/).
12+
Copyright 2020-Present Datadog, Inc.
13+
14+
=end
15+
16+
require 'date'
17+
require 'time'
18+
19+
module DatadogAPIClient::V2
20+
# Represents a user object in the context of an escalation policy, including their `id`, type, and basic attributes.
21+
class EscalationPolicyUser
22+
include BaseGenericModel
23+
24+
# Provides basic user information for an escalation policy, including a name and email address.
25+
attr_accessor :attributes
26+
27+
# The unique user identifier.
28+
attr_accessor :id
29+
30+
# Users resource type.
31+
attr_reader :type
32+
33+
attr_accessor :additional_properties
34+
35+
# Attribute mapping from ruby-style variable name to JSON key.
36+
# @!visibility private
37+
def self.attribute_map
38+
{
39+
:'attributes' => :'attributes',
40+
:'id' => :'id',
41+
:'type' => :'type'
42+
}
43+
end
44+
45+
# Attribute type mapping.
46+
# @!visibility private
47+
def self.openapi_types
48+
{
49+
:'attributes' => :'EscalationPolicyUserAttributes',
50+
:'id' => :'String',
51+
:'type' => :'EscalationPolicyUserType'
52+
}
53+
end
54+
55+
# Initializes the object
56+
# @param attributes [Hash] Model attributes in the form of hash
57+
# @!visibility private
58+
def initialize(attributes = {})
59+
if (!attributes.is_a?(Hash))
60+
fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::EscalationPolicyUser` initialize method"
61+
end
62+
63+
self.additional_properties = {}
64+
# check to see if the attribute exists and convert string to symbol for hash key
65+
attributes = attributes.each_with_object({}) { |(k, v), h|
66+
if (!self.class.attribute_map.key?(k.to_sym))
67+
self.additional_properties[k.to_sym] = v
68+
else
69+
h[k.to_sym] = v
70+
end
71+
}
72+
73+
if attributes.key?(:'attributes')
74+
self.attributes = attributes[:'attributes']
75+
end
76+
77+
if attributes.key?(:'id')
78+
self.id = attributes[:'id']
79+
end
80+
81+
if attributes.key?(:'type')
82+
self.type = attributes[:'type']
83+
end
84+
end
85+
86+
# Check to see if the all the properties in the model are valid
87+
# @return true if the model is valid
88+
# @!visibility private
89+
def valid?
90+
return false if @type.nil?
91+
true
92+
end
93+
94+
# Custom attribute writer method with validation
95+
# @param type [Object] Object to be assigned
96+
# @!visibility private
97+
def type=(type)
98+
if type.nil?
99+
fail ArgumentError, 'invalid value for "type", type cannot be nil.'
100+
end
101+
@type = type
102+
end
103+
104+
# Returns the object in the form of hash, with additionalProperties support.
105+
# @return [Hash] Returns the object in the form of hash
106+
# @!visibility private
107+
def to_hash
108+
hash = {}
109+
self.class.attribute_map.each_pair do |attr, param|
110+
value = self.send(attr)
111+
if value.nil?
112+
is_nullable = self.class.openapi_nullable.include?(attr)
113+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
114+
end
115+
116+
hash[param] = _to_hash(value)
117+
end
118+
self.additional_properties.each_pair do |attr, value|
119+
hash[attr] = value
120+
end
121+
hash
122+
end
123+
124+
# Checks equality by comparing each attribute.
125+
# @param o [Object] Object to be compared
126+
# @!visibility private
127+
def ==(o)
128+
return true if self.equal?(o)
129+
self.class == o.class &&
130+
attributes == o.attributes &&
131+
id == o.id &&
132+
type == o.type &&
133+
additional_properties == o.additional_properties
134+
end
135+
136+
# Calculates hash code according to all attributes.
137+
# @return [Integer] Hash code
138+
# @!visibility private
139+
def hash
140+
[attributes, id, type, additional_properties].hash
141+
end
142+
end
143+
end

0 commit comments

Comments
 (0)