Skip to content

Commit 26f3029

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Remove user fields that are unsupported by the Incidents API (#2043)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 61422c9 commit 26f3029

File tree

6 files changed

+317
-6
lines changed

6 files changed

+317
-6
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-02 20:42:53.003450",
8-
"spec_repo_commit": "76b7b19d"
7+
"regenerated": "2024-10-03 13:53:56.145082",
8+
"spec_repo_commit": "2c46d95c"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-10-02 20:42:53.017526",
13-
"spec_repo_commit": "76b7b19d"
12+
"regenerated": "2024-10-03 13:53:56.159367",
13+
"spec_repo_commit": "2c46d95c"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10930,7 +10930,7 @@ components:
1093010930
IncidentResponseIncludedItem:
1093110931
description: An object related to an incident that is included in the response.
1093210932
oneOf:
10933-
- $ref: '#/components/schemas/User'
10933+
- $ref: '#/components/schemas/IncidentUserData'
1093410934
- $ref: '#/components/schemas/IncidentAttachmentData'
1093510935
IncidentResponseMeta:
1093610936
description: The metadata object containing pagination metadata.
@@ -11869,6 +11869,37 @@ components:
1186911869
required:
1187011870
- data
1187111871
type: object
11872+
IncidentUserAttributes:
11873+
description: Attributes of user object returned by the API.
11874+
properties:
11875+
email:
11876+
description: Email of the user.
11877+
type: string
11878+
handle:
11879+
description: Handle of the user.
11880+
type: string
11881+
icon:
11882+
description: URL of the user's icon.
11883+
type: string
11884+
name:
11885+
description: Name of the user.
11886+
nullable: true
11887+
type: string
11888+
uuid:
11889+
description: UUID of the user.
11890+
type: string
11891+
type: object
11892+
IncidentUserData:
11893+
description: User object returned by the API.
11894+
properties:
11895+
attributes:
11896+
$ref: '#/components/schemas/IncidentUserAttributes'
11897+
id:
11898+
description: ID of the user.
11899+
type: string
11900+
type:
11901+
$ref: '#/components/schemas/UsersType'
11902+
type: object
1187211903
IncidentUserDefinedFieldType:
1187311904
description: The incident user defined fields type.
1187411905
enum:

lib/datadog_api_client/inflector.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1591,6 +1591,8 @@ def overrides
15911591
"v2.incident_update_data" => "IncidentUpdateData",
15921592
"v2.incident_update_relationships" => "IncidentUpdateRelationships",
15931593
"v2.incident_update_request" => "IncidentUpdateRequest",
1594+
"v2.incident_user_attributes" => "IncidentUserAttributes",
1595+
"v2.incident_user_data" => "IncidentUserData",
15941596
"v2.incident_user_defined_field_type" => "IncidentUserDefinedFieldType",
15951597
"v2.include_type" => "IncludeType",
15961598
"v2.intake_payload_accepted" => "IntakePayloadAccepted",

lib/datadog_api_client/v2/models/incident_response_included_item.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class << self
2626
# List of class defined in oneOf (OpenAPI v3)
2727
def openapi_one_of
2828
[
29-
:'User',
29+
:'IncidentUserData',
3030
:'IncidentAttachmentData'
3131
]
3232
end
Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
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+
Contact: support@datadoghq.com
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+
# Attributes of user object returned by the API.
21+
class IncidentUserAttributes
22+
include BaseGenericModel
23+
24+
# Email of the user.
25+
attr_accessor :email
26+
27+
# Handle of the user.
28+
attr_accessor :handle
29+
30+
# URL of the user's icon.
31+
attr_accessor :icon
32+
33+
# Name of the user.
34+
attr_accessor :name
35+
36+
# UUID of the user.
37+
attr_accessor :uuid
38+
39+
attr_accessor :additional_properties
40+
41+
# Attribute mapping from ruby-style variable name to JSON key.
42+
# @!visibility private
43+
def self.attribute_map
44+
{
45+
:'email' => :'email',
46+
:'handle' => :'handle',
47+
:'icon' => :'icon',
48+
:'name' => :'name',
49+
:'uuid' => :'uuid'
50+
}
51+
end
52+
53+
# Attribute type mapping.
54+
# @!visibility private
55+
def self.openapi_types
56+
{
57+
:'email' => :'String',
58+
:'handle' => :'String',
59+
:'icon' => :'String',
60+
:'name' => :'String',
61+
:'uuid' => :'String'
62+
}
63+
end
64+
65+
# List of attributes with nullable: true
66+
# @!visibility private
67+
def self.openapi_nullable
68+
Set.new([
69+
:'name',
70+
])
71+
end
72+
73+
# Initializes the object
74+
# @param attributes [Hash] Model attributes in the form of hash
75+
# @!visibility private
76+
def initialize(attributes = {})
77+
if (!attributes.is_a?(Hash))
78+
fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentUserAttributes` initialize method"
79+
end
80+
81+
self.additional_properties = {}
82+
# check to see if the attribute exists and convert string to symbol for hash key
83+
attributes = attributes.each_with_object({}) { |(k, v), h|
84+
if (!self.class.attribute_map.key?(k.to_sym))
85+
self.additional_properties[k.to_sym] = v
86+
else
87+
h[k.to_sym] = v
88+
end
89+
}
90+
91+
if attributes.key?(:'email')
92+
self.email = attributes[:'email']
93+
end
94+
95+
if attributes.key?(:'handle')
96+
self.handle = attributes[:'handle']
97+
end
98+
99+
if attributes.key?(:'icon')
100+
self.icon = attributes[:'icon']
101+
end
102+
103+
if attributes.key?(:'name')
104+
self.name = attributes[:'name']
105+
end
106+
107+
if attributes.key?(:'uuid')
108+
self.uuid = attributes[:'uuid']
109+
end
110+
end
111+
112+
# Returns the object in the form of hash, with additionalProperties support.
113+
# @return [Hash] Returns the object in the form of hash
114+
# @!visibility private
115+
def to_hash
116+
hash = {}
117+
self.class.attribute_map.each_pair do |attr, param|
118+
value = self.send(attr)
119+
if value.nil?
120+
is_nullable = self.class.openapi_nullable.include?(attr)
121+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
122+
end
123+
124+
hash[param] = _to_hash(value)
125+
end
126+
self.additional_properties.each_pair do |attr, value|
127+
hash[attr] = value
128+
end
129+
hash
130+
end
131+
132+
# Checks equality by comparing each attribute.
133+
# @param o [Object] Object to be compared
134+
# @!visibility private
135+
def ==(o)
136+
return true if self.equal?(o)
137+
self.class == o.class &&
138+
email == o.email &&
139+
handle == o.handle &&
140+
icon == o.icon &&
141+
name == o.name &&
142+
uuid == o.uuid
143+
additional_properties == o.additional_properties
144+
end
145+
146+
# Calculates hash code according to all attributes.
147+
# @return [Integer] Hash code
148+
# @!visibility private
149+
def hash
150+
[email, handle, icon, name, uuid].hash
151+
end
152+
end
153+
end
Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
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+
Contact: support@datadoghq.com
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+
# User object returned by the API.
21+
class IncidentUserData
22+
include BaseGenericModel
23+
24+
# Attributes of user object returned by the API.
25+
attr_accessor :attributes
26+
27+
# ID of the user.
28+
attr_accessor :id
29+
30+
# Users resource type.
31+
attr_accessor :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' => :'IncidentUserAttributes',
50+
:'id' => :'String',
51+
:'type' => :'UsersType'
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::IncidentUserData` 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+
# Returns the object in the form of hash, with additionalProperties support.
87+
# @return [Hash] Returns the object in the form of hash
88+
# @!visibility private
89+
def to_hash
90+
hash = {}
91+
self.class.attribute_map.each_pair do |attr, param|
92+
value = self.send(attr)
93+
if value.nil?
94+
is_nullable = self.class.openapi_nullable.include?(attr)
95+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
96+
end
97+
98+
hash[param] = _to_hash(value)
99+
end
100+
self.additional_properties.each_pair do |attr, value|
101+
hash[attr] = value
102+
end
103+
hash
104+
end
105+
106+
# Checks equality by comparing each attribute.
107+
# @param o [Object] Object to be compared
108+
# @!visibility private
109+
def ==(o)
110+
return true if self.equal?(o)
111+
self.class == o.class &&
112+
attributes == o.attributes &&
113+
id == o.id &&
114+
type == o.type
115+
additional_properties == o.additional_properties
116+
end
117+
118+
# Calculates hash code according to all attributes.
119+
# @return [Integer] Hash code
120+
# @!visibility private
121+
def hash
122+
[attributes, id, type].hash
123+
end
124+
end
125+
end

0 commit comments

Comments
 (0)