diff --git a/.apigentools-info b/.apigentools-info index 207b45f8f57c..8d3f89f75ab0 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2023-12-18 13:46:56.904572", - "spec_repo_commit": "f363f7b4" + "regenerated": "2023-12-20 15:36:02.660119", + "spec_repo_commit": "77ce3670" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2023-12-18 13:46:56.919928", - "spec_repo_commit": "f363f7b4" + "regenerated": "2023-12-20 15:36:02.675562", + "spec_repo_commit": "77ce3670" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index fba681546eaa..1c5f46bfd51a 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -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: @@ -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 @@ -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 @@ -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 diff --git a/examples/v2/teams/CreateTeamMembership.ts b/examples/v2/teams/CreateTeamMembership.ts index 42091b6fb4f2..6bf9fb48d12c 100644 --- a/examples/v2/teams/CreateTeamMembership.ts +++ b/examples/v2/teams/CreateTeamMembership.ts @@ -14,6 +14,12 @@ const params: v2.TeamsApiCreateTeamMembershipRequest = { role: "admin", }, relationships: { + team: { + data: { + id: "d7e15d9d-d346-43da-81d8-3d9e71d9a5e9", + type: "team", + }, + }, user: { data: { id: "b8626d7e-cedd-11eb-abf5-da7ad0900001", diff --git a/features/v2/teams.feature b/features/v2/teams.feature index c226790f553c..c59a3a3654ef 100644 --- a/features/v2/teams.feature +++ b/features/v2/teams.feature @@ -11,7 +11,7 @@ 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. @@ -19,7 +19,7 @@ Feature: Teams 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 diff --git a/packages/datadog-api-client-v2/index.ts b/packages/datadog-api-client-v2/index.ts index f244b68f3be9..2db910b69373 100644 --- a/packages/datadog-api-client-v2/index.ts +++ b/packages/datadog-api-client-v2/index.ts @@ -1246,6 +1246,8 @@ export { RelationshipToUserData } from "./models/RelationshipToUserData"; export { RelationshipToUsers } from "./models/RelationshipToUsers"; export { RelationshipToUserTeamPermission } from "./models/RelationshipToUserTeamPermission"; export { RelationshipToUserTeamPermissionData } from "./models/RelationshipToUserTeamPermissionData"; +export { RelationshipToUserTeamTeam } from "./models/RelationshipToUserTeamTeam"; +export { RelationshipToUserTeamTeamData } from "./models/RelationshipToUserTeamTeamData"; export { RelationshipToUserTeamUser } from "./models/RelationshipToUserTeamUser"; export { RelationshipToUserTeamUserData } from "./models/RelationshipToUserTeamUserData"; export { ReorderRetentionFiltersRequest } from "./models/ReorderRetentionFiltersRequest"; @@ -1696,6 +1698,7 @@ export { UserTeamRequest } from "./models/UserTeamRequest"; export { UserTeamResponse } from "./models/UserTeamResponse"; export { UserTeamRole } from "./models/UserTeamRole"; export { UserTeamsResponse } from "./models/UserTeamsResponse"; +export { UserTeamTeamType } from "./models/UserTeamTeamType"; export { UserTeamType } from "./models/UserTeamType"; export { UserTeamUpdate } from "./models/UserTeamUpdate"; export { UserTeamUpdateRequest } from "./models/UserTeamUpdateRequest"; diff --git a/packages/datadog-api-client-v2/models/ObjectSerializer.ts b/packages/datadog-api-client-v2/models/ObjectSerializer.ts index 1be583377adb..62d43b78deda 100644 --- a/packages/datadog-api-client-v2/models/ObjectSerializer.ts +++ b/packages/datadog-api-client-v2/models/ObjectSerializer.ts @@ -658,6 +658,8 @@ import { RelationshipToUser } from "./RelationshipToUser"; import { RelationshipToUserData } from "./RelationshipToUserData"; import { RelationshipToUserTeamPermission } from "./RelationshipToUserTeamPermission"; import { RelationshipToUserTeamPermissionData } from "./RelationshipToUserTeamPermissionData"; +import { RelationshipToUserTeamTeam } from "./RelationshipToUserTeamTeam"; +import { RelationshipToUserTeamTeamData } from "./RelationshipToUserTeamTeamData"; import { RelationshipToUserTeamUser } from "./RelationshipToUserTeamUser"; import { RelationshipToUserTeamUserData } from "./RelationshipToUserTeamUserData"; import { RelationshipToUsers } from "./RelationshipToUsers"; @@ -1504,6 +1506,7 @@ const enumsMap: { [key: string]: any[] } = { UserInvitationsType: ["user_invitations"], UserTeamPermissionType: ["user_team_permissions"], UserTeamRole: ["admin"], + UserTeamTeamType: ["team"], UserTeamType: ["team_memberships"], UserTeamUserType: ["users"], UsersType: ["users"], @@ -2242,6 +2245,8 @@ const typeMap: { [index: string]: any } = { RelationshipToUserData: RelationshipToUserData, RelationshipToUserTeamPermission: RelationshipToUserTeamPermission, RelationshipToUserTeamPermissionData: RelationshipToUserTeamPermissionData, + RelationshipToUserTeamTeam: RelationshipToUserTeamTeam, + RelationshipToUserTeamTeamData: RelationshipToUserTeamTeamData, RelationshipToUserTeamUser: RelationshipToUserTeamUser, RelationshipToUserTeamUserData: RelationshipToUserTeamUserData, RelationshipToUsers: RelationshipToUsers, diff --git a/packages/datadog-api-client-v2/models/RelationshipToUserTeamTeam.ts b/packages/datadog-api-client-v2/models/RelationshipToUserTeamTeam.ts new file mode 100644 index 000000000000..69f22ba99e8a --- /dev/null +++ b/packages/datadog-api-client-v2/models/RelationshipToUserTeamTeam.ts @@ -0,0 +1,43 @@ +/** + * 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. + */ +import { RelationshipToUserTeamTeamData } from "./RelationshipToUserTeamTeamData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Relationship between team membership and team + */ +export class RelationshipToUserTeamTeam { + /** + * The team associated with the membership + */ + "data": RelationshipToUserTeamTeamData; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "RelationshipToUserTeamTeamData", + required: true, + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return RelationshipToUserTeamTeam.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/RelationshipToUserTeamTeamData.ts b/packages/datadog-api-client-v2/models/RelationshipToUserTeamTeamData.ts new file mode 100644 index 000000000000..1445289d7bd5 --- /dev/null +++ b/packages/datadog-api-client-v2/models/RelationshipToUserTeamTeamData.ts @@ -0,0 +1,52 @@ +/** + * 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. + */ +import { UserTeamTeamType } from "./UserTeamTeamType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * The team associated with the membership + */ +export class RelationshipToUserTeamTeamData { + /** + * The ID of the team associated with the membership + */ + "id": string; + /** + * User team team type + */ + "type": UserTeamTeamType; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + id: { + baseName: "id", + type: "string", + required: true, + }, + type: { + baseName: "type", + type: "UserTeamTeamType", + required: true, + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return RelationshipToUserTeamTeamData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/UserTeamAttributes.ts b/packages/datadog-api-client-v2/models/UserTeamAttributes.ts index 712c518099eb..34f5bf028228 100644 --- a/packages/datadog-api-client-v2/models/UserTeamAttributes.ts +++ b/packages/datadog-api-client-v2/models/UserTeamAttributes.ts @@ -11,6 +11,15 @@ import { AttributeTypeMap } from "../../datadog-api-client-common/util"; * Team membership attributes */ export class UserTeamAttributes { + /** + * 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. + */ + "provisionedBy"?: string; + /** + * UUID of the User or Service Account who provisioned this team membership, or null if provisioned via SAML mapping. + */ + "provisionedById"?: string; /** * The user's role within the team */ @@ -25,6 +34,14 @@ export class UserTeamAttributes { * @ignore */ static readonly attributeTypeMap: AttributeTypeMap = { + provisionedBy: { + baseName: "provisioned_by", + type: "string", + }, + provisionedById: { + baseName: "provisioned_by_id", + type: "string", + }, role: { baseName: "role", type: "UserTeamRole", diff --git a/packages/datadog-api-client-v2/models/UserTeamRelationships.ts b/packages/datadog-api-client-v2/models/UserTeamRelationships.ts index 6b0b549c1dd5..d53920b7c08b 100644 --- a/packages/datadog-api-client-v2/models/UserTeamRelationships.ts +++ b/packages/datadog-api-client-v2/models/UserTeamRelationships.ts @@ -3,6 +3,7 @@ * This product includes software developed at Datadog (https://www.datadoghq.com/). * Copyright 2020-Present Datadog, Inc. */ +import { RelationshipToUserTeamTeam } from "./RelationshipToUserTeamTeam"; import { RelationshipToUserTeamUser } from "./RelationshipToUserTeamUser"; import { AttributeTypeMap } from "../../datadog-api-client-common/util"; @@ -11,6 +12,10 @@ import { AttributeTypeMap } from "../../datadog-api-client-common/util"; * Relationship between membership and a user */ export class UserTeamRelationships { + /** + * Relationship between team membership and team + */ + "team"?: RelationshipToUserTeamTeam; /** * Relationship between team membership and user */ @@ -25,6 +30,10 @@ export class UserTeamRelationships { * @ignore */ static readonly attributeTypeMap: AttributeTypeMap = { + team: { + baseName: "team", + type: "RelationshipToUserTeamTeam", + }, user: { baseName: "user", type: "RelationshipToUserTeamUser", diff --git a/packages/datadog-api-client-v2/models/UserTeamTeamType.ts b/packages/datadog-api-client-v2/models/UserTeamTeamType.ts new file mode 100644 index 000000000000..8bbee460ae39 --- /dev/null +++ b/packages/datadog-api-client-v2/models/UserTeamTeamType.ts @@ -0,0 +1,14 @@ +/** + * 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. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * User team team type + */ + +export type UserTeamTeamType = typeof TEAM | UnparsedObject; +export const TEAM = "team";