Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2024-02-21 12:50:37.067303",
"spec_repo_commit": "1ec2d96a"
"regenerated": "2024-02-21 20:20:05.831604",
"spec_repo_commit": "90ae1ed9"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2024-02-21 12:50:37.086034",
"spec_repo_commit": "1ec2d96a"
"regenerated": "2024-02-21 20:20:05.846277",
"spec_repo_commit": "90ae1ed9"
}
}
}
9 changes: 9 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21288,6 +21288,10 @@ components:
required:
- type
type: object
UserTeamIncluded:
description: Included resources related to the team membership
oneOf:
- $ref: '#/components/schemas/User'
UserTeamPermission:
description: A user's permissions for a given team
properties:
Expand Down Expand Up @@ -21342,6 +21346,11 @@ components:
properties:
data:
$ref: '#/components/schemas/UserTeam'
included:
description: Resources related to the team memberships
items:
$ref: '#/components/schemas/UserTeamIncluded'
type: array
type: object
UserTeamRole:
description: The user's role within the team
Expand Down
1 change: 1 addition & 0 deletions lib/datadog_api_client/inflector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2209,6 +2209,7 @@ def overrides
"v2.user_team" => "UserTeam",
"v2.user_team_attributes" => "UserTeamAttributes",
"v2.user_team_create" => "UserTeamCreate",
"v2.user_team_included" => "UserTeamIncluded",
"v2.user_team_permission" => "UserTeamPermission",
"v2.user_team_permission_attributes" => "UserTeamPermissionAttributes",
"v2.user_team_permission_type" => "UserTeamPermissionType",
Expand Down
62 changes: 62 additions & 0 deletions lib/datadog_api_client/v2/models/user_team_included.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
=begin
#Datadog API V2 Collection

#Collection of all Datadog Public endpoints.

The version of the OpenAPI document: 1.0
Contact: support@datadoghq.com
Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator

Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
This product includes software developed at Datadog (https://www.datadoghq.com/).
Copyright 2020-Present Datadog, Inc.

=end

require 'date'
require 'time'

module DatadogAPIClient::V2
# Included resources related to the team membership
module UserTeamIncluded
class << self
include BaseOneOfModel
include BaseOneOfModelNoDiscriminator

# List of class defined in oneOf (OpenAPI v3)
def openapi_one_of
[
:'User'
]
end
# Builds the object
# @param data [Mixed] Data to be matched against the list of oneOf items
# @return [Object] Returns the model or the data itself
def build(data)
# Go through the list of oneOf items and attempt to identify the appropriate one.
# Note:
# - We do not attempt to check whether exactly one item matches.
# - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
# due to the way the deserialization is made in the base_object template (it just casts without verifying).
# - TODO: scalar values are de facto behaving as if they were nullable.
# - TODO: logging when debugging is set.
openapi_one_of.each do |klass|
begin
next if klass == :AnyType # "nullable: true"
typed_data = find_and_cast_into_type(klass, data)
next if typed_data.respond_to?(:_unparsed) && typed_data._unparsed
return typed_data if typed_data
rescue # rescue all errors so we keep iterating even if the current item lookup raises
end
end

if openapi_one_of.include?(:AnyType)
data
else
self._unparsed = true
DatadogAPIClient::UnparsedObject.new(data)
end
end
end
end
end
20 changes: 16 additions & 4 deletions lib/datadog_api_client/v2/models/user_team_response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,24 @@ class UserTeamResponse
# A user's relationship with a team
attr_accessor :data

# Resources related to the team memberships
attr_accessor :included

# Attribute mapping from ruby-style variable name to JSON key.
# @!visibility private
def self.attribute_map
{
:'data' => :'data'
:'data' => :'data',
:'included' => :'included'
}
end

# Attribute type mapping.
# @!visibility private
def self.openapi_types
{
:'data' => :'UserTeam'
:'data' => :'UserTeam',
:'included' => :'Array<UserTeamIncluded>'
}
end

Expand All @@ -59,6 +64,12 @@ def initialize(attributes = {})
if attributes.key?(:'data')
self.data = attributes[:'data']
end

if attributes.key?(:'included')
if (value = attributes[:'included']).is_a?(Array)
self.included = value
end
end
end

# Checks equality by comparing each attribute.
Expand All @@ -67,14 +78,15 @@ def initialize(attributes = {})
def ==(o)
return true if self.equal?(o)
self.class == o.class &&
data == o.data
data == o.data &&
included == o.included
end

# Calculates hash code according to all attributes.
# @return [Integer] Hash code
# @!visibility private
def hash
[data].hash
[data, included].hash
end
end
end