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": "2023-12-20 13:53:12.279073",
"spec_repo_commit": "1e75e401"
"regenerated": "2023-12-20 18:12:27.522466",
"spec_repo_commit": "0ea19912"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2023-12-20 13:53:12.293425",
"spec_repo_commit": "1e75e401"
"regenerated": "2023-12-20 18:12:27.538857",
"spec_repo_commit": "0ea19912"
}
}
}
46 changes: 46 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13640,6 +13640,27 @@ components:
- id
- type
type: object
RelationshipToUserTeamTeam:
description: Relationship between team membership and team
properties:
data:
$ref: '#/components/schemas/RelationshipToUserTeamTeamData'
required:
- data
type: object
RelationshipToUserTeamTeamData:
description: The team associated with the membership
properties:
id:
description: The ID of the team associated with the membership
example: d7e15d9d-d346-43da-81d8-3d9e71d9a5e9
type: string
type:
$ref: '#/components/schemas/UserTeamTeamType'
required:
- id
- type
type: object
RelationshipToUserTeamUser:
description: Relationship between team membership and user
properties:
Expand Down Expand Up @@ -19614,6 +19635,20 @@ components:
UserTeamAttributes:
description: Team membership attributes
properties:
provisioned_by:
description: 'The mechanism responsible for provisioning the team relationship.

Possible values: null for added by a user, "service_account" if added
by a service account, and "saml_mapping" if provisioned via SAML mapping.'
nullable: true
readOnly: true
type: string
provisioned_by_id:
description: UUID of the User or Service Account who provisioned this team
membership, or null if provisioned via SAML mapping.
nullable: true
readOnly: true
type: string
role:
$ref: '#/components/schemas/UserTeamRole'
type: object
Expand Down Expand Up @@ -19665,6 +19700,8 @@ components:
UserTeamRelationships:
description: Relationship between membership and a user
properties:
team:
$ref: '#/components/schemas/RelationshipToUserTeamTeam'
user:
$ref: '#/components/schemas/RelationshipToUserTeamUser'
type: object
Expand All @@ -19690,6 +19727,15 @@ components:
type: string
x-enum-varnames:
- ADMIN
UserTeamTeamType:
default: team
description: User team team type
enum:
- team
example: team
type: string
x-enum-varnames:
- TEAM
UserTeamType:
default: team_memberships
description: Team membership type
Expand Down
6 changes: 6 additions & 0 deletions examples/v2/teams/CreateTeamMembership.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@
role: DatadogAPIClient::V2::UserTeamRole::ADMIN,
}),
relationships: DatadogAPIClient::V2::UserTeamRelationships.new({
team: DatadogAPIClient::V2::RelationshipToUserTeamTeam.new({
data: DatadogAPIClient::V2::RelationshipToUserTeamTeamData.new({
id: "d7e15d9d-d346-43da-81d8-3d9e71d9a5e9",
type: DatadogAPIClient::V2::UserTeamTeamType::TEAM,
}),
}),
user: DatadogAPIClient::V2::RelationshipToUserTeamUser.new({
data: DatadogAPIClient::V2::RelationshipToUserTeamUserData.new({
id: "b8626d7e-cedd-11eb-abf5-da7ad0900001",
Expand Down
4 changes: 2 additions & 2 deletions features/v2/teams.feature
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ Feature: Teams
Scenario: Add a user to a team returns "API error response." response
Given new "CreateTeamMembership" request
And request contains "team_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"role": "admin"}, "relationships": {"user": {"data": {"id": "b8626d7e-cedd-11eb-abf5-da7ad0900001", "type": "users"}}}, "type": "team_memberships"}}
And body with value {"data": {"attributes": {"role": "admin"}, "relationships": {"team": {"data": {"id": "d7e15d9d-d346-43da-81d8-3d9e71d9a5e9", "type": "team"}}, "user": {"data": {"id": "b8626d7e-cedd-11eb-abf5-da7ad0900001", "type": "users"}}}, "type": "team_memberships"}}
When the request is sent
Then the response status is 409 API error response.

@generated @skip @team:DataDog/core-app
Scenario: Add a user to a team returns "Represents a user's association to a team" response
Given new "CreateTeamMembership" request
And request contains "team_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"role": "admin"}, "relationships": {"user": {"data": {"id": "b8626d7e-cedd-11eb-abf5-da7ad0900001", "type": "users"}}}, "type": "team_memberships"}}
And body with value {"data": {"attributes": {"role": "admin"}, "relationships": {"team": {"data": {"id": "d7e15d9d-d346-43da-81d8-3d9e71d9a5e9", "type": "team"}}, "user": {"data": {"id": "b8626d7e-cedd-11eb-abf5-da7ad0900001", "type": "users"}}}, "type": "team_memberships"}}
When the request is sent
Then the response status is 200 Represents a user's association to a team

Expand Down
3 changes: 3 additions & 0 deletions lib/datadog_api_client/inflector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1648,6 +1648,8 @@ def overrides
"v2.relationship_to_users" => "RelationshipToUsers",
"v2.relationship_to_user_team_permission" => "RelationshipToUserTeamPermission",
"v2.relationship_to_user_team_permission_data" => "RelationshipToUserTeamPermissionData",
"v2.relationship_to_user_team_team" => "RelationshipToUserTeamTeam",
"v2.relationship_to_user_team_team_data" => "RelationshipToUserTeamTeamData",
"v2.relationship_to_user_team_user" => "RelationshipToUserTeamUser",
"v2.relationship_to_user_team_user_data" => "RelationshipToUserTeamUserData",
"v2.reorder_retention_filters_request" => "ReorderRetentionFiltersRequest",
Expand Down Expand Up @@ -2098,6 +2100,7 @@ def overrides
"v2.user_team_response" => "UserTeamResponse",
"v2.user_team_role" => "UserTeamRole",
"v2.user_teams_response" => "UserTeamsResponse",
"v2.user_team_team_type" => "UserTeamTeamType",
"v2.user_team_type" => "UserTeamType",
"v2.user_team_update" => "UserTeamUpdate",
"v2.user_team_update_request" => "UserTeamUpdateRequest",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
=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
# Relationship between team membership and team
class RelationshipToUserTeamTeam
include BaseGenericModel

# The team associated with the membership
attr_reader :data

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

# Attribute type mapping.
# @!visibility private
def self.openapi_types
{
:'data' => :'RelationshipToUserTeamTeamData'
}
end

# Initializes the object
# @param attributes [Hash] Model attributes in the form of hash
# @!visibility private
def initialize(attributes = {})
if (!attributes.is_a?(Hash))
fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::RelationshipToUserTeamTeam` initialize method"
end

# check to see if the attribute exists and convert string to symbol for hash key
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::RelationshipToUserTeamTeam`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
end
h[k.to_sym] = v
}

if attributes.key?(:'data')
self.data = attributes[:'data']
end
end

# Check to see if the all the properties in the model are valid
# @return true if the model is valid
# @!visibility private
def valid?
return false if @data.nil?
true
end

# Custom attribute writer method with validation
# @param data [Object] Object to be assigned
# @!visibility private
def data=(data)
if data.nil?
fail ArgumentError, 'invalid value for "data", data cannot be nil.'
end
@data = data
end

# Checks equality by comparing each attribute.
# @param o [Object] Object to be compared
# @!visibility private
def ==(o)
return true if self.equal?(o)
self.class == o.class &&
data == o.data
end

# Calculates hash code according to all attributes.
# @return [Integer] Hash code
# @!visibility private
def hash
[data].hash
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
=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
# The team associated with the membership
class RelationshipToUserTeamTeamData
include BaseGenericModel

# The ID of the team associated with the membership
attr_reader :id

# User team team type
attr_reader :type

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

# Attribute type mapping.
# @!visibility private
def self.openapi_types
{
:'id' => :'String',
:'type' => :'UserTeamTeamType'
}
end

# Initializes the object
# @param attributes [Hash] Model attributes in the form of hash
# @!visibility private
def initialize(attributes = {})
if (!attributes.is_a?(Hash))
fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::RelationshipToUserTeamTeamData` initialize method"
end

# check to see if the attribute exists and convert string to symbol for hash key
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::RelationshipToUserTeamTeamData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
end
h[k.to_sym] = v
}

if attributes.key?(:'id')
self.id = attributes[:'id']
end

if attributes.key?(:'type')
self.type = attributes[:'type']
end
end

# Check to see if the all the properties in the model are valid
# @return true if the model is valid
# @!visibility private
def valid?
return false if @id.nil?
return false if @type.nil?
true
end

# Custom attribute writer method with validation
# @param id [Object] Object to be assigned
# @!visibility private
def id=(id)
if id.nil?
fail ArgumentError, 'invalid value for "id", id cannot be nil.'
end
@id = id
end

# Custom attribute writer method with validation
# @param type [Object] Object to be assigned
# @!visibility private
def type=(type)
if type.nil?
fail ArgumentError, 'invalid value for "type", type cannot be nil.'
end
@type = type
end

# Checks equality by comparing each attribute.
# @param o [Object] Object to be compared
# @!visibility private
def ==(o)
return true if self.equal?(o)
self.class == o.class &&
id == o.id &&
type == o.type
end

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