Sha256: 8a76ed38f710f6018f66830fb2322cf1a92fa3772914b654af5ea8140ec78794

Contents?: true

Size: 1.13 KB

Versions: 10

Compression:

Stored size: 1.13 KB

Contents

# Add a user to a team returns "Represents a user's association to a team" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::TeamsAPI.new

body = DatadogAPIClient::V2::UserTeamRequest.new({
  data: DatadogAPIClient::V2::UserTeamCreate.new({
    attributes: DatadogAPIClient::V2::UserTeamAttributes.new({
      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",
          type: DatadogAPIClient::V2::UserTeamUserType::USERS,
        }),
      }),
    }),
    type: DatadogAPIClient::V2::UserTeamType::TEAM_MEMBERSHIPS,
  }),
})
p api_instance.create_team_membership("team_id", body)

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
datadog_api_client-2.28.1 examples/v2/teams/CreateTeamMembership.rb
datadog_api_client-2.27.1 examples/v2/teams/CreateTeamMembership.rb
datadog_api_client-2.26.1 examples/v2/teams/CreateTeamMembership.rb
datadog_api_client-2.26.0 examples/v2/teams/CreateTeamMembership.rb
datadog_api_client-2.25.0 examples/v2/teams/CreateTeamMembership.rb
datadog_api_client-2.24.0 examples/v2/teams/CreateTeamMembership.rb
datadog_api_client-2.22.0 examples/v2/teams/CreateTeamMembership.rb
datadog_api_client-2.21.0 examples/v2/teams/CreateTeamMembership.rb
datadog_api_client-2.20.0 examples/v2/teams/CreateTeamMembership.rb
datadog_api_client-2.19.0 examples/v2/teams/CreateTeamMembership.rb