diff --git a/.apigentools-info b/.apigentools-info index 72d4fca94b31..81ee52a92d47 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -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" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 35cf1d7425c3..ccb37d1f3128 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -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: @@ -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 diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index ea3f3a7cbcc8..6f4a25ddaa1d 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -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", diff --git a/lib/datadog_api_client/v2/models/user_team_included.rb b/lib/datadog_api_client/v2/models/user_team_included.rb new file mode 100644 index 000000000000..eaeb80e8c41f --- /dev/null +++ b/lib/datadog_api_client/v2/models/user_team_included.rb @@ -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 diff --git a/lib/datadog_api_client/v2/models/user_team_response.rb b/lib/datadog_api_client/v2/models/user_team_response.rb index 651923fdb171..a334add88fc0 100644 --- a/lib/datadog_api_client/v2/models/user_team_response.rb +++ b/lib/datadog_api_client/v2/models/user_team_response.rb @@ -24,11 +24,15 @@ 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 @@ -36,7 +40,8 @@ def self.attribute_map # @!visibility private def self.openapi_types { - :'data' => :'UserTeam' + :'data' => :'UserTeam', + :'included' => :'Array' } end @@ -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. @@ -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