From e4efdb89bd08ab8d2bab9c69fe7d69450ace415f Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 30 Mar 2023 18:45:58 +0000 Subject: [PATCH] Regenerate client from commit 69b7dfb1 of spec repo --- .apigentools-info | 8 +- .generator/schemas/v2/openapi.yaml | 4036 +++++++++++------ examples/v2/teams/CreateTeam.java | 38 + examples/v2/teams/CreateTeamLink.java | 42 + examples/v2/teams/CreateTeamMembership.java | 48 + examples/v2/teams/GetAllTeams.java | 24 + examples/v2/teams/GetTeam.java | 27 + examples/v2/teams/GetTeamLink.java | 30 + examples/v2/teams/GetTeamLinks.java | 27 + examples/v2/teams/GetTeamMemberships.java | 27 + .../v2/teams/GetTeamPermissionSettings.java | 28 + examples/v2/teams/RemoveTeam.java | 25 + examples/v2/teams/RemoveTeamLink.java | 28 + examples/v2/teams/RemoveTeamMembership.java | 25 + examples/v2/teams/UpdateTeam.java | 43 + examples/v2/teams/UpdateTeamLink.java | 43 + examples/v2/teams/UpdateTeamMembership.java | 37 + .../v2/teams/UpdateTeamPermissionSetting.java | 42 + .../datadog/api/client/v2/api/TeamsApi.java | 2682 +++++++++++ .../client/v2/model/GetAllTeamsInclude.java | 94 + .../api/client/v2/model/GetAllTeamsSort.java | 95 + .../v2/model/GetTeamMembershipsSort.java | 112 + .../v2/model/RelationshipToTeamLinkData.java | 124 + .../v2/model/RelationshipToTeamLinks.java | 95 + .../RelationshipToUserTeamPermission.java | 83 + .../RelationshipToUserTeamPermissionData.java | 125 + .../v2/model/RelationshipToUserTeamUser.java | 92 + .../model/RelationshipToUserTeamUserData.java | 125 + .../com/datadog/api/client/v2/model/Team.java | 182 + .../api/client/v2/model/TeamAttributes.java | 271 ++ .../api/client/v2/model/TeamCreate.java | 155 + .../client/v2/model/TeamCreateAttributes.java | 164 + .../v2/model/TeamCreateRelationships.java | 82 + .../client/v2/model/TeamCreateRequest.java | 91 + .../datadog/api/client/v2/model/TeamData.java | 154 + .../api/client/v2/model/TeamIncluded.java | 333 ++ .../datadog/api/client/v2/model/TeamLink.java | 155 + .../client/v2/model/TeamLinkAttributes.java | 164 + .../api/client/v2/model/TeamLinkCreate.java | 124 + .../v2/model/TeamLinkCreateRequest.java | 91 + .../api/client/v2/model/TeamLinkResponse.java | 82 + .../api/client/v2/model/TeamLinkType.java | 91 + .../client/v2/model/TeamLinksResponse.java | 95 + .../v2/model/TeamPermissionSetting.java | 152 + .../TeamPermissionSettingAttributes.java | 161 + .../model/TeamPermissionSettingResponse.java | 82 + ...TeamPermissionSettingSerializerAction.java | 102 + .../v2/model/TeamPermissionSettingType.java | 95 + .../v2/model/TeamPermissionSettingUpdate.java | 124 + ...TeamPermissionSettingUpdateAttributes.java | 86 + .../TeamPermissionSettingUpdateRequest.java | 92 + .../v2/model/TeamPermissionSettingValue.java | 103 + .../model/TeamPermissionSettingsResponse.java | 96 + .../client/v2/model/TeamRelationships.java | 115 + .../api/client/v2/model/TeamResponse.java | 82 + .../datadog/api/client/v2/model/TeamType.java | 91 + .../api/client/v2/model/TeamUpdate.java | 155 + .../client/v2/model/TeamUpdateAttributes.java | 191 + .../v2/model/TeamUpdateRelationships.java | 82 + .../client/v2/model/TeamUpdateRequest.java | 91 + .../api/client/v2/model/TeamsResponse.java | 133 + .../datadog/api/client/v2/model/UserTeam.java | 180 + .../client/v2/model/UserTeamAttributes.java | 95 + .../api/client/v2/model/UserTeamCreate.java | 152 + .../client/v2/model/UserTeamPermission.java | 152 + .../model/UserTeamPermissionAttributes.java | 73 + .../v2/model/UserTeamPermissionType.java | 95 + .../v2/model/UserTeamRelationships.java | 82 + .../api/client/v2/model/UserTeamRequest.java | 91 + .../api/client/v2/model/UserTeamResponse.java | 82 + .../api/client/v2/model/UserTeamRole.java | 91 + .../api/client/v2/model/UserTeamType.java | 92 + .../api/client/v2/model/UserTeamUpdate.java | 121 + .../v2/model/UserTeamUpdateRequest.java | 91 + .../api/client/v2/model/UserTeamUserType.java | 91 + .../client/v2/model/UserTeamsResponse.java | 95 + ...returns_API_error_response_response.freeze | 1 + ...k_returns_API_error_response_response.json | 83 + ...ate_a_team_link_returns_OK_response.freeze | 1 + ...reate_a_team_link_returns_OK_response.json | 104 + ...returns_API_error_response_response.freeze | 1 + ...m_returns_API_error_response_response.json | 83 + ...ate_a_team_returns_CREATED_response.freeze | 1 + ...reate_a_team_returns_CREATED_response.json | 53 + ...returns_API_error_response_response.freeze | 1 + ...k_returns_API_error_response_response.json | 79 + ...Get_a_team_link_returns_OK_response.freeze | 1 + .../Get_a_team_link_returns_OK_response.json | 130 + ...returns_API_error_response_response.freeze | 1 + ...m_returns_API_error_response_response.json | 28 + .../v2/Get_a_team_returns_OK_response.freeze | 1 + .../v2/Get_a_team_returns_OK_response.json | 79 + .../Get_all_teams_returns_OK_response.freeze | 1 + .../v2/Get_all_teams_returns_OK_response.json | 79 + ...returns_API_error_response_response.freeze | 1 + ...m_returns_API_error_response_response.json | 28 + ...inks_for_a_team_returns_OK_response.freeze | 1 + ..._links_for_a_team_returns_OK_response.json | 79 + ...returns_API_error_response_response.freeze | 1 + ...m_returns_API_error_response_response.json | 28 + ...ings_for_a_team_returns_OK_response.freeze | 1 + ...ttings_for_a_team_returns_OK_response.json | 79 + ...returns_API_error_response_response.freeze | 1 + ...s_returns_API_error_response_response.json | 28 + ...er_s_association_to_a_team_response.freeze | 1 + ...user_s_association_to_a_team_response.json | 79 + ...returns_API_error_response_response.freeze | 1 + ...k_returns_API_error_response_response.json | 79 + ...am_link_returns_No_Content_response.freeze | 1 + ...team_link_returns_No_Content_response.json | 130 + ...returns_API_error_response_response.freeze | 1 + ...m_returns_API_error_response_response.json | 28 + ..._a_team_returns_No_Content_response.freeze | 1 + ...ve_a_team_returns_No_Content_response.json | 79 + ...returns_API_error_response_response.freeze | 1 + ...m_returns_API_error_response_response.json | 79 + ...returns_API_error_response_response.freeze | 1 + ...k_returns_API_error_response_response.json | 83 + ...ate_a_team_link_returns_OK_response.freeze | 1 + ...pdate_a_team_link_returns_OK_response.json | 134 + .../Update_a_team_returns_OK_response.freeze | 1 + .../v2/Update_a_team_returns_OK_response.json | 83 + ...returns_API_error_response_response.freeze | 1 + ...m_returns_API_error_response_response.json | 83 + ...returns_API_error_response_response.freeze | 1 + ...m_returns_API_error_response_response.json | 83 + ...etting_for_team_returns_OK_response.freeze | 1 + ..._setting_for_team_returns_OK_response.json | 83 + .../com/datadog/api/client/v2/api/given.json | 40 + .../datadog/api/client/v2/api/teams.feature | 281 ++ .../com/datadog/api/client/v2/api/undo.json | 125 + 131 files changed, 15159 insertions(+), 1351 deletions(-) create mode 100644 examples/v2/teams/CreateTeam.java create mode 100644 examples/v2/teams/CreateTeamLink.java create mode 100644 examples/v2/teams/CreateTeamMembership.java create mode 100644 examples/v2/teams/GetAllTeams.java create mode 100644 examples/v2/teams/GetTeam.java create mode 100644 examples/v2/teams/GetTeamLink.java create mode 100644 examples/v2/teams/GetTeamLinks.java create mode 100644 examples/v2/teams/GetTeamMemberships.java create mode 100644 examples/v2/teams/GetTeamPermissionSettings.java create mode 100644 examples/v2/teams/RemoveTeam.java create mode 100644 examples/v2/teams/RemoveTeamLink.java create mode 100644 examples/v2/teams/RemoveTeamMembership.java create mode 100644 examples/v2/teams/UpdateTeam.java create mode 100644 examples/v2/teams/UpdateTeamLink.java create mode 100644 examples/v2/teams/UpdateTeamMembership.java create mode 100644 examples/v2/teams/UpdateTeamPermissionSetting.java create mode 100644 src/main/java/com/datadog/api/client/v2/api/TeamsApi.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/GetAllTeamsInclude.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/GetAllTeamsSort.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/GetTeamMembershipsSort.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/RelationshipToTeamLinkData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/RelationshipToTeamLinks.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/RelationshipToUserTeamPermission.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/RelationshipToUserTeamPermissionData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/RelationshipToUserTeamUser.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/RelationshipToUserTeamUserData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/Team.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TeamAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TeamCreate.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TeamCreateAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TeamCreateRelationships.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TeamCreateRequest.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TeamData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TeamIncluded.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TeamLink.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TeamLinkAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TeamLinkCreate.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TeamLinkCreateRequest.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TeamLinkResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TeamLinkType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TeamLinksResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TeamPermissionSetting.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TeamPermissionSettingAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TeamPermissionSettingResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TeamPermissionSettingSerializerAction.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TeamPermissionSettingType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TeamPermissionSettingUpdate.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TeamPermissionSettingUpdateAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TeamPermissionSettingUpdateRequest.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TeamPermissionSettingValue.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TeamPermissionSettingsResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TeamRelationships.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TeamResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TeamType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TeamUpdate.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TeamUpdateAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TeamUpdateRelationships.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TeamUpdateRequest.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TeamsResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/UserTeam.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/UserTeamAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/UserTeamCreate.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/UserTeamPermission.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/UserTeamPermissionAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/UserTeamPermissionType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/UserTeamRelationships.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/UserTeamRequest.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/UserTeamResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/UserTeamRole.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/UserTeamType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/UserTeamUpdate.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/UserTeamUpdateRequest.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/UserTeamUserType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/UserTeamsResponse.java create mode 100644 src/test/resources/cassettes/features/v2/Create_a_team_link_returns_API_error_response_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Create_a_team_link_returns_API_error_response_response.json create mode 100644 src/test/resources/cassettes/features/v2/Create_a_team_link_returns_OK_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Create_a_team_link_returns_OK_response.json create mode 100644 src/test/resources/cassettes/features/v2/Create_a_team_returns_API_error_response_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Create_a_team_returns_API_error_response_response.json create mode 100644 src/test/resources/cassettes/features/v2/Create_a_team_returns_CREATED_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Create_a_team_returns_CREATED_response.json create mode 100644 src/test/resources/cassettes/features/v2/Get_a_team_link_returns_API_error_response_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Get_a_team_link_returns_API_error_response_response.json create mode 100644 src/test/resources/cassettes/features/v2/Get_a_team_link_returns_OK_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Get_a_team_link_returns_OK_response.json create mode 100644 src/test/resources/cassettes/features/v2/Get_a_team_returns_API_error_response_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Get_a_team_returns_API_error_response_response.json create mode 100644 src/test/resources/cassettes/features/v2/Get_a_team_returns_OK_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Get_a_team_returns_OK_response.json create mode 100644 src/test/resources/cassettes/features/v2/Get_all_teams_returns_OK_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Get_all_teams_returns_OK_response.json create mode 100644 src/test/resources/cassettes/features/v2/Get_links_for_a_team_returns_API_error_response_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Get_links_for_a_team_returns_API_error_response_response.json create mode 100644 src/test/resources/cassettes/features/v2/Get_links_for_a_team_returns_OK_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Get_links_for_a_team_returns_OK_response.json create mode 100644 src/test/resources/cassettes/features/v2/Get_permission_settings_for_a_team_returns_API_error_response_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Get_permission_settings_for_a_team_returns_API_error_response_response.json create mode 100644 src/test/resources/cassettes/features/v2/Get_permission_settings_for_a_team_returns_OK_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Get_permission_settings_for_a_team_returns_OK_response.json create mode 100644 src/test/resources/cassettes/features/v2/Get_team_memberships_returns_API_error_response_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Get_team_memberships_returns_API_error_response_response.json create mode 100644 src/test/resources/cassettes/features/v2/Get_team_memberships_returns_Represents_a_user_s_association_to_a_team_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Get_team_memberships_returns_Represents_a_user_s_association_to_a_team_response.json create mode 100644 src/test/resources/cassettes/features/v2/Remove_a_team_link_returns_API_error_response_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Remove_a_team_link_returns_API_error_response_response.json create mode 100644 src/test/resources/cassettes/features/v2/Remove_a_team_link_returns_No_Content_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Remove_a_team_link_returns_No_Content_response.json create mode 100644 src/test/resources/cassettes/features/v2/Remove_a_team_returns_API_error_response_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Remove_a_team_returns_API_error_response_response.json create mode 100644 src/test/resources/cassettes/features/v2/Remove_a_team_returns_No_Content_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Remove_a_team_returns_No_Content_response.json create mode 100644 src/test/resources/cassettes/features/v2/Remove_a_user_from_a_team_returns_API_error_response_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Remove_a_user_from_a_team_returns_API_error_response_response.json create mode 100644 src/test/resources/cassettes/features/v2/Update_a_team_link_returns_API_error_response_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Update_a_team_link_returns_API_error_response_response.json create mode 100644 src/test/resources/cassettes/features/v2/Update_a_team_link_returns_OK_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Update_a_team_link_returns_OK_response.json create mode 100644 src/test/resources/cassettes/features/v2/Update_a_team_returns_OK_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Update_a_team_returns_OK_response.json create mode 100644 src/test/resources/cassettes/features/v2/Update_a_user_s_role_on_a_team_returns_API_error_response_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Update_a_user_s_role_on_a_team_returns_API_error_response_response.json create mode 100644 src/test/resources/cassettes/features/v2/Update_permission_setting_for_team_returns_API_error_response_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Update_permission_setting_for_team_returns_API_error_response_response.json create mode 100644 src/test/resources/cassettes/features/v2/Update_permission_setting_for_team_returns_OK_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Update_permission_setting_for_team_returns_OK_response.json create mode 100644 src/test/resources/com/datadog/api/client/v2/api/teams.feature diff --git a/.apigentools-info b/.apigentools-info index 1ba50b490fe..718f7af0f9e 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.4", - "regenerated": "2023-03-29 17:57:07.185563", - "spec_repo_commit": "c0790f05" + "regenerated": "2023-03-30 18:44:41.335023", + "spec_repo_commit": "69b7dfb1" }, "v2": { "apigentools_version": "1.6.4", - "regenerated": "2023-03-29 17:57:07.197967", - "spec_repo_commit": "c0790f05" + "regenerated": "2023-03-30 18:44:41.347457", + "spec_repo_commit": "69b7dfb1" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 8a8b63be81e..ebc5d019156 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -3687,6 +3687,49 @@ components: nullable: true type: array type: object + GetAllTeamsInclude: + description: Included related resources optionally requested. + enum: + - team_links + - user_team_permissions + type: string + x-enum-varnames: + - TEAM_LINKS + - USER_TEAM_PERMISSIONS + GetAllTeamsSort: + description: Specifies the order of the returned teams + enum: + - name + - -name + - user_count + - -user_count + type: string + x-enum-varnames: + - NAME + - _NAME + - USER_COUNT + - _USER_COUNT + GetTeamMembershipsSort: + description: Specifies the order of returned team memberships + enum: + - manager_name + - -manager_name + - name + - -name + - handle + - -handle + - email + - -email + type: string + x-enum-varnames: + - MANAGER_NAME + - _MANAGER_NAME + - NAME + - _NAME + - HANDLE + - _HANDLE + - EMAIL + - _EMAIL GroupScalarColumn: description: A column containing the tag keys and values in a group. properties: @@ -9477,6 +9520,28 @@ components: - id - type type: object + RelationshipToTeamLinkData: + description: Relationship between a link and a team + properties: + id: + description: The team link's identifier + example: f9bb8444-af7f-11ec-ac2c-da7ad0900001 + type: string + type: + $ref: '#/components/schemas/TeamLinkType' + required: + - id + - type + type: object + RelationshipToTeamLinks: + description: Relationship between a team and a team link + properties: + data: + description: Related team links + items: + $ref: '#/components/schemas/RelationshipToTeamLinkData' + type: array + type: object RelationshipToUser: description: Relationship to user. properties: @@ -9498,6 +9563,46 @@ components: - id - type type: object + RelationshipToUserTeamPermission: + description: Relationship between a user team permission and a team + properties: + data: + $ref: '#/components/schemas/RelationshipToUserTeamPermissionData' + type: object + RelationshipToUserTeamPermissionData: + description: Related user team permission data + properties: + id: + description: The ID of the user team permission + example: UserTeamPermissions-aeadc05e-98a8-11ec-ac2c-da7ad0900001-416595 + type: string + type: + $ref: '#/components/schemas/UserTeamPermissionType' + required: + - id + - type + type: object + RelationshipToUserTeamUser: + description: Relationship between team membership and user + properties: + data: + $ref: '#/components/schemas/RelationshipToUserTeamUserData' + required: + - data + type: object + RelationshipToUserTeamUserData: + description: A user's relationship with a team + properties: + id: + description: The ID of the user associated with the team + example: b8626d7e-cedd-11eb-abf5-da7ad0900001 + type: string + type: + $ref: '#/components/schemas/UserTeamUserType' + required: + - id + - type + type: object RelationshipToUsers: description: Relationship to users. properties: @@ -12749,158 +12854,590 @@ components: description: Tag associated with your event. type: string type: array - TimeseriesFormulaQueryRequest: - description: A request wrapper around a single timeseries query to be executed. + Team: + description: A team properties: - data: - $ref: '#/components/schemas/TimeseriesFormulaRequest' + attributes: + $ref: '#/components/schemas/TeamAttributes' + id: + description: The team's identifier + example: aeadc05e-98a8-11ec-ac2c-da7ad0900001 + type: string + relationships: + $ref: '#/components/schemas/TeamRelationships' + type: + $ref: '#/components/schemas/TeamType' required: - - data + - attributes + - id + - type type: object - TimeseriesFormulaQueryResponse: - description: A message containing one response to a timeseries query made with - timeseries formula query request. + TeamAttributes: + description: Team attributes properties: - data: - $ref: '#/components/schemas/TimeseriesResponse' - errors: - description: The error generated by the request. + created_at: + description: Creation date of the team + format: date-time + type: string + description: + description: Free-form markdown description/content for the team's homepage + type: string + handle: + description: The team's identifier + example: example-team + maxLength: 64 type: string + link_count: + description: The number of links belonging to the team + format: int32 + maximum: 2147483647 + readOnly: true + type: integer + modified_at: + description: Modification date of the team + format: date-time + type: string + name: + description: The name of the team + example: Example Team + maxLength: 64 + type: string + summary: + description: A brief summary of the team, derived from the `description` + maxLength: 120 + type: string + user_count: + description: The number of users belonging to the team + format: int32 + maximum: 2147483647 + readOnly: true + type: integer + required: + - handle + - name type: object - TimeseriesFormulaRequest: - description: A single timeseries query to be executed. + TeamCreate: + description: Team create properties: attributes: - $ref: '#/components/schemas/TimeseriesFormulaRequestAttributes' + $ref: '#/components/schemas/TeamCreateAttributes' + relationships: + $ref: '#/components/schemas/TeamCreateRelationships' type: - $ref: '#/components/schemas/TimeseriesFormulaRequestType' + $ref: '#/components/schemas/TeamType' required: - - type - attributes + - type type: object - TimeseriesFormulaRequestAttributes: - description: The object describing a timeseries formula request. + TeamCreateAttributes: + description: Team creation attributes properties: - formulas: - description: List of formulas to be calculated and returned as responses. - items: - $ref: '#/components/schemas/QueryFormula' - type: array - from: - description: Start date (inclusive) of the query in milliseconds since the - Unix epoch. - example: 1568899800000 - format: int64 - type: integer - interval: - description: 'A time interval in milliseconds. - - May be overridden by a larger interval if the query would result in - - too many points for the specified timeframe. - - Defaults to a reasonable interval for the given timeframe.' - example: 5000 - format: int64 - type: integer - queries: - $ref: '#/components/schemas/TimeseriesFormulaRequestQueries' - to: - description: End date (exclusive) of the query in milliseconds since the - Unix epoch. - example: 1568923200000 - format: int64 + description: + description: Free-form markdown description/content for the team's homepage + type: string + handle: + description: The team's identifier + example: example-team + maxLength: 64 + type: string + link_count: + description: The number of links belonging to the team + format: int32 + maximum: 2147483647 + readOnly: true type: integer + name: + description: The name of the team + example: Example Team + maxLength: 64 + type: string required: - - to - - from - - queries + - handle + - name type: object - TimeseriesFormulaRequestQueries: - description: List of queries to be run and used as inputs to the formulas. - items: - $ref: '#/components/schemas/TimeseriesQuery' - type: array - TimeseriesFormulaRequestType: - default: timeseries_request - description: The type of the resource. The value should always be timeseries_request. - enum: - - timeseries_request - example: timeseries_request - type: string - x-enum-varnames: - - TIMESERIES_REQUEST - TimeseriesFormulaResponseType: - default: timeseries_response - description: The type of the resource. The value should always be timeseries_response. - enum: - - timeseries_response - example: timeseries_response - type: string - x-enum-varnames: - - TIMESERIES_RESPONSE - TimeseriesQuery: - description: An individual timeseries query to one of the basic Datadog data - sources. - oneOf: - - $ref: '#/components/schemas/MetricsTimeseriesQuery' - - $ref: '#/components/schemas/EventsTimeseriesQuery' + TeamCreateRelationships: + description: Relationships formed with the team on creation + properties: + users: + $ref: '#/components/schemas/RelationshipToUsers' type: object - TimeseriesResponse: - description: A message containing the response to a timeseries query. + TeamCreateRequest: + description: Request to create a team + properties: + data: + $ref: '#/components/schemas/TeamCreate' + required: + - data + type: object + TeamData: + description: A team properties: attributes: - $ref: '#/components/schemas/TimeseriesResponseAttributes' + $ref: '#/components/schemas/TeamAttributes' + id: + description: The team's identifier + example: aeadc05e-98a8-11ec-ac2c-da7ad0900001 + type: string type: - $ref: '#/components/schemas/TimeseriesFormulaResponseType' + $ref: '#/components/schemas/TeamType' + required: + - attributes + - id + - type type: object - TimeseriesResponseAttributes: - description: The object describing a timeseries response. + TeamIncluded: + description: Included resources related to the team + oneOf: + - $ref: '#/components/schemas/User' + - $ref: '#/components/schemas/TeamLink' + - $ref: '#/components/schemas/UserTeamPermission' + properties: {} + type: object + TeamLink: + description: Team link properties: - series: - $ref: '#/components/schemas/TimeseriesResponseSeriesList' - times: - $ref: '#/components/schemas/TimeseriesResponseTimes' - values: - $ref: '#/components/schemas/TimeseriesResponseValuesList' + attributes: + $ref: '#/components/schemas/TeamLinkAttributes' + id: + description: The team link's identifier + example: b8626d7e-cedd-11eb-abf5-da7ad0900001 + type: string + type: + $ref: '#/components/schemas/TeamLinkType' + required: + - attributes + - id + - type type: object - TimeseriesResponseSeries: - description: '' + TeamLinkAttributes: + description: Team link attributes properties: - group_tags: - $ref: '#/components/schemas/GroupTags' - query_index: - description: The index of the query in the "formulas" array (or "queries" - array if no "formulas" was specified). - example: 0 + label: + description: The link's label + example: Link label + maxLength: 256 + type: string + position: + description: The link's position, used to sort links for the team format: int32 maximum: 2147483647 type: integer - unit: - description: 'Detailed information about the unit. - - The first element describes the "primary unit" (for example, `bytes` in - `bytes per second`). - - The second element describes the "per unit" (for example, `second` in - `bytes per second`). - - If the second element is not present, the API returns null.' - items: - $ref: '#/components/schemas/Unit' - type: array + team_id: + description: ID of the team the link is associated with + readOnly: true + type: string + url: + description: The URL for the link + example: https://example.com + type: string + required: + - label + - url type: object - TimeseriesResponseSeriesList: - description: Array of response series. The index here corresponds to the index - in the `formulas` or `queries` array from the request. - items: - $ref: '#/components/schemas/TimeseriesResponseSeries' - type: array - TimeseriesResponseTimes: - description: Array of times, 1-1 match with individual values arrays. - items: - description: Start date (inclusive) of the query in seconds since the Unix - epoch. + TeamLinkCreate: + description: Team link create + properties: + attributes: + $ref: '#/components/schemas/TeamLinkAttributes' + type: + $ref: '#/components/schemas/TeamLinkType' + required: + - attributes + - type + type: object + TeamLinkCreateRequest: + description: Team link create request + properties: + data: + $ref: '#/components/schemas/TeamLinkCreate' + required: + - data + type: object + TeamLinkResponse: + description: Team link response + properties: + data: + $ref: '#/components/schemas/TeamLink' + type: object + TeamLinkType: + default: team_links + description: Team link type + enum: + - team_links + example: team_links + type: string + x-enum-varnames: + - TEAM_LINKS + TeamLinksResponse: + description: Team links response + properties: + data: + description: Team links response data + items: + $ref: '#/components/schemas/TeamLink' + type: array + type: object + TeamPermissionSetting: + description: Team permission setting + properties: + attributes: + $ref: '#/components/schemas/TeamPermissionSettingAttributes' + id: + description: The team permission setting's identifier + example: TeamPermission-aeadc05e-98a8-11ec-ac2c-da7ad0900001-edit + type: string + type: + $ref: '#/components/schemas/TeamPermissionSettingType' + required: + - id + - type + type: object + TeamPermissionSettingAttributes: + description: Team permission setting attributes + properties: + action: + $ref: '#/components/schemas/TeamPermissionSettingSerializerAction' + editable: + description: Whether or not the permission setting is editable by the current + user + readOnly: true + type: boolean + options: + $ref: '#/components/schemas/TeamPermissionSettingValues' + title: + description: The team permission name + readOnly: true + type: string + value: + $ref: '#/components/schemas/TeamPermissionSettingValue' + type: object + TeamPermissionSettingResponse: + description: Team permission setting response + properties: + data: + $ref: '#/components/schemas/TeamPermissionSetting' + type: object + TeamPermissionSettingSerializerAction: + description: The identifier for the action + enum: + - manage_membership + - edit + readOnly: true + type: string + x-enum-varnames: + - MANAGE_MEMBERSHIP + - EDIT + TeamPermissionSettingType: + default: team_permission_settings + description: Team permission setting type + enum: + - team_permission_settings + example: team_permission_settings + type: string + x-enum-varnames: + - TEAM_PERMISSION_SETTINGS + TeamPermissionSettingUpdate: + description: Team permission setting update + properties: + attributes: + $ref: '#/components/schemas/TeamPermissionSettingUpdateAttributes' + type: + $ref: '#/components/schemas/TeamPermissionSettingType' + required: + - type + type: object + TeamPermissionSettingUpdateAttributes: + description: Team permission setting update attributes + properties: + value: + $ref: '#/components/schemas/TeamPermissionSettingValue' + type: object + TeamPermissionSettingUpdateRequest: + description: Team permission setting update request + properties: + data: + $ref: '#/components/schemas/TeamPermissionSettingUpdate' + required: + - data + type: object + TeamPermissionSettingValue: + description: What type of user is allowed to perform the specified action + enum: + - admins + - members + - organization + - user_access_manage + - teams_manage + type: string + x-enum-varnames: + - ADMINS + - MEMBERS + - ORGANIZATION + - USER_ACCESS_MANAGE + - TEAMS_MANAGE + TeamPermissionSettingValues: + description: Possible values for action + items: + $ref: '#/components/schemas/TeamPermissionSettingValue' + readOnly: true + type: array + TeamPermissionSettingsResponse: + description: Team permission settings response + properties: + data: + description: Team permission settings response data + items: + $ref: '#/components/schemas/TeamPermissionSetting' + type: array + type: object + TeamRelationships: + description: Resources related to a team + properties: + team_links: + $ref: '#/components/schemas/RelationshipToTeamLinks' + user_team_permissions: + $ref: '#/components/schemas/RelationshipToUserTeamPermission' + type: object + TeamResponse: + description: Response with a team + properties: + data: + $ref: '#/components/schemas/TeamData' + type: object + TeamType: + default: team + description: Team type + enum: + - team + example: team + type: string + x-enum-varnames: + - TEAM + TeamUpdate: + description: Team update request + properties: + attributes: + $ref: '#/components/schemas/TeamUpdateAttributes' + relationships: + $ref: '#/components/schemas/TeamUpdateRelationships' + type: + $ref: '#/components/schemas/TeamType' + required: + - attributes + - type + type: object + TeamUpdateAttributes: + description: Team update attributes + properties: + color: + description: An identifier for the color representing the team + format: int32 + maximum: 13 + minimum: 0 + type: integer + description: + description: Free-form markdown description/content for the team's homepage + type: string + handle: + description: The team's identifier + example: example-team + maxLength: 64 + type: string + link_count: + description: The number of links belonging to the team + format: int32 + maximum: 2147483647 + readOnly: true + type: integer + name: + description: The name of the team + example: Example Team + maxLength: 64 + type: string + required: + - handle + - name + type: object + TeamUpdateRelationships: + description: Team update relationships + properties: + team_links: + $ref: '#/components/schemas/RelationshipToTeamLinks' + type: object + TeamUpdateRequest: + description: Team update request + properties: + data: + $ref: '#/components/schemas/TeamUpdate' + required: + - data + type: object + TeamsResponse: + description: Response with multiple teams + properties: + data: + description: Teams response data + items: + $ref: '#/components/schemas/Team' + type: array + included: + description: Resources related to the team + items: + $ref: '#/components/schemas/TeamIncluded' + type: array + type: object + TimeseriesFormulaQueryRequest: + description: A request wrapper around a single timeseries query to be executed. + properties: + data: + $ref: '#/components/schemas/TimeseriesFormulaRequest' + required: + - data + type: object + TimeseriesFormulaQueryResponse: + description: A message containing one response to a timeseries query made with + timeseries formula query request. + properties: + data: + $ref: '#/components/schemas/TimeseriesResponse' + errors: + description: The error generated by the request. + type: string + type: object + TimeseriesFormulaRequest: + description: A single timeseries query to be executed. + properties: + attributes: + $ref: '#/components/schemas/TimeseriesFormulaRequestAttributes' + type: + $ref: '#/components/schemas/TimeseriesFormulaRequestType' + required: + - type + - attributes + type: object + TimeseriesFormulaRequestAttributes: + description: The object describing a timeseries formula request. + properties: + formulas: + description: List of formulas to be calculated and returned as responses. + items: + $ref: '#/components/schemas/QueryFormula' + type: array + from: + description: Start date (inclusive) of the query in milliseconds since the + Unix epoch. + example: 1568899800000 + format: int64 + type: integer + interval: + description: 'A time interval in milliseconds. + + May be overridden by a larger interval if the query would result in + + too many points for the specified timeframe. + + Defaults to a reasonable interval for the given timeframe.' + example: 5000 + format: int64 + type: integer + queries: + $ref: '#/components/schemas/TimeseriesFormulaRequestQueries' + to: + description: End date (exclusive) of the query in milliseconds since the + Unix epoch. + example: 1568923200000 + format: int64 + type: integer + required: + - to + - from + - queries + type: object + TimeseriesFormulaRequestQueries: + description: List of queries to be run and used as inputs to the formulas. + items: + $ref: '#/components/schemas/TimeseriesQuery' + type: array + TimeseriesFormulaRequestType: + default: timeseries_request + description: The type of the resource. The value should always be timeseries_request. + enum: + - timeseries_request + example: timeseries_request + type: string + x-enum-varnames: + - TIMESERIES_REQUEST + TimeseriesFormulaResponseType: + default: timeseries_response + description: The type of the resource. The value should always be timeseries_response. + enum: + - timeseries_response + example: timeseries_response + type: string + x-enum-varnames: + - TIMESERIES_RESPONSE + TimeseriesQuery: + description: An individual timeseries query to one of the basic Datadog data + sources. + oneOf: + - $ref: '#/components/schemas/MetricsTimeseriesQuery' + - $ref: '#/components/schemas/EventsTimeseriesQuery' + type: object + TimeseriesResponse: + description: A message containing the response to a timeseries query. + properties: + attributes: + $ref: '#/components/schemas/TimeseriesResponseAttributes' + type: + $ref: '#/components/schemas/TimeseriesFormulaResponseType' + type: object + TimeseriesResponseAttributes: + description: The object describing a timeseries response. + properties: + series: + $ref: '#/components/schemas/TimeseriesResponseSeriesList' + times: + $ref: '#/components/schemas/TimeseriesResponseTimes' + values: + $ref: '#/components/schemas/TimeseriesResponseValuesList' + type: object + TimeseriesResponseSeries: + description: '' + properties: + group_tags: + $ref: '#/components/schemas/GroupTags' + query_index: + description: The index of the query in the "formulas" array (or "queries" + array if no "formulas" was specified). + example: 0 + format: int32 + maximum: 2147483647 + type: integer + unit: + description: 'Detailed information about the unit. + + The first element describes the "primary unit" (for example, `bytes` in + `bytes per second`). + + The second element describes the "per unit" (for example, `second` in + `bytes per second`). + + If the second element is not present, the API returns null.' + items: + $ref: '#/components/schemas/Unit' + type: array + type: object + TimeseriesResponseSeriesList: + description: Array of response series. The index here corresponds to the index + in the `formulas` or `queries` array from the request. + items: + $ref: '#/components/schemas/TimeseriesResponseSeries' + type: array + TimeseriesResponseTimes: + description: Array of times, 1-1 match with individual values arrays. + items: + description: Start date (inclusive) of the query in seconds since the Unix + epoch. example: 1568899800000 format: int64 type: integer @@ -13247,6 +13784,148 @@ components: roles: $ref: '#/components/schemas/RelationshipToRoles' type: object + UserTeam: + description: A user's relationship with a team + properties: + attributes: + $ref: '#/components/schemas/UserTeamAttributes' + id: + description: The ID of a user's relationship with a team + example: TeamMembership-aeadc05e-98a8-11ec-ac2c-da7ad0900001-38835 + type: string + relationships: + $ref: '#/components/schemas/UserTeamRelationships' + type: + $ref: '#/components/schemas/UserTeamType' + required: + - id + - type + type: object + UserTeamAttributes: + description: Team membership attributes + properties: + role: + $ref: '#/components/schemas/UserTeamRole' + type: object + UserTeamCreate: + description: A user's relationship with a team + properties: + attributes: + $ref: '#/components/schemas/UserTeamAttributes' + relationships: + $ref: '#/components/schemas/UserTeamRelationships' + type: + $ref: '#/components/schemas/UserTeamType' + required: + - type + type: object + UserTeamPermission: + description: A user's permissions for a given team + properties: + attributes: + $ref: '#/components/schemas/UserTeamPermissionAttributes' + id: + description: The user team permission's identifier + example: UserTeamPermissions-aeadc05e-98a8-11ec-ac2c-da7ad0900001-416595 + type: string + type: + $ref: '#/components/schemas/UserTeamPermissionType' + required: + - id + - type + type: object + UserTeamPermissionAttributes: + description: User team permission attributes + properties: + permissions: + description: Object of team permission actions and boolean values indicating + of the currently logged in user can perform them on this team + readOnly: true + type: object + type: object + UserTeamPermissionType: + default: user_team_permissions + description: User team permission type + enum: + - user_team_permissions + example: user_team_permissions + type: string + x-enum-varnames: + - USER_TEAM_PERMISSIONS + UserTeamRelationships: + description: Relationship between membership and a user + properties: + user: + $ref: '#/components/schemas/RelationshipToUserTeamUser' + type: object + UserTeamRequest: + description: Team membership request + properties: + data: + $ref: '#/components/schemas/UserTeamCreate' + required: + - data + type: object + UserTeamResponse: + description: Team membership response + properties: + data: + $ref: '#/components/schemas/UserTeam' + type: object + UserTeamRole: + description: The user's role within the team + enum: + - admin + nullable: true + type: string + x-enum-varnames: + - ADMIN + UserTeamType: + default: team_memberships + description: Team membership type + enum: + - team_memberships + example: team_memberships + type: string + x-enum-varnames: + - TEAM_MEMBERSHIPS + UserTeamUpdate: + description: A user's relationship with a team + properties: + attributes: + $ref: '#/components/schemas/UserTeamAttributes' + type: + $ref: '#/components/schemas/UserTeamType' + required: + - id + - type + type: object + UserTeamUpdateRequest: + description: Team membership request + properties: + data: + $ref: '#/components/schemas/UserTeamUpdate' + required: + - data + type: object + UserTeamUserType: + default: users + description: User team user type + enum: + - users + example: users + type: string + x-enum-varnames: + - USERS + UserTeamsResponse: + description: Team memberships response + properties: + data: + description: Team memberships response data + items: + $ref: '#/components/schemas/UserTeam' + type: array + type: object UserUpdateAttributes: description: Attributes of the edited user. properties: @@ -18501,8 +19180,164 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RoleResponse' + $ref: '#/components/schemas/RoleResponse' + description: OK + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Authentication error + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: [] + summary: Get a role + tags: + - Roles + x-codegen-request-body-name: body + patch: + description: Edit a role. Can only be used with application keys belonging to + administrators. + operationId: UpdateRole + parameters: + - $ref: '#/components/parameters/RoleID' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RoleUpdateRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/RoleUpdateResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Authentication error + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not found + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Unprocessable Entity + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - user_access_manage + summary: Update a role + tags: + - Roles + x-codegen-request-body-name: body + /api/v2/roles/{role_id}/clone: + post: + description: Clone an existing role + operationId: CloneRole + parameters: + - $ref: '#/components/parameters/RoleID' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RoleCloneRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/RoleResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Authentication error + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not found + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Conflict + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - user_access_manage + summary: Create a new role by cloning an existing role + tags: + - Roles + x-codegen-request-body-name: body + x-permission: OR(USER_ACCESS_MANAGE) + /api/v2/roles/{role_id}/permissions: + delete: + description: Removes a permission from a role. + operationId: RemovePermissionFromRole + parameters: + - $ref: '#/components/parameters/RoleID' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RelationshipToPermission' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PermissionsResponse' description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request '403': content: application/json: @@ -18520,36 +19355,24 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - - AuthZ: [] - summary: Get a role + - AuthZ: + - user_access_manage + summary: Revoke permission tags: - Roles x-codegen-request-body-name: body - patch: - description: Edit a role. Can only be used with application keys belonging to - administrators. - operationId: UpdateRole + get: + description: Returns a list of all permissions for a single role. + operationId: ListRolePermissions parameters: - $ref: '#/components/parameters/RoleID' - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/RoleUpdateRequest' - required: true responses: '200': content: application/json: schema: - $ref: '#/components/schemas/RoleUpdateResponse' + $ref: '#/components/schemas/PermissionsResponse' description: OK - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/APIErrorResponse' - description: Bad Request '403': content: application/json: @@ -18562,41 +19385,33 @@ paths: schema: $ref: '#/components/schemas/APIErrorResponse' description: Not found - '422': - content: - application/json: - schema: - $ref: '#/components/schemas/APIErrorResponse' - description: Unprocessable Entity '429': $ref: '#/components/responses/TooManyRequestsResponse' security: - apiKeyAuth: [] appKeyAuth: [] - - AuthZ: - - user_access_manage - summary: Update a role + - AuthZ: [] + summary: List permissions for a role tags: - Roles x-codegen-request-body-name: body - /api/v2/roles/{role_id}/clone: post: - description: Clone an existing role - operationId: CloneRole + description: Adds a permission to a role. + operationId: AddPermissionToRole parameters: - $ref: '#/components/parameters/RoleID' requestBody: content: application/json: schema: - $ref: '#/components/schemas/RoleCloneRequest' + $ref: '#/components/schemas/RelationshipToPermission' required: true responses: '200': content: application/json: schema: - $ref: '#/components/schemas/RoleResponse' + $ref: '#/components/schemas/PermissionsResponse' description: OK '400': content: @@ -18616,12 +19431,6 @@ paths: schema: $ref: '#/components/schemas/APIErrorResponse' description: Not found - '409': - content: - application/json: - schema: - $ref: '#/components/schemas/APIErrorResponse' - description: Conflict '429': $ref: '#/components/responses/TooManyRequestsResponse' security: @@ -18629,29 +19438,28 @@ paths: appKeyAuth: [] - AuthZ: - user_access_manage - summary: Create a new role by cloning an existing role + summary: Grant permission to a role tags: - Roles x-codegen-request-body-name: body - x-permission: OR(USER_ACCESS_MANAGE) - /api/v2/roles/{role_id}/permissions: + /api/v2/roles/{role_id}/users: delete: - description: Removes a permission from a role. - operationId: RemovePermissionFromRole + description: Removes a user from a role. + operationId: RemoveUserFromRole parameters: - $ref: '#/components/parameters/RoleID' requestBody: content: application/json: schema: - $ref: '#/components/schemas/RelationshipToPermission' + $ref: '#/components/schemas/RelationshipToUser' required: true responses: '200': content: application/json: schema: - $ref: '#/components/schemas/PermissionsResponse' + $ref: '#/components/schemas/UsersResponse' description: OK '400': content: @@ -18678,21 +19486,41 @@ paths: appKeyAuth: [] - AuthZ: - user_access_manage - summary: Revoke permission + summary: Remove a user from a role tags: - Roles x-codegen-request-body-name: body get: - description: Returns a list of all permissions for a single role. - operationId: ListRolePermissions + description: Gets all users of a role. + operationId: ListRoleUsers parameters: - $ref: '#/components/parameters/RoleID' + - $ref: '#/components/parameters/PageSize' + - $ref: '#/components/parameters/PageNumber' + - description: 'User attribute to order results by. Sort order is **ascending** + by default. + + Sort order is **descending** if the field is prefixed by a negative sign, + + for example `sort=-name`. Options: `name`, `email`, `status`.' + in: query + name: sort + required: false + schema: + default: name + type: string + - description: Filter all users by the given string. Defaults to no filtering. + in: query + name: filter + required: false + schema: + type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/PermissionsResponse' + $ref: '#/components/schemas/UsersResponse' description: OK '403': content: @@ -18712,27 +19540,26 @@ paths: - apiKeyAuth: [] appKeyAuth: [] - AuthZ: [] - summary: List permissions for a role + summary: Get all users of a role tags: - Roles - x-codegen-request-body-name: body post: - description: Adds a permission to a role. - operationId: AddPermissionToRole + description: Adds a user to a role. + operationId: AddUserToRole parameters: - $ref: '#/components/parameters/RoleID' requestBody: content: application/json: schema: - $ref: '#/components/schemas/RelationshipToPermission' + $ref: '#/components/schemas/RelationshipToUser' required: true responses: '200': content: application/json: schema: - $ref: '#/components/schemas/PermissionsResponse' + $ref: '#/components/schemas/UsersResponse' description: OK '400': content: @@ -18759,385 +19586,488 @@ paths: appKeyAuth: [] - AuthZ: - user_access_manage - summary: Grant permission to a role + summary: Add a user to a role tags: - Roles x-codegen-request-body-name: body - /api/v2/roles/{role_id}/users: - delete: - description: Removes a user from a role. - operationId: RemoveUserFromRole - parameters: - - $ref: '#/components/parameters/RoleID' + /api/v2/rum/analytics/aggregate: + post: + description: The API endpoint to aggregate RUM events into buckets of computed + metrics and timeseries. + operationId: AggregateRUMEvents requestBody: content: application/json: schema: - $ref: '#/components/schemas/RelationshipToUser' + $ref: '#/components/schemas/RUMAggregateRequest' required: true responses: '200': content: application/json: schema: - $ref: '#/components/schemas/UsersResponse' + $ref: '#/components/schemas/RUMAnalyticsAggregateResponse' description: OK '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/NotAuthorizedResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: [] + summary: Aggregate RUM events + tags: + - RUM + x-codegen-request-body-name: body + /api/v2/rum/applications: + get: + description: List all the RUM applications in your organization. + operationId: GetRUMApplications + responses: + '200': content: application/json: schema: - $ref: '#/components/schemas/APIErrorResponse' - description: Bad Request - '403': + $ref: '#/components/schemas/RUMApplicationsResponse' + description: OK + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: List all the RUM applications + tags: + - RUM + post: + description: Create a new RUM application in your organization. + operationId: CreateRUMApplication + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RUMApplicationCreateRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/RUMApplicationResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Create a new RUM application + tags: + - RUM + x-codegen-request-body-name: body + /api/v2/rum/applications/{id}: + delete: + description: Delete an existing RUM application in your organization. + operationId: DeleteRUMApplication + parameters: + - description: RUM application ID. + in: path + name: id + required: true + schema: + type: string + responses: + '204': + description: No Content + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Delete a RUM application + tags: + - RUM + get: + description: Get the RUM application with given ID in your organization. + operationId: GetRUMApplication + parameters: + - description: RUM application ID. + in: path + name: id + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/RUMApplicationResponse' + description: OK + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Get a RUM application + tags: + - RUM + patch: + description: Update the RUM application with given ID in your organization. + operationId: UpdateRUMApplication + parameters: + - description: RUM application ID. + in: path + name: id + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RUMApplicationUpdateRequest' + required: true + responses: + '200': content: application/json: schema: - $ref: '#/components/schemas/APIErrorResponse' - description: Authentication error + $ref: '#/components/schemas/RUMApplicationResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' '404': + $ref: '#/components/responses/NotFoundResponse' + '422': content: application/json: schema: $ref: '#/components/schemas/APIErrorResponse' - description: Not found + description: Unprocessable Entity. '429': $ref: '#/components/responses/TooManyRequestsResponse' - security: - - apiKeyAuth: [] - appKeyAuth: [] - - AuthZ: - - user_access_manage - summary: Remove a user from a role + summary: Update a RUM application tags: - - Roles + - RUM x-codegen-request-body-name: body + /api/v2/rum/events: get: - description: Gets all users of a role. - operationId: ListRoleUsers - parameters: - - $ref: '#/components/parameters/RoleID' - - $ref: '#/components/parameters/PageSize' - - $ref: '#/components/parameters/PageNumber' - - description: 'User attribute to order results by. Sort order is **ascending** - by default. + description: 'List endpoint returns events that match a RUM search query. - Sort order is **descending** if the field is prefixed by a negative sign, + [Results are paginated][1]. - for example `sort=-name`. Options: `name`, `email`, `status`.' + + Use this endpoint to see your latest RUM events. + + + [1]: https://docs.datadoghq.com/logs/guide/collect-multiple-logs-with-pagination' + operationId: ListRUMEvents + parameters: + - description: Search query following RUM syntax. + example: '@type:session @application_id:xxxx' in: query - name: sort + name: filter[query] required: false schema: - default: name type: string - - description: Filter all users by the given string. Defaults to no filtering. + - description: Minimum timestamp for requested events. + example: '2019-01-02T09:42:36.320Z' in: query - name: filter + name: filter[from] + required: false + schema: + format: date-time + type: string + - description: Maximum timestamp for requested events. + example: '2019-01-03T09:42:36.320Z' + in: query + name: filter[to] + required: false + schema: + format: date-time + type: string + - description: Order of events in results. + in: query + name: sort + required: false + schema: + $ref: '#/components/schemas/RUMSort' + - description: List following results with a cursor provided in the previous + query. + example: eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ== + in: query + name: page[cursor] required: false schema: type: string + - description: Maximum number of events in the response. + example: 25 + in: query + name: page[limit] + required: false + schema: + default: 10 + format: int32 + maximum: 1000 + type: integer responses: '200': content: application/json: schema: - $ref: '#/components/schemas/UsersResponse' + $ref: '#/components/schemas/RUMEventsResponse' description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' '403': - content: - application/json: - schema: - $ref: '#/components/schemas/APIErrorResponse' - description: Authentication error - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/APIErrorResponse' - description: Not found + $ref: '#/components/responses/NotAuthorizedResponse' '429': $ref: '#/components/responses/TooManyRequestsResponse' security: - apiKeyAuth: [] appKeyAuth: [] - AuthZ: [] - summary: Get all users of a role + summary: Get a list of RUM events tags: - - Roles + - RUM + x-pagination: + cursorParam: page[cursor] + cursorPath: meta.page.after + limitParam: page[limit] + resultsPath: data + /api/v2/rum/events/search: post: - description: Adds a user to a role. - operationId: AddUserToRole - parameters: - - $ref: '#/components/parameters/RoleID' + description: 'List endpoint returns RUM events that match a RUM search query. + + [Results are paginated][1]. + + + Use this endpoint to build complex RUM events filtering and search. + + + [1]: https://docs.datadoghq.com/logs/guide/collect-multiple-logs-with-pagination' + operationId: SearchRUMEvents requestBody: content: application/json: schema: - $ref: '#/components/schemas/RelationshipToUser' + $ref: '#/components/schemas/RUMSearchEventsRequest' required: true responses: '200': content: application/json: schema: - $ref: '#/components/schemas/UsersResponse' + $ref: '#/components/schemas/RUMEventsResponse' description: OK '400': - content: - application/json: - schema: - $ref: '#/components/schemas/APIErrorResponse' - description: Bad Request + $ref: '#/components/responses/BadRequestResponse' '403': - content: - application/json: - schema: - $ref: '#/components/schemas/APIErrorResponse' - description: Authentication error - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/APIErrorResponse' - description: Not found + $ref: '#/components/responses/NotAuthorizedResponse' '429': $ref: '#/components/responses/TooManyRequestsResponse' security: - apiKeyAuth: [] appKeyAuth: [] - - AuthZ: - - user_access_manage - summary: Add a user to a role + - AuthZ: [] + summary: Search RUM events tags: - - Roles + - RUM x-codegen-request-body-name: body - /api/v2/rum/analytics/aggregate: + x-pagination: + cursorParam: body.page.cursor + cursorPath: meta.page.after + limitParam: body.page.limit + resultsPath: data + /api/v2/saml_configurations/idp_metadata: post: - description: The API endpoint to aggregate RUM events into buckets of computed - metrics and timeseries. - operationId: AggregateRUMEvents + description: 'Endpoint for uploading IdP metadata for SAML setup. + + + Use this endpoint to upload or replace IdP metadata for SAML login configuration.' + operationId: UploadIdPMetadata requestBody: content: - application/json: + multipart/form-data: schema: - $ref: '#/components/schemas/RUMAggregateRequest' + $ref: '#/components/schemas/IdPMetadataFormData' required: true responses: '200': + description: OK + '400': content: application/json: schema: - $ref: '#/components/schemas/RUMAnalyticsAggregateResponse' + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Forbidden + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Upload IdP metadata + tags: + - Organizations + x-codegen-request-body-name: body + /api/v2/security/cloud_workload/policy/download: + get: + description: 'The download endpoint generates a Cloud Workload Security policy + file from your currently active + + Cloud Workload Security rules, and downloads them as a .policy file. This + file can then be deployed to + + your Agents to update the policy running in your environment.' + operationId: DownloadCloudWorkloadPolicyFile + responses: + '200': + content: + application/yaml: + schema: + format: binary + type: string description: OK - '400': - $ref: '#/components/responses/BadRequestResponse' '403': $ref: '#/components/responses/NotAuthorizedResponse' '429': $ref: '#/components/responses/TooManyRequestsResponse' - security: - - apiKeyAuth: [] - appKeyAuth: [] - - AuthZ: [] - summary: Aggregate RUM events + summary: Get the latest Cloud Workload Security policy tags: - - RUM - x-codegen-request-body-name: body - /api/v2/rum/applications: + - Cloud Workload Security + /api/v2/security_monitoring/cloud_workload_security/agent_rules: get: - description: List all the RUM applications in your organization. - operationId: GetRUMApplications + description: Get the list of Agent rules. + operationId: ListCloudWorkloadSecurityAgentRules responses: '200': content: application/json: schema: - $ref: '#/components/schemas/RUMApplicationsResponse' + $ref: '#/components/schemas/CloudWorkloadSecurityAgentRulesListResponse' description: OK - '404': - $ref: '#/components/responses/NotFoundResponse' + '403': + $ref: '#/components/responses/NotAuthorizedResponse' '429': $ref: '#/components/responses/TooManyRequestsResponse' - summary: List all the RUM applications + summary: Get all Cloud Workload Security Agent rules tags: - - RUM + - Cloud Workload Security post: - description: Create a new RUM application in your organization. - operationId: CreateRUMApplication + description: Create a new Agent rule with the given parameters. + operationId: CreateCloudWorkloadSecurityAgentRule requestBody: content: application/json: schema: - $ref: '#/components/schemas/RUMApplicationCreateRequest' + $ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleCreateRequest' + description: The definition of the new Agent rule. required: true responses: '200': content: application/json: schema: - $ref: '#/components/schemas/RUMApplicationResponse' + $ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleResponse' description: OK '400': $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/NotAuthorizedResponse' + '409': + $ref: '#/components/responses/ConflictResponse' '429': $ref: '#/components/responses/TooManyRequestsResponse' - summary: Create a new RUM application + summary: Create a Cloud Workload Security Agent rule tags: - - RUM + - Cloud Workload Security x-codegen-request-body-name: body - /api/v2/rum/applications/{id}: + /api/v2/security_monitoring/cloud_workload_security/agent_rules/{agent_rule_id}: delete: - description: Delete an existing RUM application in your organization. - operationId: DeleteRUMApplication + description: Delete a specific Agent rule. + operationId: DeleteCloudWorkloadSecurityAgentRule parameters: - - description: RUM application ID. - in: path - name: id - required: true - schema: - type: string + - $ref: '#/components/parameters/CloudWorkloadSecurityAgentRuleID' responses: '204': - description: No Content + description: OK + '403': + $ref: '#/components/responses/NotAuthorizedResponse' '404': $ref: '#/components/responses/NotFoundResponse' '429': $ref: '#/components/responses/TooManyRequestsResponse' - summary: Delete a RUM application + summary: Delete a Cloud Workload Security Agent rule tags: - - RUM + - Cloud Workload Security get: - description: Get the RUM application with given ID in your organization. - operationId: GetRUMApplication + description: Get the details of a specific Agent rule. + operationId: GetCloudWorkloadSecurityAgentRule parameters: - - description: RUM application ID. - in: path - name: id - required: true - schema: - type: string + - $ref: '#/components/parameters/CloudWorkloadSecurityAgentRuleID' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/RUMApplicationResponse' + $ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleResponse' description: OK + '403': + $ref: '#/components/responses/NotAuthorizedResponse' '404': $ref: '#/components/responses/NotFoundResponse' '429': $ref: '#/components/responses/TooManyRequestsResponse' - summary: Get a RUM application + summary: Get a Cloud Workload Security Agent rule tags: - - RUM + - Cloud Workload Security patch: - description: Update the RUM application with given ID in your organization. - operationId: UpdateRUMApplication + description: 'Update a specific Agent rule. + + Returns the Agent rule object when the request is successful.' + operationId: UpdateCloudWorkloadSecurityAgentRule parameters: - - description: RUM application ID. - in: path - name: id - required: true - schema: - type: string + - $ref: '#/components/parameters/CloudWorkloadSecurityAgentRuleID' requestBody: content: application/json: schema: - $ref: '#/components/schemas/RUMApplicationUpdateRequest' + $ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleUpdateRequest' + description: New definition of the Agent rule. required: true responses: '200': content: application/json: schema: - $ref: '#/components/schemas/RUMApplicationResponse' + $ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleResponse' description: OK '400': $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/NotAuthorizedResponse' '404': $ref: '#/components/responses/NotFoundResponse' - '422': - content: - application/json: - schema: - $ref: '#/components/schemas/APIErrorResponse' - description: Unprocessable Entity. + '409': + $ref: '#/components/responses/ConcurrentModificationResponse' '429': $ref: '#/components/responses/TooManyRequestsResponse' - summary: Update a RUM application + summary: Update a Cloud Workload Security Agent rule tags: - - RUM + - Cloud Workload Security x-codegen-request-body-name: body - /api/v2/rum/events: + /api/v2/security_monitoring/configuration/security_filters: get: - description: 'List endpoint returns events that match a RUM search query. - - [Results are paginated][1]. - - - Use this endpoint to see your latest RUM events. - - - [1]: https://docs.datadoghq.com/logs/guide/collect-multiple-logs-with-pagination' - operationId: ListRUMEvents - parameters: - - description: Search query following RUM syntax. - example: '@type:session @application_id:xxxx' - in: query - name: filter[query] - required: false - schema: - type: string - - description: Minimum timestamp for requested events. - example: '2019-01-02T09:42:36.320Z' - in: query - name: filter[from] - required: false - schema: - format: date-time - type: string - - description: Maximum timestamp for requested events. - example: '2019-01-03T09:42:36.320Z' - in: query - name: filter[to] - required: false - schema: - format: date-time - type: string - - description: Order of events in results. - in: query - name: sort - required: false - schema: - $ref: '#/components/schemas/RUMSort' - - description: List following results with a cursor provided in the previous - query. - example: eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ== - in: query - name: page[cursor] - required: false - schema: - type: string - - description: Maximum number of events in the response. - example: 25 - in: query - name: page[limit] - required: false - schema: - default: 10 - format: int32 - maximum: 1000 - type: integer + description: Get the list of configured security filters with their definitions. + operationId: ListSecurityFilters responses: '200': content: application/json: schema: - $ref: '#/components/schemas/RUMEventsResponse' + $ref: '#/components/schemas/SecurityFiltersResponse' description: OK - '400': - $ref: '#/components/responses/BadRequestResponse' '403': $ref: '#/components/responses/NotAuthorizedResponse' '429': @@ -19145,171 +20075,207 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - - AuthZ: [] - summary: Get a list of RUM events + - AuthZ: + - security_monitoring_filters_read + summary: Get all security filters tags: - - RUM - x-pagination: - cursorParam: page[cursor] - cursorPath: meta.page.after - limitParam: page[limit] - resultsPath: data - /api/v2/rum/events/search: + - Security Monitoring post: - description: 'List endpoint returns RUM events that match a RUM search query. - - [Results are paginated][1]. - + description: 'Create a security filter. - Use this endpoint to build complex RUM events filtering and search. + See the [security filter guide](https://docs.datadoghq.com/security_platform/guide/how-to-setup-security-filters-using-security-monitoring-api/) - [1]: https://docs.datadoghq.com/logs/guide/collect-multiple-logs-with-pagination' - operationId: SearchRUMEvents + for more examples.' + operationId: CreateSecurityFilter requestBody: content: application/json: schema: - $ref: '#/components/schemas/RUMSearchEventsRequest' + $ref: '#/components/schemas/SecurityFilterCreateRequest' + description: The definition of the new security filter. required: true responses: '200': content: application/json: schema: - $ref: '#/components/schemas/RUMEventsResponse' + $ref: '#/components/schemas/SecurityFilterResponse' description: OK '400': $ref: '#/components/responses/BadRequestResponse' '403': $ref: '#/components/responses/NotAuthorizedResponse' + '409': + $ref: '#/components/responses/ConflictResponse' '429': $ref: '#/components/responses/TooManyRequestsResponse' security: - apiKeyAuth: [] appKeyAuth: [] - - AuthZ: [] - summary: Search RUM events + - AuthZ: + - security_monitoring_filters_write + summary: Create a security filter tags: - - RUM + - Security Monitoring x-codegen-request-body-name: body - x-pagination: - cursorParam: body.page.cursor - cursorPath: meta.page.after - limitParam: body.page.limit - resultsPath: data - /api/v2/saml_configurations/idp_metadata: - post: - description: 'Endpoint for uploading IdP metadata for SAML setup. + /api/v2/security_monitoring/configuration/security_filters/{security_filter_id}: + delete: + description: Delete a specific security filter. + operationId: DeleteSecurityFilter + parameters: + - $ref: '#/components/parameters/SecurityFilterID' + responses: + '204': + description: OK + '403': + $ref: '#/components/responses/NotAuthorizedResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_monitoring_filters_write + summary: Delete a security filter + tags: + - Security Monitoring + get: + description: 'Get the details of a specific security filter. - Use this endpoint to upload or replace IdP metadata for SAML login configuration.' - operationId: UploadIdPMetadata - requestBody: - content: - multipart/form-data: - schema: - $ref: '#/components/schemas/IdPMetadataFormData' - required: true + See the [security filter guide](https://docs.datadoghq.com/security_platform/guide/how-to-setup-security-filters-using-security-monitoring-api/) + + for more examples.' + operationId: GetSecurityFilter + parameters: + - $ref: '#/components/parameters/SecurityFilterID' responses: '200': - description: OK - '400': content: application/json: schema: - $ref: '#/components/schemas/APIErrorResponse' - description: Bad Request + $ref: '#/components/schemas/SecurityFilterResponse' + description: OK '403': - content: - application/json: - schema: - $ref: '#/components/schemas/APIErrorResponse' - description: Forbidden + $ref: '#/components/responses/NotAuthorizedResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' '429': $ref: '#/components/responses/TooManyRequestsResponse' - summary: Upload IdP metadata + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_monitoring_filters_read + summary: Get a security filter tags: - - Organizations - x-codegen-request-body-name: body - /api/v2/security/cloud_workload/policy/download: - get: - description: 'The download endpoint generates a Cloud Workload Security policy - file from your currently active - - Cloud Workload Security rules, and downloads them as a .policy file. This - file can then be deployed to + - Security Monitoring + patch: + description: 'Update a specific security filter. - your Agents to update the policy running in your environment.' - operationId: DownloadCloudWorkloadPolicyFile + Returns the security filter object when the request is successful.' + operationId: UpdateSecurityFilter + parameters: + - $ref: '#/components/parameters/SecurityFilterID' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SecurityFilterUpdateRequest' + description: New definition of the security filter. + required: true responses: '200': content: - application/yaml: + application/json: schema: - format: binary - type: string + $ref: '#/components/schemas/SecurityFilterResponse' description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' '403': $ref: '#/components/responses/NotAuthorizedResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '409': + $ref: '#/components/responses/ConcurrentModificationResponse' '429': $ref: '#/components/responses/TooManyRequestsResponse' - summary: Get the latest Cloud Workload Security policy + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_monitoring_filters_write + summary: Update a security filter tags: - - Cloud Workload Security - /api/v2/security_monitoring/cloud_workload_security/agent_rules: + - Security Monitoring + x-codegen-request-body-name: body + /api/v2/security_monitoring/rules: get: - description: Get the list of Agent rules. - operationId: ListCloudWorkloadSecurityAgentRules + description: List rules. + operationId: ListSecurityMonitoringRules + parameters: + - $ref: '#/components/parameters/PageSize' + - $ref: '#/components/parameters/PageNumber' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/CloudWorkloadSecurityAgentRulesListResponse' + $ref: '#/components/schemas/SecurityMonitoringListRulesResponse' description: OK - '403': - $ref: '#/components/responses/NotAuthorizedResponse' + '400': + $ref: '#/components/responses/BadRequestResponse' '429': $ref: '#/components/responses/TooManyRequestsResponse' - summary: Get all Cloud Workload Security Agent rules + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_monitoring_rules_read + summary: List rules tags: - - Cloud Workload Security + - Security Monitoring post: - description: Create a new Agent rule with the given parameters. - operationId: CreateCloudWorkloadSecurityAgentRule + description: Create a detection rule. + operationId: CreateSecurityMonitoringRule requestBody: content: application/json: schema: - $ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleCreateRequest' - description: The definition of the new Agent rule. + $ref: '#/components/schemas/SecurityMonitoringRuleCreatePayload' required: true responses: '200': content: application/json: schema: - $ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleResponse' + $ref: '#/components/schemas/SecurityMonitoringRuleResponse' description: OK '400': $ref: '#/components/responses/BadRequestResponse' '403': $ref: '#/components/responses/NotAuthorizedResponse' - '409': - $ref: '#/components/responses/ConflictResponse' '429': $ref: '#/components/responses/TooManyRequestsResponse' - summary: Create a Cloud Workload Security Agent rule + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_monitoring_rules_write + summary: Create a detection rule tags: - - Cloud Workload Security + - Security Monitoring x-codegen-request-body-name: body - /api/v2/security_monitoring/cloud_workload_security/agent_rules/{agent_rule_id}: + /api/v2/security_monitoring/rules/{rule_id}: delete: - description: Delete a specific Agent rule. - operationId: DeleteCloudWorkloadSecurityAgentRule + description: Delete an existing rule. Default rules cannot be deleted. + operationId: DeleteSecurityMonitoringRule parameters: - - $ref: '#/components/parameters/CloudWorkloadSecurityAgentRuleID' + - $ref: '#/components/parameters/SecurityMonitoringRuleID' responses: '204': description: OK @@ -19319,169 +20285,218 @@ paths: $ref: '#/components/responses/NotFoundResponse' '429': $ref: '#/components/responses/TooManyRequestsResponse' - summary: Delete a Cloud Workload Security Agent rule + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_monitoring_rules_write + summary: Delete an existing rule tags: - - Cloud Workload Security + - Security Monitoring get: - description: Get the details of a specific Agent rule. - operationId: GetCloudWorkloadSecurityAgentRule + description: Get a rule's details. + operationId: GetSecurityMonitoringRule parameters: - - $ref: '#/components/parameters/CloudWorkloadSecurityAgentRuleID' + - $ref: '#/components/parameters/SecurityMonitoringRuleID' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleResponse' + $ref: '#/components/schemas/SecurityMonitoringRuleResponse' description: OK - '403': - $ref: '#/components/responses/NotAuthorizedResponse' '404': $ref: '#/components/responses/NotFoundResponse' '429': $ref: '#/components/responses/TooManyRequestsResponse' - summary: Get a Cloud Workload Security Agent rule + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_monitoring_rules_read + summary: Get a rule's details tags: - - Cloud Workload Security - patch: - description: 'Update a specific Agent rule. + - Security Monitoring + put: + description: 'Update an existing rule. When updating `cases`, `queries` or `options`, + the whole field - Returns the Agent rule object when the request is successful.' - operationId: UpdateCloudWorkloadSecurityAgentRule + must be included. For example, when modifying a query all queries must be + included. + + Default rules can only be updated to be enabled and to change notifications.' + operationId: UpdateSecurityMonitoringRule parameters: - - $ref: '#/components/parameters/CloudWorkloadSecurityAgentRuleID' + - $ref: '#/components/parameters/SecurityMonitoringRuleID' requestBody: content: application/json: schema: - $ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleUpdateRequest' - description: New definition of the Agent rule. + $ref: '#/components/schemas/SecurityMonitoringRuleUpdatePayload' required: true responses: '200': content: application/json: schema: - $ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleResponse' + $ref: '#/components/schemas/SecurityMonitoringRuleResponse' description: OK '400': $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/ConcurrentModificationResponse' '403': $ref: '#/components/responses/NotAuthorizedResponse' '404': $ref: '#/components/responses/NotFoundResponse' - '409': - $ref: '#/components/responses/ConcurrentModificationResponse' - '429': - $ref: '#/components/responses/TooManyRequestsResponse' - summary: Update a Cloud Workload Security Agent rule - tags: - - Cloud Workload Security - x-codegen-request-body-name: body - /api/v2/security_monitoring/configuration/security_filters: - get: - description: Get the list of configured security filters with their definitions. - operationId: ListSecurityFilters - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/SecurityFiltersResponse' - description: OK - '403': - $ref: '#/components/responses/NotAuthorizedResponse' '429': $ref: '#/components/responses/TooManyRequestsResponse' security: - apiKeyAuth: [] appKeyAuth: [] - AuthZ: - - security_monitoring_filters_read - summary: Get all security filters + - security_monitoring_rules_write + summary: Update an existing rule tags: - Security Monitoring - post: - description: 'Create a security filter. - + x-codegen-request-body-name: body + /api/v2/security_monitoring/signals: + get: + description: 'The list endpoint returns security signals that match a search + query. - See the [security filter guide](https://docs.datadoghq.com/security_platform/guide/how-to-setup-security-filters-using-security-monitoring-api/) + Both this endpoint and the POST endpoint can be used interchangeably when + listing - for more examples.' - operationId: CreateSecurityFilter - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/SecurityFilterCreateRequest' - description: The definition of the new security filter. - required: true + security signals.' + operationId: ListSecurityMonitoringSignals + parameters: + - description: The search query for security signals. + example: security:attack status:high + in: query + name: filter[query] + required: false + schema: + type: string + - description: The minimum timestamp for requested security signals. + example: '2019-01-02T09:42:36.320Z' + in: query + name: filter[from] + required: false + schema: + format: date-time + type: string + - description: The maximum timestamp for requested security signals. + example: '2019-01-03T09:42:36.320Z' + in: query + name: filter[to] + required: false + schema: + format: date-time + type: string + - description: The order of the security signals in results. + in: query + name: sort + required: false + schema: + $ref: '#/components/schemas/SecurityMonitoringSignalsSort' + - description: A list of results using the cursor provided in the previous query. + example: eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ== + in: query + name: page[cursor] + required: false + schema: + type: string + - description: The maximum number of security signals in the response. + example: 25 + in: query + name: page[limit] + required: false + schema: + default: 10 + format: int32 + maximum: 1000 + type: integer responses: '200': content: application/json: schema: - $ref: '#/components/schemas/SecurityFilterResponse' + $ref: '#/components/schemas/SecurityMonitoringSignalsListResponse' description: OK '400': $ref: '#/components/responses/BadRequestResponse' '403': $ref: '#/components/responses/NotAuthorizedResponse' - '409': - $ref: '#/components/responses/ConflictResponse' '429': $ref: '#/components/responses/TooManyRequestsResponse' security: - apiKeyAuth: [] appKeyAuth: [] - AuthZ: - - security_monitoring_filters_write - summary: Create a security filter + - security_monitoring_signals_read + summary: Get a quick list of security signals tags: - Security Monitoring - x-codegen-request-body-name: body - /api/v2/security_monitoring/configuration/security_filters/{security_filter_id}: - delete: - description: Delete a specific security filter. - operationId: DeleteSecurityFilter - parameters: - - $ref: '#/components/parameters/SecurityFilterID' + x-pagination: + cursorParam: page[cursor] + cursorPath: meta.page.after + limitParam: page[limit] + resultsPath: data + /api/v2/security_monitoring/signals/search: + post: + description: 'Returns security signals that match a search query. + + Both this endpoint and the GET endpoint can be used interchangeably for listing + + security signals.' + operationId: SearchSecurityMonitoringSignals + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SecurityMonitoringSignalListRequest' + required: false responses: - '204': + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/SecurityMonitoringSignalsListResponse' description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' '403': $ref: '#/components/responses/NotAuthorizedResponse' - '404': - $ref: '#/components/responses/NotFoundResponse' '429': $ref: '#/components/responses/TooManyRequestsResponse' security: - apiKeyAuth: [] appKeyAuth: [] - AuthZ: - - security_monitoring_filters_write - summary: Delete a security filter + - security_monitoring_signals_read + summary: Get a list of security signals tags: - Security Monitoring + x-codegen-request-body-name: body + x-pagination: + cursorParam: body.page.cursor + cursorPath: meta.page.after + limitParam: body.page.limit + resultsPath: data + /api/v2/security_monitoring/signals/{signal_id}: get: - description: 'Get the details of a specific security filter. - - - See the [security filter guide](https://docs.datadoghq.com/security_platform/guide/how-to-setup-security-filters-using-security-monitoring-api/) - - for more examples.' - operationId: GetSecurityFilter + description: Get a signal's details. + operationId: GetSecurityMonitoringSignal parameters: - - $ref: '#/components/parameters/SecurityFilterID' + - $ref: '#/components/parameters/SignalID' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/SecurityFilterResponse' + $ref: '#/components/schemas/SecurityMonitoringSignal' description: OK - '403': - $ref: '#/components/responses/NotAuthorizedResponse' '404': $ref: '#/components/responses/NotFoundResponse' '429': @@ -19490,365 +20505,435 @@ paths: - apiKeyAuth: [] appKeyAuth: [] - AuthZ: - - security_monitoring_filters_read - summary: Get a security filter + - security_monitoring_signals_read + summary: Get a signal's details tags: - Security Monitoring + /api/v2/security_monitoring/signals/{signal_id}/assignee: patch: - description: 'Update a specific security filter. - - Returns the security filter object when the request is successful.' - operationId: UpdateSecurityFilter + description: Modify the triage assignee of a security signal. + operationId: EditSecurityMonitoringSignalAssignee parameters: - - $ref: '#/components/parameters/SecurityFilterID' + - $ref: '#/components/parameters/SignalID' requestBody: content: application/json: schema: - $ref: '#/components/schemas/SecurityFilterUpdateRequest' - description: New definition of the security filter. + $ref: '#/components/schemas/SecurityMonitoringSignalAssigneeUpdateRequest' + description: Attributes describing the signal update. required: true responses: '200': content: application/json: schema: - $ref: '#/components/schemas/SecurityFilterResponse' + $ref: '#/components/schemas/SecurityMonitoringSignalTriageUpdateResponse' description: OK '400': - $ref: '#/components/responses/BadRequestResponse' + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request '403': - $ref: '#/components/responses/NotAuthorizedResponse' + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Forbidden '404': - $ref: '#/components/responses/NotFoundResponse' - '409': - $ref: '#/components/responses/ConcurrentModificationResponse' + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not Found '429': $ref: '#/components/responses/TooManyRequestsResponse' - security: - - apiKeyAuth: [] - appKeyAuth: [] - - AuthZ: - - security_monitoring_filters_write - summary: Update a security filter + summary: Modify the triage assignee of a security signal tags: - Security Monitoring x-codegen-request-body-name: body - /api/v2/security_monitoring/rules: - get: - description: List rules. - operationId: ListSecurityMonitoringRules + /api/v2/security_monitoring/signals/{signal_id}/incidents: + patch: + description: Change the related incidents for a security signal. + operationId: EditSecurityMonitoringSignalIncidents parameters: - - $ref: '#/components/parameters/PageSize' - - $ref: '#/components/parameters/PageNumber' + - $ref: '#/components/parameters/SignalID' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SecurityMonitoringSignalIncidentsUpdateRequest' + description: Attributes describing the signal update. + required: true responses: '200': content: application/json: schema: - $ref: '#/components/schemas/SecurityMonitoringListRulesResponse' + $ref: '#/components/schemas/SecurityMonitoringSignalTriageUpdateResponse' description: OK '400': - $ref: '#/components/responses/BadRequestResponse' + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not Found '429': $ref: '#/components/responses/TooManyRequestsResponse' - security: - - apiKeyAuth: [] - appKeyAuth: [] - - AuthZ: - - security_monitoring_rules_read - summary: List rules + summary: Change the related incidents of a security signal tags: - Security Monitoring - post: - description: Create a detection rule. - operationId: CreateSecurityMonitoringRule + x-codegen-request-body-name: body + /api/v2/security_monitoring/signals/{signal_id}/state: + patch: + description: Change the triage state of a security signal. + operationId: EditSecurityMonitoringSignalState + parameters: + - $ref: '#/components/parameters/SignalID' requestBody: content: application/json: schema: - $ref: '#/components/schemas/SecurityMonitoringRuleCreatePayload' + $ref: '#/components/schemas/SecurityMonitoringSignalStateUpdateRequest' + description: Attributes describing the signal update. required: true responses: '200': content: application/json: schema: - $ref: '#/components/schemas/SecurityMonitoringRuleResponse' + $ref: '#/components/schemas/SecurityMonitoringSignalTriageUpdateResponse' description: OK '400': - $ref: '#/components/responses/BadRequestResponse' + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request '403': - $ref: '#/components/responses/NotAuthorizedResponse' + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not Found '429': $ref: '#/components/responses/TooManyRequestsResponse' - security: - - apiKeyAuth: [] - appKeyAuth: [] - - AuthZ: - - security_monitoring_rules_write - summary: Create a detection rule + summary: Change the triage state of a security signal tags: - Security Monitoring x-codegen-request-body-name: body - /api/v2/security_monitoring/rules/{rule_id}: - delete: - description: Delete an existing rule. Default rules cannot be deleted. - operationId: DeleteSecurityMonitoringRule - parameters: - - $ref: '#/components/parameters/SecurityMonitoringRuleID' + /api/v2/sensitive-data-scanner/config: + get: + description: List all the Scanning groups in your organization. + operationId: ListScanningGroups responses: - '204': + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/SensitiveDataScannerGetConfigResponse' description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request '403': - $ref: '#/components/responses/NotAuthorizedResponse' - '404': - $ref: '#/components/responses/NotFoundResponse' + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Authentication Error '429': $ref: '#/components/responses/TooManyRequestsResponse' - security: - - apiKeyAuth: [] - appKeyAuth: [] - - AuthZ: - - security_monitoring_rules_write - summary: Delete an existing rule + summary: List Scanning Groups tags: - - Security Monitoring - get: - description: Get a rule's details. - operationId: GetSecurityMonitoringRule - parameters: - - $ref: '#/components/parameters/SecurityMonitoringRuleID' + - Sensitive Data Scanner + patch: + description: Reorder the list of groups. + operationId: ReorderScanningGroups + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SensitiveDataScannerConfigRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/SensitiveDataScannerReorderGroupsResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Authentication Error + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Reorder Groups + tags: + - Sensitive Data Scanner + x-codegen-request-body-name: body + /api/v2/sensitive-data-scanner/config/groups: + post: + description: 'Create a scanning group. + + The request MAY include a configuration relationship. + + A rules relationship can be omitted entirely, but if it is included it MUST + be + + null or an empty array (rules cannot be created at the same time). + + The new group will be ordered last within the configuration.' + operationId: CreateScanningGroup + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SensitiveDataScannerGroupCreateRequest' + required: true responses: '200': content: application/json: schema: - $ref: '#/components/schemas/SecurityMonitoringRuleResponse' + $ref: '#/components/schemas/SensitiveDataScannerCreateGroupResponse' description: OK - '404': - $ref: '#/components/responses/NotFoundResponse' + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Authentication Error '429': $ref: '#/components/responses/TooManyRequestsResponse' - security: - - apiKeyAuth: [] - appKeyAuth: [] - - AuthZ: - - security_monitoring_rules_read - summary: Get a rule's details + summary: Create Scanning Group tags: - - Security Monitoring - put: - description: 'Update an existing rule. When updating `cases`, `queries` or `options`, - the whole field - - must be included. For example, when modifying a query all queries must be - included. - - Default rules can only be updated to be enabled and to change notifications.' - operationId: UpdateSecurityMonitoringRule + - Sensitive Data Scanner + x-codegen-request-body-name: body + /api/v2/sensitive-data-scanner/config/groups/{group_id}: + delete: + description: Delete a given group. + operationId: DeleteScanningGroup parameters: - - $ref: '#/components/parameters/SecurityMonitoringRuleID' + - $ref: '#/components/parameters/SensitiveDataScannerGroupID' requestBody: content: application/json: schema: - $ref: '#/components/schemas/SecurityMonitoringRuleUpdatePayload' + $ref: '#/components/schemas/SensitiveDataScannerGroupDeleteRequest' required: true responses: '200': content: application/json: schema: - $ref: '#/components/schemas/SecurityMonitoringRuleResponse' + $ref: '#/components/schemas/SensitiveDataScannerGroupDeleteResponse' description: OK '400': - $ref: '#/components/responses/BadRequestResponse' - '401': - $ref: '#/components/responses/ConcurrentModificationResponse' + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request '403': - $ref: '#/components/responses/NotAuthorizedResponse' - '404': - $ref: '#/components/responses/NotFoundResponse' + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Authentication Error '429': $ref: '#/components/responses/TooManyRequestsResponse' - security: - - apiKeyAuth: [] - appKeyAuth: [] - - AuthZ: - - security_monitoring_rules_write - summary: Update an existing rule + summary: Delete Scanning Group tags: - - Security Monitoring + - Sensitive Data Scanner x-codegen-request-body-name: body - /api/v2/security_monitoring/signals: - get: - description: 'The list endpoint returns security signals that match a search - query. + patch: + description: 'Update a group, including the order of the rules. - Both this endpoint and the POST endpoint can be used interchangeably when - listing + Rules within the group are reordered by including a rules relationship. If + the rules - security signals.' - operationId: ListSecurityMonitoringSignals + relationship is present, its data section MUST contain linkages for all of + the rules + + currently in the group, and MUST NOT contain any others.' + operationId: UpdateScanningGroup parameters: - - description: The search query for security signals. - example: security:attack status:high - in: query - name: filter[query] - required: false - schema: - type: string - - description: The minimum timestamp for requested security signals. - example: '2019-01-02T09:42:36.320Z' - in: query - name: filter[from] - required: false - schema: - format: date-time - type: string - - description: The maximum timestamp for requested security signals. - example: '2019-01-03T09:42:36.320Z' - in: query - name: filter[to] - required: false - schema: - format: date-time - type: string - - description: The order of the security signals in results. - in: query - name: sort - required: false - schema: - $ref: '#/components/schemas/SecurityMonitoringSignalsSort' - - description: A list of results using the cursor provided in the previous query. - example: eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ== - in: query - name: page[cursor] - required: false - schema: - type: string - - description: The maximum number of security signals in the response. - example: 25 - in: query - name: page[limit] - required: false - schema: - default: 10 - format: int32 - maximum: 1000 - type: integer + - $ref: '#/components/parameters/SensitiveDataScannerGroupID' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SensitiveDataScannerGroupUpdateRequest' + required: true responses: '200': content: application/json: schema: - $ref: '#/components/schemas/SecurityMonitoringSignalsListResponse' + $ref: '#/components/schemas/SensitiveDataScannerGroupUpdateResponse' description: OK '400': - $ref: '#/components/responses/BadRequestResponse' + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request '403': - $ref: '#/components/responses/NotAuthorizedResponse' + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Authentication Error '429': $ref: '#/components/responses/TooManyRequestsResponse' - security: - - apiKeyAuth: [] - appKeyAuth: [] - - AuthZ: - - security_monitoring_signals_read - summary: Get a quick list of security signals + summary: Update Scanning Group tags: - - Security Monitoring - x-pagination: - cursorParam: page[cursor] - cursorPath: meta.page.after - limitParam: page[limit] - resultsPath: data - /api/v2/security_monitoring/signals/search: + - Sensitive Data Scanner + x-codegen-request-body-name: body + /api/v2/sensitive-data-scanner/config/rules: post: - description: 'Returns security signals that match a search query. + description: 'Create a scanning rule in a sensitive data scanner group, ordered + last. - Both this endpoint and the GET endpoint can be used interchangeably for listing + The posted rule MUST include a group relationship. - security signals.' - operationId: SearchSecurityMonitoringSignals + It MUST include either a standard_pattern relationship or a regex attribute, + but not both. + + If included_attributes is empty or missing, we will scan all attributes except + + excluded_attributes. If both are missing, we will scan the whole event.' + operationId: CreateScanningRule requestBody: content: application/json: schema: - $ref: '#/components/schemas/SecurityMonitoringSignalListRequest' - required: false + $ref: '#/components/schemas/SensitiveDataScannerRuleCreateRequest' + required: true responses: '200': content: application/json: schema: - $ref: '#/components/schemas/SecurityMonitoringSignalsListResponse' + $ref: '#/components/schemas/SensitiveDataScannerCreateRuleResponse' description: OK '400': - $ref: '#/components/responses/BadRequestResponse' + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request '403': - $ref: '#/components/responses/NotAuthorizedResponse' + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Authentication Error '429': $ref: '#/components/responses/TooManyRequestsResponse' - security: - - apiKeyAuth: [] - appKeyAuth: [] - - AuthZ: - - security_monitoring_signals_read - summary: Get a list of security signals + summary: Create Scanning Rule tags: - - Security Monitoring + - Sensitive Data Scanner x-codegen-request-body-name: body - x-pagination: - cursorParam: body.page.cursor - cursorPath: meta.page.after - limitParam: body.page.limit - resultsPath: data - /api/v2/security_monitoring/signals/{signal_id}: - get: - description: Get a signal's details. - operationId: GetSecurityMonitoringSignal + /api/v2/sensitive-data-scanner/config/rules/{rule_id}: + delete: + description: Delete a given rule. + operationId: DeleteScanningRule parameters: - - $ref: '#/components/parameters/SignalID' + - $ref: '#/components/parameters/SensitiveDataScannerRuleID' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SensitiveDataScannerRuleDeleteRequest' + required: true responses: '200': content: application/json: schema: - $ref: '#/components/schemas/SecurityMonitoringSignal' + $ref: '#/components/schemas/SensitiveDataScannerRuleDeleteResponse' description: OK - '404': - $ref: '#/components/responses/NotFoundResponse' + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Authentication Error '429': $ref: '#/components/responses/TooManyRequestsResponse' - security: - - apiKeyAuth: [] - appKeyAuth: [] - - AuthZ: - - security_monitoring_signals_read - summary: Get a signal's details + summary: Delete Scanning Rule tags: - - Security Monitoring - /api/v2/security_monitoring/signals/{signal_id}/assignee: + - Sensitive Data Scanner + x-codegen-request-body-name: body patch: - description: Modify the triage assignee of a security signal. - operationId: EditSecurityMonitoringSignalAssignee + description: 'Update a scanning rule. + + The request body MUST NOT include a standard_pattern relationship, as that + relationship + + is non-editable. Trying to edit the regex attribute of a rule with a standard_pattern + + relationship will also result in an error.' + operationId: UpdateScanningRule parameters: - - $ref: '#/components/parameters/SignalID' + - $ref: '#/components/parameters/SensitiveDataScannerRuleID' requestBody: content: application/json: schema: - $ref: '#/components/schemas/SecurityMonitoringSignalAssigneeUpdateRequest' - description: Attributes describing the signal update. + $ref: '#/components/schemas/SensitiveDataScannerRuleUpdateRequest' required: true responses: '200': content: application/json: schema: - $ref: '#/components/schemas/SecurityMonitoringSignalTriageUpdateResponse' + $ref: '#/components/schemas/SensitiveDataScannerRuleUpdateResponse' description: OK '400': content: @@ -19861,39 +20946,80 @@ paths: application/json: schema: $ref: '#/components/schemas/APIErrorResponse' - description: Forbidden - '404': + description: Authentication Error + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Update Scanning Rule + tags: + - Sensitive Data Scanner + x-codegen-request-body-name: body + /api/v2/sensitive-data-scanner/config/standard-patterns: + get: + description: Returns all standard patterns. + operationId: ListStandardPatterns + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/SensitiveDataScannerStandardPatternsResponseData' + description: OK + '400': content: application/json: schema: $ref: '#/components/schemas/APIErrorResponse' - description: Not Found + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Authentication Error '429': $ref: '#/components/responses/TooManyRequestsResponse' - summary: Modify the triage assignee of a security signal + summary: List standard patterns tags: - - Security Monitoring - x-codegen-request-body-name: body - /api/v2/security_monitoring/signals/{signal_id}/incidents: - patch: - description: Change the related incidents for a security signal. - operationId: EditSecurityMonitoringSignalIncidents + - Sensitive Data Scanner + /api/v2/series: + post: + description: "The metrics end-point allows you to post time-series data that + can be graphed on Datadog\u2019s dashboards.\nThe maximum payload size is + 500 kilobytes (512000 bytes). Compressed payloads must have a decompressed + size of less than 5 megabytes (5242880 bytes).\n\nIf you\u2019re submitting + metrics directly to the Datadog API without using DogStatsD, expect:\n\n- + 64 bits for the timestamp\n- 64 bits for the value\n- 20 bytes for the metric + names\n- 50 bytes for the timeseries\n- The full payload is approximately + 100 bytes.\n\nHost name is one of the resources in the Resources field." + operationId: SubmitMetrics parameters: - - $ref: '#/components/parameters/SignalID' + - description: HTTP header used to compress the media-type. + in: header + name: Content-Encoding + required: false + schema: + $ref: '#/components/schemas/MetricContentEncoding' requestBody: content: application/json: + examples: + dynamic-points: + description: "Post time-series data that can be graphed on Datadog\u2019s + dashboards." + externalValue: examples/metrics/dynamic-points.json.sh + summary: Dynamic Points + x-variables: + NOW: $(date +%s) schema: - $ref: '#/components/schemas/SecurityMonitoringSignalIncidentsUpdateRequest' - description: Attributes describing the signal update. + $ref: '#/components/schemas/MetricPayload' required: true responses: - '200': + '202': content: application/json: schema: - $ref: '#/components/schemas/SecurityMonitoringSignalTriageUpdateResponse' - description: OK + $ref: '#/components/schemas/IntakePayloadAccepted' + description: Payload accepted '400': content: application/json: @@ -19905,38 +21031,43 @@ paths: application/json: schema: $ref: '#/components/schemas/APIErrorResponse' - description: Forbidden - '404': + description: Authentication error + '408': content: application/json: schema: $ref: '#/components/schemas/APIErrorResponse' - description: Not Found + description: Request timeout + '413': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Payload too large '429': $ref: '#/components/responses/TooManyRequestsResponse' - summary: Change the related incidents of a security signal + security: + - apiKeyAuth: [] + summary: Submit metrics tags: - - Security Monitoring + - Metrics x-codegen-request-body-name: body - /api/v2/security_monitoring/signals/{signal_id}/state: - patch: - description: Change the triage state of a security signal. - operationId: EditSecurityMonitoringSignalState - parameters: - - $ref: '#/components/parameters/SignalID' + /api/v2/service_accounts: + post: + description: Create a service account for your organization. + operationId: CreateServiceAccount requestBody: content: application/json: schema: - $ref: '#/components/schemas/SecurityMonitoringSignalStateUpdateRequest' - description: Attributes describing the signal update. + $ref: '#/components/schemas/ServiceAccountCreateRequest' required: true responses: - '200': + '201': content: application/json: schema: - $ref: '#/components/schemas/SecurityMonitoringSignalTriageUpdateResponse' + $ref: '#/components/schemas/UserResponse' description: OK '400': content: @@ -19949,29 +21080,31 @@ paths: application/json: schema: $ref: '#/components/schemas/APIErrorResponse' - description: Forbidden - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/APIErrorResponse' - description: Not Found + description: Authentication error '429': $ref: '#/components/responses/TooManyRequestsResponse' - summary: Change the triage state of a security signal + summary: Create a service account tags: - - Security Monitoring + - Service Accounts x-codegen-request-body-name: body - /api/v2/sensitive-data-scanner/config: + /api/v2/service_accounts/{service_account_id}/application_keys: get: - description: List all the Scanning groups in your organization. - operationId: ListScanningGroups + description: List all application keys available for this service account. + operationId: ListServiceAccountApplicationKeys + parameters: + - $ref: '#/components/parameters/ServiceAccountID' + - $ref: '#/components/parameters/PageSize' + - $ref: '#/components/parameters/PageNumber' + - $ref: '#/components/parameters/ApplicationKeysSortParameter' + - $ref: '#/components/parameters/ApplicationKeyFilterParameter' + - $ref: '#/components/parameters/ApplicationKeyFilterCreatedAtStartParameter' + - $ref: '#/components/parameters/ApplicationKeyFilterCreatedAtEndParameter' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/SensitiveDataScannerGetConfigResponse' + $ref: '#/components/schemas/ListApplicationKeysResponse' description: OK '400': content: @@ -19984,28 +21117,36 @@ paths: application/json: schema: $ref: '#/components/schemas/APIErrorResponse' - description: Authentication Error + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not Found '429': $ref: '#/components/responses/TooManyRequestsResponse' - summary: List Scanning Groups + summary: List application keys for this service account tags: - - Sensitive Data Scanner - patch: - description: Reorder the list of groups. - operationId: ReorderScanningGroups + - Service Accounts + post: + description: Create an application key for this service account. + operationId: CreateServiceAccountApplicationKey + parameters: + - $ref: '#/components/parameters/ServiceAccountID' requestBody: content: application/json: schema: - $ref: '#/components/schemas/SensitiveDataScannerConfigRequest' + $ref: '#/components/schemas/ApplicationKeyCreateRequest' required: true responses: - '200': + '201': content: application/json: schema: - $ref: '#/components/schemas/SensitiveDataScannerReorderGroupsResponse' - description: OK + $ref: '#/components/schemas/ApplicationKeyResponse' + description: Created '400': content: application/json: @@ -20017,75 +21158,88 @@ paths: application/json: schema: $ref: '#/components/schemas/APIErrorResponse' - description: Authentication Error + description: Forbidden '429': $ref: '#/components/responses/TooManyRequestsResponse' - summary: Reorder Groups + summary: Create an application key for this service account tags: - - Sensitive Data Scanner + - Service Accounts x-codegen-request-body-name: body - /api/v2/sensitive-data-scanner/config/groups: - post: - description: 'Create a scanning group. - - The request MAY include a configuration relationship. - - A rules relationship can be omitted entirely, but if it is included it MUST - be - - null or an empty array (rules cannot be created at the same time). - - The new group will be ordered last within the configuration.' - operationId: CreateScanningGroup - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/SensitiveDataScannerGroupCreateRequest' - required: true + /api/v2/service_accounts/{service_account_id}/application_keys/{app_key_id}: + delete: + description: Delete an application key owned by this service account. + operationId: DeleteServiceAccountApplicationKey + parameters: + - $ref: '#/components/parameters/ServiceAccountID' + - $ref: '#/components/parameters/ApplicationKeyID' + responses: + '204': + description: No Content + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Delete an application key for this service account + tags: + - Service Accounts + get: + description: Get an application key owned by this service account. + operationId: GetServiceAccountApplicationKey + parameters: + - $ref: '#/components/parameters/ServiceAccountID' + - $ref: '#/components/parameters/ApplicationKeyID' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/SensitiveDataScannerCreateGroupResponse' + $ref: '#/components/schemas/PartialApplicationKeyResponse' description: OK - '400': + '403': content: application/json: schema: $ref: '#/components/schemas/APIErrorResponse' - description: Bad Request - '403': + description: Forbidden + '404': content: application/json: schema: $ref: '#/components/schemas/APIErrorResponse' - description: Authentication Error + description: Not Found '429': $ref: '#/components/responses/TooManyRequestsResponse' - summary: Create Scanning Group + summary: Get one application key for this service account tags: - - Sensitive Data Scanner - x-codegen-request-body-name: body - /api/v2/sensitive-data-scanner/config/groups/{group_id}: - delete: - description: Delete a given group. - operationId: DeleteScanningGroup + - Service Accounts + patch: + description: Edit an application key owned by this service account. + operationId: UpdateServiceAccountApplicationKey parameters: - - $ref: '#/components/parameters/SensitiveDataScannerGroupID' + - $ref: '#/components/parameters/ServiceAccountID' + - $ref: '#/components/parameters/ApplicationKeyID' requestBody: content: application/json: schema: - $ref: '#/components/schemas/SensitiveDataScannerGroupDeleteRequest' + $ref: '#/components/schemas/ApplicationKeyUpdateRequest' required: true responses: '200': content: application/json: schema: - $ref: '#/components/schemas/SensitiveDataScannerGroupDeleteResponse' + $ref: '#/components/schemas/PartialApplicationKeyResponse' description: OK '400': content: @@ -20098,812 +21252,998 @@ paths: application/json: schema: $ref: '#/components/schemas/APIErrorResponse' - description: Authentication Error + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not Found '429': $ref: '#/components/responses/TooManyRequestsResponse' - summary: Delete Scanning Group + summary: Edit an application key for this service account tags: - - Sensitive Data Scanner + - Service Accounts x-codegen-request-body-name: body - patch: - description: 'Update a group, including the order of the rules. - - Rules within the group are reordered by including a rules relationship. If - the rules - - relationship is present, its data section MUST contain linkages for all of - the rules - - currently in the group, and MUST NOT contain any others.' - operationId: UpdateScanningGroup + /api/v2/services: + get: + description: Get all incident services uploaded for the requesting user's organization. + If the `include[users]` query parameter is provided, the included attribute + will contain the users related to these incident services. + operationId: ListIncidentServices parameters: - - $ref: '#/components/parameters/SensitiveDataScannerGroupID' - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/SensitiveDataScannerGroupUpdateRequest' - required: true + - $ref: '#/components/parameters/IncidentServiceIncludeQueryParameter' + - $ref: '#/components/parameters/PageSize' + - $ref: '#/components/parameters/PageOffset' + - $ref: '#/components/parameters/IncidentServiceSearchQueryParameter' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/SensitiveDataScannerGroupUpdateResponse' + $ref: '#/components/schemas/IncidentServicesResponse' description: OK '400': + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_read + summary: Get a list of all incident services + tags: + - Incident Services + x-unstable: '**Note**: This endpoint is in public beta. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + post: + description: Creates a new incident service. + operationId: CreateIncidentService + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/IncidentServiceCreateRequest' + description: Incident Service Payload. + required: true + responses: + '201': content: application/json: schema: - $ref: '#/components/schemas/APIErrorResponse' - description: Bad Request + $ref: '#/components/schemas/IncidentServiceResponse' + description: CREATED + '400': + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_settings_write + summary: Create a new incident service + tags: + - Incident Services + x-codegen-request-body-name: body + x-unstable: '**Note**: This endpoint is in public beta. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/services/definitions: + get: + description: Get a list of all service definitions from the Datadog Service + Catalog. + operationId: ListServiceDefinitions + responses: + '200': content: application/json: schema: - $ref: '#/components/schemas/APIErrorResponse' - description: Authentication Error + $ref: '#/components/schemas/ServiceDefinitionsListResponse' + description: OK + '403': + $ref: '#/components/responses/ForbiddenResponse' '429': $ref: '#/components/responses/TooManyRequestsResponse' - summary: Update Scanning Group + summary: Get all service definitions tags: - - Sensitive Data Scanner - x-codegen-request-body-name: body - /api/v2/sensitive-data-scanner/config/rules: + - Service Definition post: - description: 'Create a scanning rule in a sensitive data scanner group, ordered - last. - - The posted rule MUST include a group relationship. - - It MUST include either a standard_pattern relationship or a regex attribute, - but not both. - - If included_attributes is empty or missing, we will scan all attributes except - - excluded_attributes. If both are missing, we will scan the whole event.' - operationId: CreateScanningRule + description: Create or update service definition in the Datadog Service Catalog. + operationId: CreateOrUpdateServiceDefinitions requestBody: content: application/json: schema: - $ref: '#/components/schemas/SensitiveDataScannerRuleCreateRequest' + $ref: '#/components/schemas/ServiceDefinitionsCreateRequest' + description: Service Definition YAML/JSON. required: true responses: '200': content: application/json: schema: - $ref: '#/components/schemas/SensitiveDataScannerCreateRuleResponse' + $ref: '#/components/schemas/ServiceDefinitionCreateResponse' + description: CREATED + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '409': + $ref: '#/components/responses/ConflictResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Create or update service definition + tags: + - Service Definition + x-codegen-request-body-name: body + /api/v2/services/definitions/{service_name}: + delete: + description: Delete a single service definition in the Datadog Service Catalog. + operationId: DeleteServiceDefinition + parameters: + - $ref: '#/components/parameters/ServiceName' + responses: + '204': description: OK '400': - content: - application/json: - schema: - $ref: '#/components/schemas/APIErrorResponse' - description: Bad Request + $ref: '#/components/responses/BadRequestResponse' '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Delete a single service definition + tags: + - Service Definition + get: + description: Get a single service definition from the Datadog Service Catalog. + operationId: GetServiceDefinition + parameters: + - $ref: '#/components/parameters/ServiceName' + responses: + '200': content: application/json: schema: - $ref: '#/components/schemas/APIErrorResponse' - description: Authentication Error + $ref: '#/components/schemas/ServiceDefinitionGetResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '409': + $ref: '#/components/responses/ConflictResponse' '429': $ref: '#/components/responses/TooManyRequestsResponse' - summary: Create Scanning Rule + summary: Get a single service definition tags: - - Sensitive Data Scanner - x-codegen-request-body-name: body - /api/v2/sensitive-data-scanner/config/rules/{rule_id}: + - Service Definition + /api/v2/services/{service_id}: delete: - description: Delete a given rule. - operationId: DeleteScanningRule + description: Deletes an existing incident service. + operationId: DeleteIncidentService + parameters: + - $ref: '#/components/parameters/IncidentServiceIDPathParameter' + responses: + '204': + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_settings_write + summary: Delete an existing incident service + tags: + - Incident Services + x-unstable: '**Note**: This endpoint is in public beta. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + get: + description: 'Get details of an incident service. If the `include[users]` query + parameter is provided, + + the included attribute will contain the users related to these incident services.' + operationId: GetIncidentService parameters: - - $ref: '#/components/parameters/SensitiveDataScannerRuleID' - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/SensitiveDataScannerRuleDeleteRequest' - required: true + - $ref: '#/components/parameters/IncidentServiceIDPathParameter' + - $ref: '#/components/parameters/IncidentServiceIncludeQueryParameter' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/SensitiveDataScannerRuleDeleteResponse' + $ref: '#/components/schemas/IncidentServiceResponse' description: OK '400': - content: - application/json: - schema: - $ref: '#/components/schemas/APIErrorResponse' - description: Bad Request + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' '403': - content: - application/json: - schema: - $ref: '#/components/schemas/APIErrorResponse' - description: Authentication Error + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' '429': $ref: '#/components/responses/TooManyRequestsResponse' - summary: Delete Scanning Rule + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_read + summary: Get details of an incident service tags: - - Sensitive Data Scanner - x-codegen-request-body-name: body - patch: - description: 'Update a scanning rule. - - The request body MUST NOT include a standard_pattern relationship, as that - relationship - - is non-editable. Trying to edit the regex attribute of a rule with a standard_pattern + - Incident Services + x-unstable: '**Note**: This endpoint is in public beta. - relationship will also result in an error.' - operationId: UpdateScanningRule + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + patch: + description: Updates an existing incident service. Only provide the attributes + which should be updated as this request is a partial update. + operationId: UpdateIncidentService parameters: - - $ref: '#/components/parameters/SensitiveDataScannerRuleID' + - $ref: '#/components/parameters/IncidentServiceIDPathParameter' requestBody: content: application/json: schema: - $ref: '#/components/schemas/SensitiveDataScannerRuleUpdateRequest' + $ref: '#/components/schemas/IncidentServiceUpdateRequest' + description: Incident Service Payload. required: true responses: '200': content: application/json: schema: - $ref: '#/components/schemas/SensitiveDataScannerRuleUpdateResponse' + $ref: '#/components/schemas/IncidentServiceResponse' description: OK '400': - content: - application/json: - schema: - $ref: '#/components/schemas/APIErrorResponse' - description: Bad Request + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' '403': - content: - application/json: - schema: - $ref: '#/components/schemas/APIErrorResponse' - description: Authentication Error + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' '429': $ref: '#/components/responses/TooManyRequestsResponse' - summary: Update Scanning Rule + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_settings_write + summary: Update an existing incident service tags: - - Sensitive Data Scanner + - Incident Services x-codegen-request-body-name: body - /api/v2/sensitive-data-scanner/config/standard-patterns: + x-unstable: '**Note**: This endpoint is in public beta. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/synthetics/settings/on_demand_concurrency_cap: get: - description: Returns all standard patterns. - operationId: ListStandardPatterns + description: Get the on-demand concurrency cap. + operationId: GetOnDemandConcurrencyCap responses: '200': content: application/json: schema: - $ref: '#/components/schemas/SensitiveDataScannerStandardPatternsResponseData' + $ref: '#/components/schemas/OnDemandConcurrencyCapResponse' description: OK - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/APIErrorResponse' - description: Bad Request - '403': - content: - application/json: - schema: - $ref: '#/components/schemas/APIErrorResponse' - description: Authentication Error - '429': - $ref: '#/components/responses/TooManyRequestsResponse' - summary: List standard patterns - tags: - - Sensitive Data Scanner - /api/v2/series: - post: - description: "The metrics end-point allows you to post time-series data that - can be graphed on Datadog\u2019s dashboards.\nThe maximum payload size is - 500 kilobytes (512000 bytes). Compressed payloads must have a decompressed - size of less than 5 megabytes (5242880 bytes).\n\nIf you\u2019re submitting - metrics directly to the Datadog API without using DogStatsD, expect:\n\n- - 64 bits for the timestamp\n- 64 bits for the value\n- 20 bytes for the metric - names\n- 50 bytes for the timeseries\n- The full payload is approximately - 100 bytes.\n\nHost name is one of the resources in the Resources field." - operationId: SubmitMetrics - parameters: - - description: HTTP header used to compress the media-type. - in: header - name: Content-Encoding - required: false - schema: - $ref: '#/components/schemas/MetricContentEncoding' - requestBody: - content: - application/json: - examples: - dynamic-points: - description: "Post time-series data that can be graphed on Datadog\u2019s - dashboards." - externalValue: examples/metrics/dynamic-points.json.sh - summary: Dynamic Points - x-variables: - NOW: $(date +%s) - schema: - $ref: '#/components/schemas/MetricPayload' - required: true - responses: - '202': - content: - application/json: - schema: - $ref: '#/components/schemas/IntakePayloadAccepted' - description: Payload accepted - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/APIErrorResponse' - description: Bad Request - '403': - content: - application/json: - schema: - $ref: '#/components/schemas/APIErrorResponse' - description: Authentication error - '408': - content: - application/json: - schema: - $ref: '#/components/schemas/APIErrorResponse' - description: Request timeout - '413': - content: - application/json: - schema: - $ref: '#/components/schemas/APIErrorResponse' - description: Payload too large '429': $ref: '#/components/responses/TooManyRequestsResponse' - security: - - apiKeyAuth: [] - summary: Submit metrics + summary: Get the on-demand concurrency cap tags: - - Metrics - x-codegen-request-body-name: body - /api/v2/service_accounts: + - Synthetics post: - description: Create a service account for your organization. - operationId: CreateServiceAccount + description: Save new value for on-demand concurrency cap. + operationId: SetOnDemandConcurrencyCap requestBody: content: application/json: schema: - $ref: '#/components/schemas/ServiceAccountCreateRequest' + $ref: '#/components/schemas/OnDemandConcurrencyCapAttributes' + description: . required: true responses: - '201': + '200': content: application/json: schema: - $ref: '#/components/schemas/UserResponse' + $ref: '#/components/schemas/OnDemandConcurrencyCapResponse' description: OK - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/APIErrorResponse' - description: Bad Request - '403': - content: - application/json: - schema: - $ref: '#/components/schemas/APIErrorResponse' - description: Authentication error '429': $ref: '#/components/responses/TooManyRequestsResponse' - summary: Create a service account + summary: Save new value for on-demand concurrency cap tags: - - Service Accounts + - Synthetics x-codegen-request-body-name: body - /api/v2/service_accounts/{service_account_id}/application_keys: + /api/v2/team: get: - description: List all application keys available for this service account. - operationId: ListServiceAccountApplicationKeys + description: 'Get all teams. + + Can be used to search for teams using the `filter[keyword]` and `filter[me]` + query parameters.' + operationId: GetAllTeams parameters: - - $ref: '#/components/parameters/ServiceAccountID' - - $ref: '#/components/parameters/PageSize' - $ref: '#/components/parameters/PageNumber' - - $ref: '#/components/parameters/ApplicationKeysSortParameter' - - $ref: '#/components/parameters/ApplicationKeyFilterParameter' - - $ref: '#/components/parameters/ApplicationKeyFilterCreatedAtStartParameter' - - $ref: '#/components/parameters/ApplicationKeyFilterCreatedAtEndParameter' - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/ListApplicationKeysResponse' - description: OK - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/APIErrorResponse' - description: Bad Request - '403': - content: - application/json: - schema: - $ref: '#/components/schemas/APIErrorResponse' - description: Forbidden - '404': + - $ref: '#/components/parameters/PageSize' + - description: Specifies the order of the returned teams + in: query + name: sort + schema: + $ref: '#/components/schemas/GetAllTeamsSort' + - description: 'Included related resources optionally requested. Allowed enum + values: `team_links, user_team_permissions`' + in: query + name: include + schema: + items: + $ref: '#/components/schemas/GetAllTeamsInclude' + type: array + - description: Search query. Can be team name, team handle, or email of team + member + in: query + name: filter[keyword] + schema: + type: string + - description: When true, only returns teams the current user belongs to + in: query + name: filter[me] + schema: + type: boolean + responses: + '200': content: application/json: schema: - $ref: '#/components/schemas/APIErrorResponse' - description: Not Found + $ref: '#/components/schemas/TeamsResponse' + description: OK '429': $ref: '#/components/responses/TooManyRequestsResponse' - summary: List application keys for this service account + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - teams_read + summary: Get all teams tags: - - Service Accounts + - Teams post: - description: Create an application key for this service account. - operationId: CreateServiceAccountApplicationKey - parameters: - - $ref: '#/components/parameters/ServiceAccountID' + description: 'Create a new team. + + User IDs passed through the `users` relationship field are added to the team.' + operationId: CreateTeam requestBody: content: application/json: schema: - $ref: '#/components/schemas/ApplicationKeyCreateRequest' + $ref: '#/components/schemas/TeamCreateRequest' required: true responses: '201': content: application/json: schema: - $ref: '#/components/schemas/ApplicationKeyResponse' - description: Created - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/APIErrorResponse' - description: Bad Request - '403': + $ref: '#/components/schemas/TeamResponse' + description: CREATED + '409': content: application/json: schema: $ref: '#/components/schemas/APIErrorResponse' - description: Forbidden + description: API error response. '429': $ref: '#/components/responses/TooManyRequestsResponse' - summary: Create an application key for this service account + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - teams_read + summary: Create a team tags: - - Service Accounts + - Teams x-codegen-request-body-name: body - /api/v2/service_accounts/{service_account_id}/application_keys/{app_key_id}: + /api/v2/team/{team_id}: delete: - description: Delete an application key owned by this service account. - operationId: DeleteServiceAccountApplicationKey + description: Remove a team using the team's `id`. + operationId: RemoveTeam parameters: - - $ref: '#/components/parameters/ServiceAccountID' - - $ref: '#/components/parameters/ApplicationKeyID' + - description: None + in: path + name: team_id + required: true + schema: + type: string responses: '204': description: No Content - '403': - content: - application/json: - schema: - $ref: '#/components/schemas/APIErrorResponse' - description: Forbidden '404': content: application/json: schema: $ref: '#/components/schemas/APIErrorResponse' - description: Not Found + description: API error response. '429': $ref: '#/components/responses/TooManyRequestsResponse' - summary: Delete an application key for this service account + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - teams_read + summary: Remove a team tags: - - Service Accounts + - Teams get: - description: Get an application key owned by this service account. - operationId: GetServiceAccountApplicationKey + description: Get a single team using the team's `id`. + operationId: GetTeam parameters: - - $ref: '#/components/parameters/ServiceAccountID' - - $ref: '#/components/parameters/ApplicationKeyID' + - description: None + in: path + name: team_id + required: true + schema: + type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/PartialApplicationKeyResponse' + $ref: '#/components/schemas/TeamResponse' description: OK - '403': - content: - application/json: - schema: - $ref: '#/components/schemas/APIErrorResponse' - description: Forbidden '404': content: application/json: schema: $ref: '#/components/schemas/APIErrorResponse' - description: Not Found + description: API error response. '429': $ref: '#/components/responses/TooManyRequestsResponse' - summary: Get one application key for this service account + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - teams_read + summary: Get a team tags: - - Service Accounts + - Teams patch: - description: Edit an application key owned by this service account. - operationId: UpdateServiceAccountApplicationKey + description: 'Update a team using the team''s `id`. + + If the `team_links` relationship is present, the associated links are updated + to be in the order they appear in the array, and any existing team links not + present are removed.' + operationId: UpdateTeam parameters: - - $ref: '#/components/parameters/ServiceAccountID' - - $ref: '#/components/parameters/ApplicationKeyID' + - description: None + in: path + name: team_id + required: true + schema: + type: string requestBody: content: application/json: schema: - $ref: '#/components/schemas/ApplicationKeyUpdateRequest' + $ref: '#/components/schemas/TeamUpdateRequest' required: true responses: '200': content: application/json: schema: - $ref: '#/components/schemas/PartialApplicationKeyResponse' + $ref: '#/components/schemas/TeamResponse' description: OK '400': content: application/json: schema: $ref: '#/components/schemas/APIErrorResponse' - description: Bad Request - '403': + description: API error response. + '404': content: application/json: schema: $ref: '#/components/schemas/APIErrorResponse' - description: Forbidden - '404': + description: API error response. + '409': content: application/json: schema: $ref: '#/components/schemas/APIErrorResponse' - description: Not Found + description: API error response. '429': $ref: '#/components/responses/TooManyRequestsResponse' - summary: Edit an application key for this service account + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - teams_read + summary: Update a team tags: - - Service Accounts + - Teams x-codegen-request-body-name: body - /api/v2/services: + /api/v2/team/{team_id}/links: get: - description: Get all incident services uploaded for the requesting user's organization. - If the `include[users]` query parameter is provided, the included attribute - will contain the users related to these incident services. - operationId: ListIncidentServices + description: Get all links for a given team. + operationId: GetTeamLinks parameters: - - $ref: '#/components/parameters/IncidentServiceIncludeQueryParameter' - - $ref: '#/components/parameters/PageSize' - - $ref: '#/components/parameters/PageOffset' - - $ref: '#/components/parameters/IncidentServiceSearchQueryParameter' + - description: None + in: path + name: team_id + required: true + schema: + type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/IncidentServicesResponse' + $ref: '#/components/schemas/TeamLinksResponse' description: OK - '400': - $ref: '#/components/responses/BadRequestResponse' - '401': - $ref: '#/components/responses/UnauthorizedResponse' - '403': - $ref: '#/components/responses/ForbiddenResponse' '404': - $ref: '#/components/responses/NotFoundResponse' + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. '429': $ref: '#/components/responses/TooManyRequestsResponse' security: - apiKeyAuth: [] appKeyAuth: [] - AuthZ: - - incident_read - summary: Get a list of all incident services + - teams_read + summary: Get links for a team tags: - - Incident Services - x-unstable: '**Note**: This endpoint is in public beta. - - If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + - Teams post: - description: Creates a new incident service. - operationId: CreateIncidentService + description: Add a new link to a team. + operationId: CreateTeamLink + parameters: + - description: None + in: path + name: team_id + required: true + schema: + type: string requestBody: content: application/json: schema: - $ref: '#/components/schemas/IncidentServiceCreateRequest' - description: Incident Service Payload. + $ref: '#/components/schemas/TeamLinkCreateRequest' required: true responses: - '201': + '200': content: application/json: schema: - $ref: '#/components/schemas/IncidentServiceResponse' - description: CREATED - '400': - $ref: '#/components/responses/BadRequestResponse' - '401': - $ref: '#/components/responses/UnauthorizedResponse' - '403': - $ref: '#/components/responses/ForbiddenResponse' + $ref: '#/components/schemas/TeamLinkResponse' + description: OK '404': - $ref: '#/components/responses/NotFoundResponse' + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. '429': $ref: '#/components/responses/TooManyRequestsResponse' security: - apiKeyAuth: [] appKeyAuth: [] - AuthZ: - - incident_settings_write - summary: Create a new incident service + - teams_read + summary: Create a team link tags: - - Incident Services + - Teams x-codegen-request-body-name: body - x-unstable: '**Note**: This endpoint is in public beta. - - If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' - /api/v2/services/definitions: + /api/v2/team/{team_id}/links/{link_id}: + delete: + description: Remove a link from a team. + operationId: RemoveTeamLink + parameters: + - description: None + in: path + name: team_id + required: true + schema: + type: string + - description: None + in: path + name: link_id + required: true + schema: + type: string + responses: + '204': + description: No Content + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - teams_read + summary: Remove a team link + tags: + - Teams get: - description: Get a list of all service definitions from the Datadog Service - Catalog. - operationId: ListServiceDefinitions + description: Get a single link for a team. + operationId: GetTeamLink + parameters: + - description: None + in: path + name: team_id + required: true + schema: + type: string + - description: None + in: path + name: link_id + required: true + schema: + type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/ServiceDefinitionsListResponse' + $ref: '#/components/schemas/TeamLinkResponse' description: OK - '403': - $ref: '#/components/responses/ForbiddenResponse' + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. '429': $ref: '#/components/responses/TooManyRequestsResponse' - summary: Get all service definitions + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - teams_read + summary: Get a team link tags: - - Service Definition - post: - description: Create or update service definition in the Datadog Service Catalog. - operationId: CreateOrUpdateServiceDefinitions + - Teams + patch: + description: Update a team link. + operationId: UpdateTeamLink + parameters: + - description: None + in: path + name: team_id + required: true + schema: + type: string + - description: None + in: path + name: link_id + required: true + schema: + type: string requestBody: content: application/json: schema: - $ref: '#/components/schemas/ServiceDefinitionsCreateRequest' - description: Service Definition YAML/JSON. + $ref: '#/components/schemas/TeamLinkCreateRequest' required: true responses: '200': content: application/json: schema: - $ref: '#/components/schemas/ServiceDefinitionCreateResponse' - description: CREATED - '400': - $ref: '#/components/responses/BadRequestResponse' - '403': - $ref: '#/components/responses/ForbiddenResponse' - '409': - $ref: '#/components/responses/ConflictResponse' - '429': - $ref: '#/components/responses/TooManyRequestsResponse' - summary: Create or update service definition - tags: - - Service Definition - x-codegen-request-body-name: body - /api/v2/services/definitions/{service_name}: - delete: - description: Delete a single service definition in the Datadog Service Catalog. - operationId: DeleteServiceDefinition - parameters: - - $ref: '#/components/parameters/ServiceName' - responses: - '204': + $ref: '#/components/schemas/TeamLinkResponse' description: OK - '400': - $ref: '#/components/responses/BadRequestResponse' - '403': - $ref: '#/components/responses/ForbiddenResponse' '404': - $ref: '#/components/responses/NotFoundResponse' + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. '429': $ref: '#/components/responses/TooManyRequestsResponse' - summary: Delete a single service definition + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - teams_read + summary: Update a team link tags: - - Service Definition + - Teams + x-codegen-request-body-name: body + /api/v2/team/{team_id}/memberships: get: - description: Get a single service definition from the Datadog Service Catalog. - operationId: GetServiceDefinition + description: Get a paginated list of members for a team + operationId: GetTeamMemberships parameters: - - $ref: '#/components/parameters/ServiceName' + - description: None + in: path + name: team_id + required: true + schema: + type: string + - $ref: '#/components/parameters/PageSize' + - $ref: '#/components/parameters/PageNumber' + - description: Specifies the order of returned team memberships + in: query + name: sort + schema: + $ref: '#/components/schemas/GetTeamMembershipsSort' + - description: Search query, can be user email or name + in: query + name: filter[keyword] + schema: + type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/ServiceDefinitionGetResponse' - description: OK - '400': - $ref: '#/components/responses/BadRequestResponse' - '403': - $ref: '#/components/responses/ForbiddenResponse' + $ref: '#/components/schemas/UserTeamsResponse' + description: Represents a user's association to a team '404': - $ref: '#/components/responses/NotFoundResponse' - '409': - $ref: '#/components/responses/ConflictResponse' + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. '429': $ref: '#/components/responses/TooManyRequestsResponse' - summary: Get a single service definition + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - teams_read + summary: Get team memberships tags: - - Service Definition - /api/v2/services/{service_id}: - delete: - description: Deletes an existing incident service. - operationId: DeleteIncidentService + - Teams + post: + description: Add a user to a team. + operationId: CreateTeamMembership parameters: - - $ref: '#/components/parameters/IncidentServiceIDPathParameter' + - description: None + in: path + name: team_id + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UserTeamRequest' + required: true responses: - '204': - description: OK - '400': - $ref: '#/components/responses/BadRequestResponse' - '401': - $ref: '#/components/responses/UnauthorizedResponse' - '403': - $ref: '#/components/responses/ForbiddenResponse' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/UserTeamResponse' + description: Represents a user's association to a team '404': - $ref: '#/components/responses/NotFoundResponse' + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. '429': $ref: '#/components/responses/TooManyRequestsResponse' security: - apiKeyAuth: [] appKeyAuth: [] - AuthZ: - - incident_settings_write - summary: Delete an existing incident service + - teams_read + summary: Add a user to a team tags: - - Incident Services - x-unstable: '**Note**: This endpoint is in public beta. - - If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' - get: - description: 'Get details of an incident service. If the `include[users]` query - parameter is provided, - - the included attribute will contain the users related to these incident services.' - operationId: GetIncidentService + - Teams + x-codegen-request-body-name: body + /api/v2/team/{team_id}/memberships/{user_id}: + delete: + description: Remove a user from a team. + operationId: RemoveTeamMembership parameters: - - $ref: '#/components/parameters/IncidentServiceIDPathParameter' - - $ref: '#/components/parameters/IncidentServiceIncludeQueryParameter' + - description: None + in: path + name: team_id + required: true + schema: + type: string + - description: None + in: path + name: user_id + required: true + schema: + type: string responses: - '200': + '204': + description: No Content + '404': content: application/json: schema: - $ref: '#/components/schemas/IncidentServiceResponse' - description: OK - '400': - $ref: '#/components/responses/BadRequestResponse' - '401': - $ref: '#/components/responses/UnauthorizedResponse' - '403': - $ref: '#/components/responses/ForbiddenResponse' - '404': - $ref: '#/components/responses/NotFoundResponse' + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. '429': $ref: '#/components/responses/TooManyRequestsResponse' security: - apiKeyAuth: [] appKeyAuth: [] - AuthZ: - - incident_read - summary: Get details of an incident service + - teams_read + summary: Remove a user from a team tags: - - Incident Services - x-unstable: '**Note**: This endpoint is in public beta. - - If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + - Teams patch: - description: Updates an existing incident service. Only provide the attributes - which should be updated as this request is a partial update. - operationId: UpdateIncidentService + description: Update a user's membership attributes on a team. + operationId: UpdateTeamMembership parameters: - - $ref: '#/components/parameters/IncidentServiceIDPathParameter' + - description: None + in: path + name: team_id + required: true + schema: + type: string + - description: None + in: path + name: user_id + required: true + schema: + type: string requestBody: content: application/json: schema: - $ref: '#/components/schemas/IncidentServiceUpdateRequest' - description: Incident Service Payload. + $ref: '#/components/schemas/UserTeamUpdateRequest' required: true responses: '200': content: application/json: schema: - $ref: '#/components/schemas/IncidentServiceResponse' - description: OK - '400': - $ref: '#/components/responses/BadRequestResponse' - '401': - $ref: '#/components/responses/UnauthorizedResponse' - '403': - $ref: '#/components/responses/ForbiddenResponse' + $ref: '#/components/schemas/UserTeamResponse' + description: Represents a user's association to a team '404': - $ref: '#/components/responses/NotFoundResponse' + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. '429': $ref: '#/components/responses/TooManyRequestsResponse' security: - apiKeyAuth: [] appKeyAuth: [] - AuthZ: - - incident_settings_write - summary: Update an existing incident service + - teams_read + summary: Update a user's membership attributes on a team tags: - - Incident Services + - Teams x-codegen-request-body-name: body - x-unstable: '**Note**: This endpoint is in public beta. - - If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' - /api/v2/synthetics/settings/on_demand_concurrency_cap: + /api/v2/team/{team_id}/permission-settings: get: - description: Get the on-demand concurrency cap. - operationId: GetOnDemandConcurrencyCap + description: Get all permission settings for a given team. + operationId: GetTeamPermissionSettings + parameters: + - description: None + in: path + name: team_id + required: true + schema: + type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/OnDemandConcurrencyCapResponse' + $ref: '#/components/schemas/TeamPermissionSettingsResponse' description: OK + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. '429': $ref: '#/components/responses/TooManyRequestsResponse' - summary: Get the on-demand concurrency cap + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - teams_read + summary: Get permission settings for a team tags: - - Synthetics - post: - description: Save new value for on-demand concurrency cap. - operationId: SetOnDemandConcurrencyCap + - Teams + /api/v2/team/{team_id}/permission-settings/{action}: + put: + description: Update a team permission setting for a given team. + operationId: UpdateTeamPermissionSetting + parameters: + - description: None + in: path + name: team_id + required: true + schema: + type: string + - description: None + in: path + name: action + required: true + schema: + type: string requestBody: content: application/json: schema: - $ref: '#/components/schemas/OnDemandConcurrencyCapAttributes' - description: . + $ref: '#/components/schemas/TeamPermissionSettingUpdateRequest' required: true responses: '200': content: application/json: schema: - $ref: '#/components/schemas/OnDemandConcurrencyCapResponse' + $ref: '#/components/schemas/TeamPermissionSettingResponse' description: OK + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. '429': $ref: '#/components/responses/TooManyRequestsResponse' - summary: Save new value for on-demand concurrency cap + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - teams_read + summary: Update permission setting for team tags: - - Synthetics + - Teams x-codegen-request-body-name: body /api/v2/teams: get: @@ -22203,6 +23543,8 @@ tags: use Datadog\u2019s API to\nmanage both test types programmatically.\n\nFor more information about Synthetics, see the [Synthetics overview](https://docs.datadoghq.com/synthetics/)." name: Synthetics +- description: View and manage teams within Datadog. + name: Teams - description: 'The usage metering API allows you to get hourly, daily, and monthly usage across multiple facets of Datadog. diff --git a/examples/v2/teams/CreateTeam.java b/examples/v2/teams/CreateTeam.java new file mode 100644 index 00000000000..52b10d09a3a --- /dev/null +++ b/examples/v2/teams/CreateTeam.java @@ -0,0 +1,38 @@ +// Create a team returns "CREATED" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.TeamsApi; +import com.datadog.api.client.v2.model.RelationshipToUsers; +import com.datadog.api.client.v2.model.TeamCreate; +import com.datadog.api.client.v2.model.TeamCreateAttributes; +import com.datadog.api.client.v2.model.TeamCreateRelationships; +import com.datadog.api.client.v2.model.TeamCreateRequest; +import com.datadog.api.client.v2.model.TeamResponse; +import com.datadog.api.client.v2.model.TeamType; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + TeamsApi apiInstance = new TeamsApi(defaultClient); + + TeamCreateRequest body = + new TeamCreateRequest() + .data( + new TeamCreate() + .attributes(new TeamCreateAttributes().handle("1636629071").name("1636629071")) + .relationships(new TeamCreateRelationships().users(new RelationshipToUsers())) + .type(TeamType.TEAM)); + + try { + TeamResponse result = apiInstance.createTeam(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TeamsApi#createTeam"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/teams/CreateTeamLink.java b/examples/v2/teams/CreateTeamLink.java new file mode 100644 index 00000000000..ac7bf64408d --- /dev/null +++ b/examples/v2/teams/CreateTeamLink.java @@ -0,0 +1,42 @@ +// Create a team link returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.TeamsApi; +import com.datadog.api.client.v2.model.TeamLinkAttributes; +import com.datadog.api.client.v2.model.TeamLinkCreate; +import com.datadog.api.client.v2.model.TeamLinkCreateRequest; +import com.datadog.api.client.v2.model.TeamLinkResponse; +import com.datadog.api.client.v2.model.TeamLinkType; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + TeamsApi apiInstance = new TeamsApi(defaultClient); + + // there is a valid "dd_team" in the system + String DD_TEAM_DATA_ID = System.getenv("DD_TEAM_DATA_ID"); + + TeamLinkCreateRequest body = + new TeamLinkCreateRequest() + .data( + new TeamLinkCreate() + .attributes( + new TeamLinkAttributes() + .label("Link label") + .url("https://example.com") + .position(0)) + .type(TeamLinkType.TEAM_LINKS)); + + try { + TeamLinkResponse result = apiInstance.createTeamLink(DD_TEAM_DATA_ID, body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TeamsApi#createTeamLink"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/teams/CreateTeamMembership.java b/examples/v2/teams/CreateTeamMembership.java new file mode 100644 index 00000000000..21d1673a4c8 --- /dev/null +++ b/examples/v2/teams/CreateTeamMembership.java @@ -0,0 +1,48 @@ +// Add a user to a team returns "Represents a user's association to a team" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.TeamsApi; +import com.datadog.api.client.v2.model.RelationshipToUserTeamUser; +import com.datadog.api.client.v2.model.RelationshipToUserTeamUserData; +import com.datadog.api.client.v2.model.UserTeamAttributes; +import com.datadog.api.client.v2.model.UserTeamCreate; +import com.datadog.api.client.v2.model.UserTeamRelationships; +import com.datadog.api.client.v2.model.UserTeamRequest; +import com.datadog.api.client.v2.model.UserTeamResponse; +import com.datadog.api.client.v2.model.UserTeamRole; +import com.datadog.api.client.v2.model.UserTeamType; +import com.datadog.api.client.v2.model.UserTeamUserType; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + TeamsApi apiInstance = new TeamsApi(defaultClient); + + UserTeamRequest body = + new UserTeamRequest() + .data( + new UserTeamCreate() + .attributes(new UserTeamAttributes().role(UserTeamRole.ADMIN)) + .relationships( + new UserTeamRelationships() + .user( + new RelationshipToUserTeamUser() + .data( + new RelationshipToUserTeamUserData() + .id("b8626d7e-cedd-11eb-abf5-da7ad0900001") + .type(UserTeamUserType.USERS)))) + .type(UserTeamType.TEAM_MEMBERSHIPS)); + + try { + UserTeamResponse result = apiInstance.createTeamMembership("team_id", body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TeamsApi#createTeamMembership"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/teams/GetAllTeams.java b/examples/v2/teams/GetAllTeams.java new file mode 100644 index 00000000000..86623e3179f --- /dev/null +++ b/examples/v2/teams/GetAllTeams.java @@ -0,0 +1,24 @@ +// Get all teams returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.TeamsApi; +import com.datadog.api.client.v2.model.TeamsResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + TeamsApi apiInstance = new TeamsApi(defaultClient); + + try { + TeamsResponse result = apiInstance.getAllTeams(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TeamsApi#getAllTeams"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/teams/GetTeam.java b/examples/v2/teams/GetTeam.java new file mode 100644 index 00000000000..ced9f873cd7 --- /dev/null +++ b/examples/v2/teams/GetTeam.java @@ -0,0 +1,27 @@ +// Get a team returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.TeamsApi; +import com.datadog.api.client.v2.model.TeamResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + TeamsApi apiInstance = new TeamsApi(defaultClient); + + // there is a valid "dd_team" in the system + String DD_TEAM_DATA_ID = System.getenv("DD_TEAM_DATA_ID"); + + try { + TeamResponse result = apiInstance.getTeam(DD_TEAM_DATA_ID); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TeamsApi#getTeam"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/teams/GetTeamLink.java b/examples/v2/teams/GetTeamLink.java new file mode 100644 index 00000000000..4221a4d49c7 --- /dev/null +++ b/examples/v2/teams/GetTeamLink.java @@ -0,0 +1,30 @@ +// Get a team link returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.TeamsApi; +import com.datadog.api.client.v2.model.TeamLinkResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + TeamsApi apiInstance = new TeamsApi(defaultClient); + + // there is a valid "dd_team" in the system + String DD_TEAM_DATA_ID = System.getenv("DD_TEAM_DATA_ID"); + + // there is a valid "team_link" in the system + String TEAM_LINK_DATA_ID = System.getenv("TEAM_LINK_DATA_ID"); + + try { + TeamLinkResponse result = apiInstance.getTeamLink(DD_TEAM_DATA_ID, TEAM_LINK_DATA_ID); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TeamsApi#getTeamLink"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/teams/GetTeamLinks.java b/examples/v2/teams/GetTeamLinks.java new file mode 100644 index 00000000000..9694ad8125c --- /dev/null +++ b/examples/v2/teams/GetTeamLinks.java @@ -0,0 +1,27 @@ +// Get links for a team returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.TeamsApi; +import com.datadog.api.client.v2.model.TeamLinksResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + TeamsApi apiInstance = new TeamsApi(defaultClient); + + // there is a valid "dd_team" in the system + String DD_TEAM_DATA_ID = System.getenv("DD_TEAM_DATA_ID"); + + try { + TeamLinksResponse result = apiInstance.getTeamLinks(DD_TEAM_DATA_ID); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TeamsApi#getTeamLinks"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/teams/GetTeamMemberships.java b/examples/v2/teams/GetTeamMemberships.java new file mode 100644 index 00000000000..80bd60c2634 --- /dev/null +++ b/examples/v2/teams/GetTeamMemberships.java @@ -0,0 +1,27 @@ +// Get team memberships returns "Represents a user's association to a team" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.TeamsApi; +import com.datadog.api.client.v2.model.UserTeamsResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + TeamsApi apiInstance = new TeamsApi(defaultClient); + + // there is a valid "dd_team" in the system + String DD_TEAM_DATA_ID = System.getenv("DD_TEAM_DATA_ID"); + + try { + UserTeamsResponse result = apiInstance.getTeamMemberships(DD_TEAM_DATA_ID); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TeamsApi#getTeamMemberships"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/teams/GetTeamPermissionSettings.java b/examples/v2/teams/GetTeamPermissionSettings.java new file mode 100644 index 00000000000..c412e839874 --- /dev/null +++ b/examples/v2/teams/GetTeamPermissionSettings.java @@ -0,0 +1,28 @@ +// Get permission settings for a team returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.TeamsApi; +import com.datadog.api.client.v2.model.TeamPermissionSettingsResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + TeamsApi apiInstance = new TeamsApi(defaultClient); + + // there is a valid "dd_team" in the system + String DD_TEAM_DATA_ID = System.getenv("DD_TEAM_DATA_ID"); + + try { + TeamPermissionSettingsResponse result = + apiInstance.getTeamPermissionSettings(DD_TEAM_DATA_ID); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TeamsApi#getTeamPermissionSettings"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/teams/RemoveTeam.java b/examples/v2/teams/RemoveTeam.java new file mode 100644 index 00000000000..6cf12af79fc --- /dev/null +++ b/examples/v2/teams/RemoveTeam.java @@ -0,0 +1,25 @@ +// Remove a team returns "No Content" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.TeamsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + TeamsApi apiInstance = new TeamsApi(defaultClient); + + // there is a valid "dd_team" in the system + String DD_TEAM_DATA_ID = System.getenv("DD_TEAM_DATA_ID"); + + try { + apiInstance.removeTeam(DD_TEAM_DATA_ID); + } catch (ApiException e) { + System.err.println("Exception when calling TeamsApi#removeTeam"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/teams/RemoveTeamLink.java b/examples/v2/teams/RemoveTeamLink.java new file mode 100644 index 00000000000..4301792f33f --- /dev/null +++ b/examples/v2/teams/RemoveTeamLink.java @@ -0,0 +1,28 @@ +// Remove a team link returns "No Content" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.TeamsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + TeamsApi apiInstance = new TeamsApi(defaultClient); + + // there is a valid "dd_team" in the system + String DD_TEAM_DATA_ID = System.getenv("DD_TEAM_DATA_ID"); + + // there is a valid "team_link" in the system + String TEAM_LINK_DATA_ID = System.getenv("TEAM_LINK_DATA_ID"); + + try { + apiInstance.removeTeamLink(DD_TEAM_DATA_ID, TEAM_LINK_DATA_ID); + } catch (ApiException e) { + System.err.println("Exception when calling TeamsApi#removeTeamLink"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/teams/RemoveTeamMembership.java b/examples/v2/teams/RemoveTeamMembership.java new file mode 100644 index 00000000000..69147744c54 --- /dev/null +++ b/examples/v2/teams/RemoveTeamMembership.java @@ -0,0 +1,25 @@ +// Remove a user from a team returns "No Content" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.TeamsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + TeamsApi apiInstance = new TeamsApi(defaultClient); + + // there is a valid "dd_team" in the system + String DD_TEAM_DATA_ID = System.getenv("DD_TEAM_DATA_ID"); + + try { + apiInstance.removeTeamMembership(DD_TEAM_DATA_ID, "user_id"); + } catch (ApiException e) { + System.err.println("Exception when calling TeamsApi#removeTeamMembership"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/teams/UpdateTeam.java b/examples/v2/teams/UpdateTeam.java new file mode 100644 index 00000000000..72da2dc60da --- /dev/null +++ b/examples/v2/teams/UpdateTeam.java @@ -0,0 +1,43 @@ +// Update a team returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.TeamsApi; +import com.datadog.api.client.v2.model.TeamResponse; +import com.datadog.api.client.v2.model.TeamType; +import com.datadog.api.client.v2.model.TeamUpdate; +import com.datadog.api.client.v2.model.TeamUpdateAttributes; +import com.datadog.api.client.v2.model.TeamUpdateRequest; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + TeamsApi apiInstance = new TeamsApi(defaultClient); + + // there is a valid "dd_team" in the system + String DD_TEAM_DATA_ATTRIBUTES_HANDLE = System.getenv("DD_TEAM_DATA_ATTRIBUTES_HANDLE"); + String DD_TEAM_DATA_ATTRIBUTES_NAME = System.getenv("DD_TEAM_DATA_ATTRIBUTES_NAME"); + String DD_TEAM_DATA_ID = System.getenv("DD_TEAM_DATA_ID"); + + TeamUpdateRequest body = + new TeamUpdateRequest() + .data( + new TeamUpdate() + .attributes( + new TeamUpdateAttributes() + .handle(DD_TEAM_DATA_ATTRIBUTES_HANDLE) + .name("Example Team updated")) + .type(TeamType.TEAM)); + + try { + TeamResponse result = apiInstance.updateTeam(DD_TEAM_DATA_ID, body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TeamsApi#updateTeam"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/teams/UpdateTeamLink.java b/examples/v2/teams/UpdateTeamLink.java new file mode 100644 index 00000000000..9ef39c60e36 --- /dev/null +++ b/examples/v2/teams/UpdateTeamLink.java @@ -0,0 +1,43 @@ +// Update a team link returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.TeamsApi; +import com.datadog.api.client.v2.model.TeamLinkAttributes; +import com.datadog.api.client.v2.model.TeamLinkCreate; +import com.datadog.api.client.v2.model.TeamLinkCreateRequest; +import com.datadog.api.client.v2.model.TeamLinkResponse; +import com.datadog.api.client.v2.model.TeamLinkType; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + TeamsApi apiInstance = new TeamsApi(defaultClient); + + // there is a valid "dd_team" in the system + String DD_TEAM_DATA_ID = System.getenv("DD_TEAM_DATA_ID"); + + // there is a valid "team_link" in the system + String TEAM_LINK_DATA_ID = System.getenv("TEAM_LINK_DATA_ID"); + + TeamLinkCreateRequest body = + new TeamLinkCreateRequest() + .data( + new TeamLinkCreate() + .attributes( + new TeamLinkAttributes().label("New Label").url("https://example.com")) + .type(TeamLinkType.TEAM_LINKS)); + + try { + TeamLinkResponse result = + apiInstance.updateTeamLink(DD_TEAM_DATA_ID, TEAM_LINK_DATA_ID, body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TeamsApi#updateTeamLink"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/teams/UpdateTeamMembership.java b/examples/v2/teams/UpdateTeamMembership.java new file mode 100644 index 00000000000..18ca37e802a --- /dev/null +++ b/examples/v2/teams/UpdateTeamMembership.java @@ -0,0 +1,37 @@ +// Update a user's membership attributes on a team returns "Represents a user's association to a +// team" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.TeamsApi; +import com.datadog.api.client.v2.model.UserTeamAttributes; +import com.datadog.api.client.v2.model.UserTeamResponse; +import com.datadog.api.client.v2.model.UserTeamRole; +import com.datadog.api.client.v2.model.UserTeamType; +import com.datadog.api.client.v2.model.UserTeamUpdate; +import com.datadog.api.client.v2.model.UserTeamUpdateRequest; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + TeamsApi apiInstance = new TeamsApi(defaultClient); + + UserTeamUpdateRequest body = + new UserTeamUpdateRequest() + .data( + new UserTeamUpdate() + .attributes(new UserTeamAttributes().role(UserTeamRole.ADMIN)) + .type(UserTeamType.TEAM_MEMBERSHIPS)); + + try { + UserTeamResponse result = apiInstance.updateTeamMembership("team_id", "user_id", body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TeamsApi#updateTeamMembership"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/teams/UpdateTeamPermissionSetting.java b/examples/v2/teams/UpdateTeamPermissionSetting.java new file mode 100644 index 00000000000..8885fc23f11 --- /dev/null +++ b/examples/v2/teams/UpdateTeamPermissionSetting.java @@ -0,0 +1,42 @@ +// Update permission setting for team returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.TeamsApi; +import com.datadog.api.client.v2.model.TeamPermissionSettingResponse; +import com.datadog.api.client.v2.model.TeamPermissionSettingType; +import com.datadog.api.client.v2.model.TeamPermissionSettingUpdate; +import com.datadog.api.client.v2.model.TeamPermissionSettingUpdateAttributes; +import com.datadog.api.client.v2.model.TeamPermissionSettingUpdateRequest; +import com.datadog.api.client.v2.model.TeamPermissionSettingValue; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + TeamsApi apiInstance = new TeamsApi(defaultClient); + + // there is a valid "dd_team" in the system + String DD_TEAM_DATA_ID = System.getenv("DD_TEAM_DATA_ID"); + + TeamPermissionSettingUpdateRequest body = + new TeamPermissionSettingUpdateRequest() + .data( + new TeamPermissionSettingUpdate() + .attributes( + new TeamPermissionSettingUpdateAttributes() + .value(TeamPermissionSettingValue.ADMINS)) + .type(TeamPermissionSettingType.TEAM_PERMISSION_SETTINGS)); + + try { + TeamPermissionSettingResponse result = + apiInstance.updateTeamPermissionSetting(DD_TEAM_DATA_ID, "manage_membership", body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TeamsApi#updateTeamPermissionSetting"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/datadog/api/client/v2/api/TeamsApi.java b/src/main/java/com/datadog/api/client/v2/api/TeamsApi.java new file mode 100644 index 00000000000..4a1afc80099 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/api/TeamsApi.java @@ -0,0 +1,2682 @@ +package com.datadog.api.client.v2.api; + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.ApiResponse; +import com.datadog.api.client.Pair; +import com.datadog.api.client.v2.model.GetAllTeamsInclude; +import com.datadog.api.client.v2.model.GetAllTeamsSort; +import com.datadog.api.client.v2.model.GetTeamMembershipsSort; +import com.datadog.api.client.v2.model.TeamCreateRequest; +import com.datadog.api.client.v2.model.TeamLinkCreateRequest; +import com.datadog.api.client.v2.model.TeamLinkResponse; +import com.datadog.api.client.v2.model.TeamLinksResponse; +import com.datadog.api.client.v2.model.TeamPermissionSettingResponse; +import com.datadog.api.client.v2.model.TeamPermissionSettingUpdateRequest; +import com.datadog.api.client.v2.model.TeamPermissionSettingsResponse; +import com.datadog.api.client.v2.model.TeamResponse; +import com.datadog.api.client.v2.model.TeamUpdateRequest; +import com.datadog.api.client.v2.model.TeamsResponse; +import com.datadog.api.client.v2.model.UserTeamRequest; +import com.datadog.api.client.v2.model.UserTeamResponse; +import com.datadog.api.client.v2.model.UserTeamUpdateRequest; +import com.datadog.api.client.v2.model.UserTeamsResponse; +import jakarta.ws.rs.client.Invocation; +import jakarta.ws.rs.core.GenericType; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.CompletableFuture; + +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TeamsApi { + private ApiClient apiClient; + + public TeamsApi() { + this(ApiClient.getDefaultApiClient()); + } + + public TeamsApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Get the API client. + * + * @return API client + */ + public ApiClient getApiClient() { + return apiClient; + } + + /** + * Set the API client. + * + * @param apiClient an instance of API client + */ + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Create a team. + * + *

See {@link #createTeamWithHttpInfo}. + * + * @param body (required) + * @return TeamResponse + * @throws ApiException if fails to make API call + */ + public TeamResponse createTeam(TeamCreateRequest body) throws ApiException { + return createTeamWithHttpInfo(body).getData(); + } + + /** + * Create a team. + * + *

See {@link #createTeamWithHttpInfoAsync}. + * + * @param body (required) + * @return CompletableFuture<TeamResponse> + */ + public CompletableFuture createTeamAsync(TeamCreateRequest body) { + return createTeamWithHttpInfoAsync(body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Create a new team. User IDs passed through the users relationship field are added + * to the team. + * + * @param body (required) + * @return ApiResponse<TeamResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
201 CREATED -
409 API error response. -
429 Too many requests -
+ */ + public ApiResponse createTeamWithHttpInfo(TeamCreateRequest body) + throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException(400, "Missing the required parameter 'body' when calling createTeam"); + } + // create path and map variables + String localVarPath = "/api/v2/team"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.TeamsApi.createTeam", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Create a team. + * + *

See {@link #createTeamWithHttpInfo}. + * + * @param body (required) + * @return CompletableFuture<ApiResponse<TeamResponse>> + */ + public CompletableFuture> createTeamWithHttpInfoAsync( + TeamCreateRequest body) { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(400, "Missing the required parameter 'body' when calling createTeam")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/team"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.TeamsApi.createTeam", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Create a team link. + * + *

See {@link #createTeamLinkWithHttpInfo}. + * + * @param teamId None (required) + * @param body (required) + * @return TeamLinkResponse + * @throws ApiException if fails to make API call + */ + public TeamLinkResponse createTeamLink(String teamId, TeamLinkCreateRequest body) + throws ApiException { + return createTeamLinkWithHttpInfo(teamId, body).getData(); + } + + /** + * Create a team link. + * + *

See {@link #createTeamLinkWithHttpInfoAsync}. + * + * @param teamId None (required) + * @param body (required) + * @return CompletableFuture<TeamLinkResponse> + */ + public CompletableFuture createTeamLinkAsync( + String teamId, TeamLinkCreateRequest body) { + return createTeamLinkWithHttpInfoAsync(teamId, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Add a new link to a team. + * + * @param teamId None (required) + * @param body (required) + * @return ApiResponse<TeamLinkResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
404 API error response. -
422 API error response. -
429 Too many requests -
+ */ + public ApiResponse createTeamLinkWithHttpInfo( + String teamId, TeamLinkCreateRequest body) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'teamId' is set + if (teamId == null) { + throw new ApiException( + 400, "Missing the required parameter 'teamId' when calling createTeamLink"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling createTeamLink"); + } + // create path and map variables + String localVarPath = + "/api/v2/team/{team_id}/links" + .replaceAll("\\{" + "team_id" + "\\}", apiClient.escapeString(teamId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.TeamsApi.createTeamLink", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Create a team link. + * + *

See {@link #createTeamLinkWithHttpInfo}. + * + * @param teamId None (required) + * @param body (required) + * @return CompletableFuture<ApiResponse<TeamLinkResponse>> + */ + public CompletableFuture> createTeamLinkWithHttpInfoAsync( + String teamId, TeamLinkCreateRequest body) { + Object localVarPostBody = body; + + // verify the required parameter 'teamId' is set + if (teamId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'teamId' when calling createTeamLink")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling createTeamLink")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/team/{team_id}/links" + .replaceAll("\\{" + "team_id" + "\\}", apiClient.escapeString(teamId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.TeamsApi.createTeamLink", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Add a user to a team. + * + *

See {@link #createTeamMembershipWithHttpInfo}. + * + * @param teamId None (required) + * @param body (required) + * @return UserTeamResponse + * @throws ApiException if fails to make API call + */ + public UserTeamResponse createTeamMembership(String teamId, UserTeamRequest body) + throws ApiException { + return createTeamMembershipWithHttpInfo(teamId, body).getData(); + } + + /** + * Add a user to a team. + * + *

See {@link #createTeamMembershipWithHttpInfoAsync}. + * + * @param teamId None (required) + * @param body (required) + * @return CompletableFuture<UserTeamResponse> + */ + public CompletableFuture createTeamMembershipAsync( + String teamId, UserTeamRequest body) { + return createTeamMembershipWithHttpInfoAsync(teamId, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Add a user to a team. + * + * @param teamId None (required) + * @param body (required) + * @return ApiResponse<UserTeamResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 Represents a user's association to a team -
404 API error response. -
409 API error response. -
429 Too many requests -
+ */ + public ApiResponse createTeamMembershipWithHttpInfo( + String teamId, UserTeamRequest body) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'teamId' is set + if (teamId == null) { + throw new ApiException( + 400, "Missing the required parameter 'teamId' when calling createTeamMembership"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling createTeamMembership"); + } + // create path and map variables + String localVarPath = + "/api/v2/team/{team_id}/memberships" + .replaceAll("\\{" + "team_id" + "\\}", apiClient.escapeString(teamId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.TeamsApi.createTeamMembership", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Add a user to a team. + * + *

See {@link #createTeamMembershipWithHttpInfo}. + * + * @param teamId None (required) + * @param body (required) + * @return CompletableFuture<ApiResponse<UserTeamResponse>> + */ + public CompletableFuture> createTeamMembershipWithHttpInfoAsync( + String teamId, UserTeamRequest body) { + Object localVarPostBody = body; + + // verify the required parameter 'teamId' is set + if (teamId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'teamId' when calling createTeamMembership")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling createTeamMembership")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/team/{team_id}/memberships" + .replaceAll("\\{" + "team_id" + "\\}", apiClient.escapeString(teamId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.TeamsApi.createTeamMembership", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** Manage optional parameters to getAllTeams. */ + public static class GetAllTeamsOptionalParameters { + private Long pageNumber; + private Long pageSize; + private GetAllTeamsSort sort; + private List include; + private String filterKeyword; + private Boolean filterMe; + + /** + * Set pageNumber. + * + * @param pageNumber Specific page number to return. (optional, default to 0) + * @return GetAllTeamsOptionalParameters + */ + public GetAllTeamsOptionalParameters pageNumber(Long pageNumber) { + this.pageNumber = pageNumber; + return this; + } + + /** + * Set pageSize. + * + * @param pageSize Size for a given page. The maximum allowed value is 5000. (optional, default + * to 10) + * @return GetAllTeamsOptionalParameters + */ + public GetAllTeamsOptionalParameters pageSize(Long pageSize) { + this.pageSize = pageSize; + return this; + } + + /** + * Set sort. + * + * @param sort Specifies the order of the returned teams (optional) + * @return GetAllTeamsOptionalParameters + */ + public GetAllTeamsOptionalParameters sort(GetAllTeamsSort sort) { + this.sort = sort; + return this; + } + + /** + * Set include. + * + * @param include Included related resources optionally requested. Allowed enum values: + * team_links, user_team_permissions (optional) + * @return GetAllTeamsOptionalParameters + */ + public GetAllTeamsOptionalParameters include(List include) { + this.include = include; + return this; + } + + /** + * Set filterKeyword. + * + * @param filterKeyword Search query. Can be team name, team handle, or email of team member + * (optional) + * @return GetAllTeamsOptionalParameters + */ + public GetAllTeamsOptionalParameters filterKeyword(String filterKeyword) { + this.filterKeyword = filterKeyword; + return this; + } + + /** + * Set filterMe. + * + * @param filterMe When true, only returns teams the current user belongs to (optional) + * @return GetAllTeamsOptionalParameters + */ + public GetAllTeamsOptionalParameters filterMe(Boolean filterMe) { + this.filterMe = filterMe; + return this; + } + } + + /** + * Get all teams. + * + *

See {@link #getAllTeamsWithHttpInfo}. + * + * @return TeamsResponse + * @throws ApiException if fails to make API call + */ + public TeamsResponse getAllTeams() throws ApiException { + return getAllTeamsWithHttpInfo(new GetAllTeamsOptionalParameters()).getData(); + } + + /** + * Get all teams. + * + *

See {@link #getAllTeamsWithHttpInfoAsync}. + * + * @return CompletableFuture<TeamsResponse> + */ + public CompletableFuture getAllTeamsAsync() { + return getAllTeamsWithHttpInfoAsync(new GetAllTeamsOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get all teams. + * + *

See {@link #getAllTeamsWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return TeamsResponse + * @throws ApiException if fails to make API call + */ + public TeamsResponse getAllTeams(GetAllTeamsOptionalParameters parameters) throws ApiException { + return getAllTeamsWithHttpInfo(parameters).getData(); + } + + /** + * Get all teams. + * + *

See {@link #getAllTeamsWithHttpInfoAsync}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<TeamsResponse> + */ + public CompletableFuture getAllTeamsAsync( + GetAllTeamsOptionalParameters parameters) { + return getAllTeamsWithHttpInfoAsync(parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get all teams. Can be used to search for teams using the filter[keyword] and + * filter[me] query parameters. + * + * @param parameters Optional parameters for the request. + * @return ApiResponse<TeamsResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
429 Too many requests -
+ */ + public ApiResponse getAllTeamsWithHttpInfo( + GetAllTeamsOptionalParameters parameters) throws ApiException { + Object localVarPostBody = null; + Long pageNumber = parameters.pageNumber; + Long pageSize = parameters.pageSize; + GetAllTeamsSort sort = parameters.sort; + List include = parameters.include; + String filterKeyword = parameters.filterKeyword; + Boolean filterMe = parameters.filterMe; + // create path and map variables + String localVarPath = "/api/v2/team"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort", sort)); + localVarQueryParams.addAll(apiClient.parameterToPairs("multi", "include", include)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[keyword]", filterKeyword)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[me]", filterMe)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.TeamsApi.getAllTeams", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get all teams. + * + *

See {@link #getAllTeamsWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<TeamsResponse>> + */ + public CompletableFuture> getAllTeamsWithHttpInfoAsync( + GetAllTeamsOptionalParameters parameters) { + Object localVarPostBody = null; + Long pageNumber = parameters.pageNumber; + Long pageSize = parameters.pageSize; + GetAllTeamsSort sort = parameters.sort; + List include = parameters.include; + String filterKeyword = parameters.filterKeyword; + Boolean filterMe = parameters.filterMe; + // create path and map variables + String localVarPath = "/api/v2/team"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort", sort)); + localVarQueryParams.addAll(apiClient.parameterToPairs("multi", "include", include)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[keyword]", filterKeyword)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[me]", filterMe)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.TeamsApi.getAllTeams", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get a team. + * + *

See {@link #getTeamWithHttpInfo}. + * + * @param teamId None (required) + * @return TeamResponse + * @throws ApiException if fails to make API call + */ + public TeamResponse getTeam(String teamId) throws ApiException { + return getTeamWithHttpInfo(teamId).getData(); + } + + /** + * Get a team. + * + *

See {@link #getTeamWithHttpInfoAsync}. + * + * @param teamId None (required) + * @return CompletableFuture<TeamResponse> + */ + public CompletableFuture getTeamAsync(String teamId) { + return getTeamWithHttpInfoAsync(teamId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get a single team using the team's id. + * + * @param teamId None (required) + * @return ApiResponse<TeamResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
404 API error response. -
429 Too many requests -
+ */ + public ApiResponse getTeamWithHttpInfo(String teamId) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'teamId' is set + if (teamId == null) { + throw new ApiException(400, "Missing the required parameter 'teamId' when calling getTeam"); + } + // create path and map variables + String localVarPath = + "/api/v2/team/{team_id}" + .replaceAll("\\{" + "team_id" + "\\}", apiClient.escapeString(teamId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.TeamsApi.getTeam", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get a team. + * + *

See {@link #getTeamWithHttpInfo}. + * + * @param teamId None (required) + * @return CompletableFuture<ApiResponse<TeamResponse>> + */ + public CompletableFuture> getTeamWithHttpInfoAsync(String teamId) { + Object localVarPostBody = null; + + // verify the required parameter 'teamId' is set + if (teamId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(400, "Missing the required parameter 'teamId' when calling getTeam")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/team/{team_id}" + .replaceAll("\\{" + "team_id" + "\\}", apiClient.escapeString(teamId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.TeamsApi.getTeam", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get a team link. + * + *

See {@link #getTeamLinkWithHttpInfo}. + * + * @param teamId None (required) + * @param linkId None (required) + * @return TeamLinkResponse + * @throws ApiException if fails to make API call + */ + public TeamLinkResponse getTeamLink(String teamId, String linkId) throws ApiException { + return getTeamLinkWithHttpInfo(teamId, linkId).getData(); + } + + /** + * Get a team link. + * + *

See {@link #getTeamLinkWithHttpInfoAsync}. + * + * @param teamId None (required) + * @param linkId None (required) + * @return CompletableFuture<TeamLinkResponse> + */ + public CompletableFuture getTeamLinkAsync(String teamId, String linkId) { + return getTeamLinkWithHttpInfoAsync(teamId, linkId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get a single link for a team. + * + * @param teamId None (required) + * @param linkId None (required) + * @return ApiResponse<TeamLinkResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
404 API error response. -
429 Too many requests -
+ */ + public ApiResponse getTeamLinkWithHttpInfo(String teamId, String linkId) + throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'teamId' is set + if (teamId == null) { + throw new ApiException( + 400, "Missing the required parameter 'teamId' when calling getTeamLink"); + } + + // verify the required parameter 'linkId' is set + if (linkId == null) { + throw new ApiException( + 400, "Missing the required parameter 'linkId' when calling getTeamLink"); + } + // create path and map variables + String localVarPath = + "/api/v2/team/{team_id}/links/{link_id}" + .replaceAll("\\{" + "team_id" + "\\}", apiClient.escapeString(teamId.toString())) + .replaceAll("\\{" + "link_id" + "\\}", apiClient.escapeString(linkId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.TeamsApi.getTeamLink", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get a team link. + * + *

See {@link #getTeamLinkWithHttpInfo}. + * + * @param teamId None (required) + * @param linkId None (required) + * @return CompletableFuture<ApiResponse<TeamLinkResponse>> + */ + public CompletableFuture> getTeamLinkWithHttpInfoAsync( + String teamId, String linkId) { + Object localVarPostBody = null; + + // verify the required parameter 'teamId' is set + if (teamId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'teamId' when calling getTeamLink")); + return result; + } + + // verify the required parameter 'linkId' is set + if (linkId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'linkId' when calling getTeamLink")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/team/{team_id}/links/{link_id}" + .replaceAll("\\{" + "team_id" + "\\}", apiClient.escapeString(teamId.toString())) + .replaceAll("\\{" + "link_id" + "\\}", apiClient.escapeString(linkId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.TeamsApi.getTeamLink", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get links for a team. + * + *

See {@link #getTeamLinksWithHttpInfo}. + * + * @param teamId None (required) + * @return TeamLinksResponse + * @throws ApiException if fails to make API call + */ + public TeamLinksResponse getTeamLinks(String teamId) throws ApiException { + return getTeamLinksWithHttpInfo(teamId).getData(); + } + + /** + * Get links for a team. + * + *

See {@link #getTeamLinksWithHttpInfoAsync}. + * + * @param teamId None (required) + * @return CompletableFuture<TeamLinksResponse> + */ + public CompletableFuture getTeamLinksAsync(String teamId) { + return getTeamLinksWithHttpInfoAsync(teamId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get all links for a given team. + * + * @param teamId None (required) + * @return ApiResponse<TeamLinksResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
404 API error response. -
429 Too many requests -
+ */ + public ApiResponse getTeamLinksWithHttpInfo(String teamId) + throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'teamId' is set + if (teamId == null) { + throw new ApiException( + 400, "Missing the required parameter 'teamId' when calling getTeamLinks"); + } + // create path and map variables + String localVarPath = + "/api/v2/team/{team_id}/links" + .replaceAll("\\{" + "team_id" + "\\}", apiClient.escapeString(teamId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.TeamsApi.getTeamLinks", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get links for a team. + * + *

See {@link #getTeamLinksWithHttpInfo}. + * + * @param teamId None (required) + * @return CompletableFuture<ApiResponse<TeamLinksResponse>> + */ + public CompletableFuture> getTeamLinksWithHttpInfoAsync( + String teamId) { + Object localVarPostBody = null; + + // verify the required parameter 'teamId' is set + if (teamId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'teamId' when calling getTeamLinks")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/team/{team_id}/links" + .replaceAll("\\{" + "team_id" + "\\}", apiClient.escapeString(teamId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.TeamsApi.getTeamLinks", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** Manage optional parameters to getTeamMemberships. */ + public static class GetTeamMembershipsOptionalParameters { + private Long pageSize; + private Long pageNumber; + private GetTeamMembershipsSort sort; + private String filterKeyword; + + /** + * Set pageSize. + * + * @param pageSize Size for a given page. The maximum allowed value is 5000. (optional, default + * to 10) + * @return GetTeamMembershipsOptionalParameters + */ + public GetTeamMembershipsOptionalParameters pageSize(Long pageSize) { + this.pageSize = pageSize; + return this; + } + + /** + * Set pageNumber. + * + * @param pageNumber Specific page number to return. (optional, default to 0) + * @return GetTeamMembershipsOptionalParameters + */ + public GetTeamMembershipsOptionalParameters pageNumber(Long pageNumber) { + this.pageNumber = pageNumber; + return this; + } + + /** + * Set sort. + * + * @param sort Specifies the order of returned team memberships (optional) + * @return GetTeamMembershipsOptionalParameters + */ + public GetTeamMembershipsOptionalParameters sort(GetTeamMembershipsSort sort) { + this.sort = sort; + return this; + } + + /** + * Set filterKeyword. + * + * @param filterKeyword Search query, can be user email or name (optional) + * @return GetTeamMembershipsOptionalParameters + */ + public GetTeamMembershipsOptionalParameters filterKeyword(String filterKeyword) { + this.filterKeyword = filterKeyword; + return this; + } + } + + /** + * Get team memberships. + * + *

See {@link #getTeamMembershipsWithHttpInfo}. + * + * @param teamId None (required) + * @return UserTeamsResponse + * @throws ApiException if fails to make API call + */ + public UserTeamsResponse getTeamMemberships(String teamId) throws ApiException { + return getTeamMembershipsWithHttpInfo(teamId, new GetTeamMembershipsOptionalParameters()) + .getData(); + } + + /** + * Get team memberships. + * + *

See {@link #getTeamMembershipsWithHttpInfoAsync}. + * + * @param teamId None (required) + * @return CompletableFuture<UserTeamsResponse> + */ + public CompletableFuture getTeamMembershipsAsync(String teamId) { + return getTeamMembershipsWithHttpInfoAsync(teamId, new GetTeamMembershipsOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get team memberships. + * + *

See {@link #getTeamMembershipsWithHttpInfo}. + * + * @param teamId None (required) + * @param parameters Optional parameters for the request. + * @return UserTeamsResponse + * @throws ApiException if fails to make API call + */ + public UserTeamsResponse getTeamMemberships( + String teamId, GetTeamMembershipsOptionalParameters parameters) throws ApiException { + return getTeamMembershipsWithHttpInfo(teamId, parameters).getData(); + } + + /** + * Get team memberships. + * + *

See {@link #getTeamMembershipsWithHttpInfoAsync}. + * + * @param teamId None (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<UserTeamsResponse> + */ + public CompletableFuture getTeamMembershipsAsync( + String teamId, GetTeamMembershipsOptionalParameters parameters) { + return getTeamMembershipsWithHttpInfoAsync(teamId, parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get a paginated list of members for a team + * + * @param teamId None (required) + * @param parameters Optional parameters for the request. + * @return ApiResponse<UserTeamsResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 Represents a user's association to a team -
404 API error response. -
429 Too many requests -
+ */ + public ApiResponse getTeamMembershipsWithHttpInfo( + String teamId, GetTeamMembershipsOptionalParameters parameters) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'teamId' is set + if (teamId == null) { + throw new ApiException( + 400, "Missing the required parameter 'teamId' when calling getTeamMemberships"); + } + Long pageSize = parameters.pageSize; + Long pageNumber = parameters.pageNumber; + GetTeamMembershipsSort sort = parameters.sort; + String filterKeyword = parameters.filterKeyword; + // create path and map variables + String localVarPath = + "/api/v2/team/{team_id}/memberships" + .replaceAll("\\{" + "team_id" + "\\}", apiClient.escapeString(teamId.toString())); + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort", sort)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[keyword]", filterKeyword)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.TeamsApi.getTeamMemberships", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get team memberships. + * + *

See {@link #getTeamMembershipsWithHttpInfo}. + * + * @param teamId None (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<UserTeamsResponse>> + */ + public CompletableFuture> getTeamMembershipsWithHttpInfoAsync( + String teamId, GetTeamMembershipsOptionalParameters parameters) { + Object localVarPostBody = null; + + // verify the required parameter 'teamId' is set + if (teamId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'teamId' when calling getTeamMemberships")); + return result; + } + Long pageSize = parameters.pageSize; + Long pageNumber = parameters.pageNumber; + GetTeamMembershipsSort sort = parameters.sort; + String filterKeyword = parameters.filterKeyword; + // create path and map variables + String localVarPath = + "/api/v2/team/{team_id}/memberships" + .replaceAll("\\{" + "team_id" + "\\}", apiClient.escapeString(teamId.toString())); + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort", sort)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[keyword]", filterKeyword)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.TeamsApi.getTeamMemberships", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get permission settings for a team. + * + *

See {@link #getTeamPermissionSettingsWithHttpInfo}. + * + * @param teamId None (required) + * @return TeamPermissionSettingsResponse + * @throws ApiException if fails to make API call + */ + public TeamPermissionSettingsResponse getTeamPermissionSettings(String teamId) + throws ApiException { + return getTeamPermissionSettingsWithHttpInfo(teamId).getData(); + } + + /** + * Get permission settings for a team. + * + *

See {@link #getTeamPermissionSettingsWithHttpInfoAsync}. + * + * @param teamId None (required) + * @return CompletableFuture<TeamPermissionSettingsResponse> + */ + public CompletableFuture getTeamPermissionSettingsAsync( + String teamId) { + return getTeamPermissionSettingsWithHttpInfoAsync(teamId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get all permission settings for a given team. + * + * @param teamId None (required) + * @return ApiResponse<TeamPermissionSettingsResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
404 API error response. -
429 Too many requests -
+ */ + public ApiResponse getTeamPermissionSettingsWithHttpInfo( + String teamId) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'teamId' is set + if (teamId == null) { + throw new ApiException( + 400, "Missing the required parameter 'teamId' when calling getTeamPermissionSettings"); + } + // create path and map variables + String localVarPath = + "/api/v2/team/{team_id}/permission-settings" + .replaceAll("\\{" + "team_id" + "\\}", apiClient.escapeString(teamId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.TeamsApi.getTeamPermissionSettings", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get permission settings for a team. + * + *

See {@link #getTeamPermissionSettingsWithHttpInfo}. + * + * @param teamId None (required) + * @return CompletableFuture<ApiResponse<TeamPermissionSettingsResponse>> + */ + public CompletableFuture> + getTeamPermissionSettingsWithHttpInfoAsync(String teamId) { + Object localVarPostBody = null; + + // verify the required parameter 'teamId' is set + if (teamId == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'teamId' when calling getTeamPermissionSettings")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/team/{team_id}/permission-settings" + .replaceAll("\\{" + "team_id" + "\\}", apiClient.escapeString(teamId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.TeamsApi.getTeamPermissionSettings", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Remove a team. + * + *

See {@link #removeTeamWithHttpInfo}. + * + * @param teamId None (required) + * @throws ApiException if fails to make API call + */ + public void removeTeam(String teamId) throws ApiException { + removeTeamWithHttpInfo(teamId); + } + + /** + * Remove a team. + * + *

See {@link #removeTeamWithHttpInfoAsync}. + * + * @param teamId None (required) + * @return CompletableFuture + */ + public CompletableFuture removeTeamAsync(String teamId) { + return removeTeamWithHttpInfoAsync(teamId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Remove a team using the team's id. + * + * @param teamId None (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
204 No Content -
404 API error response. -
429 Too many requests -
+ */ + public ApiResponse removeTeamWithHttpInfo(String teamId) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'teamId' is set + if (teamId == null) { + throw new ApiException( + 400, "Missing the required parameter 'teamId' when calling removeTeam"); + } + // create path and map variables + String localVarPath = + "/api/v2/team/{team_id}" + .replaceAll("\\{" + "team_id" + "\\}", apiClient.escapeString(teamId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.TeamsApi.removeTeam", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Remove a team. + * + *

See {@link #removeTeamWithHttpInfo}. + * + * @param teamId None (required) + * @return CompletableFuture<ApiResponse<Void>> + */ + public CompletableFuture> removeTeamWithHttpInfoAsync(String teamId) { + Object localVarPostBody = null; + + // verify the required parameter 'teamId' is set + if (teamId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(400, "Missing the required parameter 'teamId' when calling removeTeam")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/team/{team_id}" + .replaceAll("\\{" + "team_id" + "\\}", apiClient.escapeString(teamId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.TeamsApi.removeTeam", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Remove a team link. + * + *

See {@link #removeTeamLinkWithHttpInfo}. + * + * @param teamId None (required) + * @param linkId None (required) + * @throws ApiException if fails to make API call + */ + public void removeTeamLink(String teamId, String linkId) throws ApiException { + removeTeamLinkWithHttpInfo(teamId, linkId); + } + + /** + * Remove a team link. + * + *

See {@link #removeTeamLinkWithHttpInfoAsync}. + * + * @param teamId None (required) + * @param linkId None (required) + * @return CompletableFuture + */ + public CompletableFuture removeTeamLinkAsync(String teamId, String linkId) { + return removeTeamLinkWithHttpInfoAsync(teamId, linkId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Remove a link from a team. + * + * @param teamId None (required) + * @param linkId None (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
204 No Content -
404 API error response. -
429 Too many requests -
+ */ + public ApiResponse removeTeamLinkWithHttpInfo(String teamId, String linkId) + throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'teamId' is set + if (teamId == null) { + throw new ApiException( + 400, "Missing the required parameter 'teamId' when calling removeTeamLink"); + } + + // verify the required parameter 'linkId' is set + if (linkId == null) { + throw new ApiException( + 400, "Missing the required parameter 'linkId' when calling removeTeamLink"); + } + // create path and map variables + String localVarPath = + "/api/v2/team/{team_id}/links/{link_id}" + .replaceAll("\\{" + "team_id" + "\\}", apiClient.escapeString(teamId.toString())) + .replaceAll("\\{" + "link_id" + "\\}", apiClient.escapeString(linkId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.TeamsApi.removeTeamLink", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Remove a team link. + * + *

See {@link #removeTeamLinkWithHttpInfo}. + * + * @param teamId None (required) + * @param linkId None (required) + * @return CompletableFuture<ApiResponse<Void>> + */ + public CompletableFuture> removeTeamLinkWithHttpInfoAsync( + String teamId, String linkId) { + Object localVarPostBody = null; + + // verify the required parameter 'teamId' is set + if (teamId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'teamId' when calling removeTeamLink")); + return result; + } + + // verify the required parameter 'linkId' is set + if (linkId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'linkId' when calling removeTeamLink")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/team/{team_id}/links/{link_id}" + .replaceAll("\\{" + "team_id" + "\\}", apiClient.escapeString(teamId.toString())) + .replaceAll("\\{" + "link_id" + "\\}", apiClient.escapeString(linkId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.TeamsApi.removeTeamLink", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Remove a user from a team. + * + *

See {@link #removeTeamMembershipWithHttpInfo}. + * + * @param teamId None (required) + * @param userId None (required) + * @throws ApiException if fails to make API call + */ + public void removeTeamMembership(String teamId, String userId) throws ApiException { + removeTeamMembershipWithHttpInfo(teamId, userId); + } + + /** + * Remove a user from a team. + * + *

See {@link #removeTeamMembershipWithHttpInfoAsync}. + * + * @param teamId None (required) + * @param userId None (required) + * @return CompletableFuture + */ + public CompletableFuture removeTeamMembershipAsync(String teamId, String userId) { + return removeTeamMembershipWithHttpInfoAsync(teamId, userId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Remove a user from a team. + * + * @param teamId None (required) + * @param userId None (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
204 No Content -
404 API error response. -
429 Too many requests -
+ */ + public ApiResponse removeTeamMembershipWithHttpInfo(String teamId, String userId) + throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'teamId' is set + if (teamId == null) { + throw new ApiException( + 400, "Missing the required parameter 'teamId' when calling removeTeamMembership"); + } + + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException( + 400, "Missing the required parameter 'userId' when calling removeTeamMembership"); + } + // create path and map variables + String localVarPath = + "/api/v2/team/{team_id}/memberships/{user_id}" + .replaceAll("\\{" + "team_id" + "\\}", apiClient.escapeString(teamId.toString())) + .replaceAll("\\{" + "user_id" + "\\}", apiClient.escapeString(userId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.TeamsApi.removeTeamMembership", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Remove a user from a team. + * + *

See {@link #removeTeamMembershipWithHttpInfo}. + * + * @param teamId None (required) + * @param userId None (required) + * @return CompletableFuture<ApiResponse<Void>> + */ + public CompletableFuture> removeTeamMembershipWithHttpInfoAsync( + String teamId, String userId) { + Object localVarPostBody = null; + + // verify the required parameter 'teamId' is set + if (teamId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'teamId' when calling removeTeamMembership")); + return result; + } + + // verify the required parameter 'userId' is set + if (userId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'userId' when calling removeTeamMembership")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/team/{team_id}/memberships/{user_id}" + .replaceAll("\\{" + "team_id" + "\\}", apiClient.escapeString(teamId.toString())) + .replaceAll("\\{" + "user_id" + "\\}", apiClient.escapeString(userId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.TeamsApi.removeTeamMembership", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Update a team. + * + *

See {@link #updateTeamWithHttpInfo}. + * + * @param teamId None (required) + * @param body (required) + * @return TeamResponse + * @throws ApiException if fails to make API call + */ + public TeamResponse updateTeam(String teamId, TeamUpdateRequest body) throws ApiException { + return updateTeamWithHttpInfo(teamId, body).getData(); + } + + /** + * Update a team. + * + *

See {@link #updateTeamWithHttpInfoAsync}. + * + * @param teamId None (required) + * @param body (required) + * @return CompletableFuture<TeamResponse> + */ + public CompletableFuture updateTeamAsync(String teamId, TeamUpdateRequest body) { + return updateTeamWithHttpInfoAsync(teamId, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Update a team using the team's id. If the team_links relationship is + * present, the associated links are updated to be in the order they appear in the array, and any + * existing team links not present are removed. + * + * @param teamId None (required) + * @param body (required) + * @return ApiResponse<TeamResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 API error response. -
404 API error response. -
409 API error response. -
429 Too many requests -
+ */ + public ApiResponse updateTeamWithHttpInfo(String teamId, TeamUpdateRequest body) + throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'teamId' is set + if (teamId == null) { + throw new ApiException( + 400, "Missing the required parameter 'teamId' when calling updateTeam"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException(400, "Missing the required parameter 'body' when calling updateTeam"); + } + // create path and map variables + String localVarPath = + "/api/v2/team/{team_id}" + .replaceAll("\\{" + "team_id" + "\\}", apiClient.escapeString(teamId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.TeamsApi.updateTeam", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Update a team. + * + *

See {@link #updateTeamWithHttpInfo}. + * + * @param teamId None (required) + * @param body (required) + * @return CompletableFuture<ApiResponse<TeamResponse>> + */ + public CompletableFuture> updateTeamWithHttpInfoAsync( + String teamId, TeamUpdateRequest body) { + Object localVarPostBody = body; + + // verify the required parameter 'teamId' is set + if (teamId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(400, "Missing the required parameter 'teamId' when calling updateTeam")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(400, "Missing the required parameter 'body' when calling updateTeam")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/team/{team_id}" + .replaceAll("\\{" + "team_id" + "\\}", apiClient.escapeString(teamId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.TeamsApi.updateTeam", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Update a team link. + * + *

See {@link #updateTeamLinkWithHttpInfo}. + * + * @param teamId None (required) + * @param linkId None (required) + * @param body (required) + * @return TeamLinkResponse + * @throws ApiException if fails to make API call + */ + public TeamLinkResponse updateTeamLink(String teamId, String linkId, TeamLinkCreateRequest body) + throws ApiException { + return updateTeamLinkWithHttpInfo(teamId, linkId, body).getData(); + } + + /** + * Update a team link. + * + *

See {@link #updateTeamLinkWithHttpInfoAsync}. + * + * @param teamId None (required) + * @param linkId None (required) + * @param body (required) + * @return CompletableFuture<TeamLinkResponse> + */ + public CompletableFuture updateTeamLinkAsync( + String teamId, String linkId, TeamLinkCreateRequest body) { + return updateTeamLinkWithHttpInfoAsync(teamId, linkId, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Update a team link. + * + * @param teamId None (required) + * @param linkId None (required) + * @param body (required) + * @return ApiResponse<TeamLinkResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
404 API error response. -
429 Too many requests -
+ */ + public ApiResponse updateTeamLinkWithHttpInfo( + String teamId, String linkId, TeamLinkCreateRequest body) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'teamId' is set + if (teamId == null) { + throw new ApiException( + 400, "Missing the required parameter 'teamId' when calling updateTeamLink"); + } + + // verify the required parameter 'linkId' is set + if (linkId == null) { + throw new ApiException( + 400, "Missing the required parameter 'linkId' when calling updateTeamLink"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling updateTeamLink"); + } + // create path and map variables + String localVarPath = + "/api/v2/team/{team_id}/links/{link_id}" + .replaceAll("\\{" + "team_id" + "\\}", apiClient.escapeString(teamId.toString())) + .replaceAll("\\{" + "link_id" + "\\}", apiClient.escapeString(linkId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.TeamsApi.updateTeamLink", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Update a team link. + * + *

See {@link #updateTeamLinkWithHttpInfo}. + * + * @param teamId None (required) + * @param linkId None (required) + * @param body (required) + * @return CompletableFuture<ApiResponse<TeamLinkResponse>> + */ + public CompletableFuture> updateTeamLinkWithHttpInfoAsync( + String teamId, String linkId, TeamLinkCreateRequest body) { + Object localVarPostBody = body; + + // verify the required parameter 'teamId' is set + if (teamId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'teamId' when calling updateTeamLink")); + return result; + } + + // verify the required parameter 'linkId' is set + if (linkId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'linkId' when calling updateTeamLink")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling updateTeamLink")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/team/{team_id}/links/{link_id}" + .replaceAll("\\{" + "team_id" + "\\}", apiClient.escapeString(teamId.toString())) + .replaceAll("\\{" + "link_id" + "\\}", apiClient.escapeString(linkId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.TeamsApi.updateTeamLink", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Update a user's membership attributes on a team. + * + *

See {@link #updateTeamMembershipWithHttpInfo}. + * + * @param teamId None (required) + * @param userId None (required) + * @param body (required) + * @return UserTeamResponse + * @throws ApiException if fails to make API call + */ + public UserTeamResponse updateTeamMembership( + String teamId, String userId, UserTeamUpdateRequest body) throws ApiException { + return updateTeamMembershipWithHttpInfo(teamId, userId, body).getData(); + } + + /** + * Update a user's membership attributes on a team. + * + *

See {@link #updateTeamMembershipWithHttpInfoAsync}. + * + * @param teamId None (required) + * @param userId None (required) + * @param body (required) + * @return CompletableFuture<UserTeamResponse> + */ + public CompletableFuture updateTeamMembershipAsync( + String teamId, String userId, UserTeamUpdateRequest body) { + return updateTeamMembershipWithHttpInfoAsync(teamId, userId, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Update a user's membership attributes on a team. + * + * @param teamId None (required) + * @param userId None (required) + * @param body (required) + * @return ApiResponse<UserTeamResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 Represents a user's association to a team -
404 API error response. -
429 Too many requests -
+ */ + public ApiResponse updateTeamMembershipWithHttpInfo( + String teamId, String userId, UserTeamUpdateRequest body) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'teamId' is set + if (teamId == null) { + throw new ApiException( + 400, "Missing the required parameter 'teamId' when calling updateTeamMembership"); + } + + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException( + 400, "Missing the required parameter 'userId' when calling updateTeamMembership"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling updateTeamMembership"); + } + // create path and map variables + String localVarPath = + "/api/v2/team/{team_id}/memberships/{user_id}" + .replaceAll("\\{" + "team_id" + "\\}", apiClient.escapeString(teamId.toString())) + .replaceAll("\\{" + "user_id" + "\\}", apiClient.escapeString(userId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.TeamsApi.updateTeamMembership", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Update a user's membership attributes on a team. + * + *

See {@link #updateTeamMembershipWithHttpInfo}. + * + * @param teamId None (required) + * @param userId None (required) + * @param body (required) + * @return CompletableFuture<ApiResponse<UserTeamResponse>> + */ + public CompletableFuture> updateTeamMembershipWithHttpInfoAsync( + String teamId, String userId, UserTeamUpdateRequest body) { + Object localVarPostBody = body; + + // verify the required parameter 'teamId' is set + if (teamId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'teamId' when calling updateTeamMembership")); + return result; + } + + // verify the required parameter 'userId' is set + if (userId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'userId' when calling updateTeamMembership")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling updateTeamMembership")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/team/{team_id}/memberships/{user_id}" + .replaceAll("\\{" + "team_id" + "\\}", apiClient.escapeString(teamId.toString())) + .replaceAll("\\{" + "user_id" + "\\}", apiClient.escapeString(userId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.TeamsApi.updateTeamMembership", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Update permission setting for team. + * + *

See {@link #updateTeamPermissionSettingWithHttpInfo}. + * + * @param teamId None (required) + * @param action None (required) + * @param body (required) + * @return TeamPermissionSettingResponse + * @throws ApiException if fails to make API call + */ + public TeamPermissionSettingResponse updateTeamPermissionSetting( + String teamId, String action, TeamPermissionSettingUpdateRequest body) throws ApiException { + return updateTeamPermissionSettingWithHttpInfo(teamId, action, body).getData(); + } + + /** + * Update permission setting for team. + * + *

See {@link #updateTeamPermissionSettingWithHttpInfoAsync}. + * + * @param teamId None (required) + * @param action None (required) + * @param body (required) + * @return CompletableFuture<TeamPermissionSettingResponse> + */ + public CompletableFuture updateTeamPermissionSettingAsync( + String teamId, String action, TeamPermissionSettingUpdateRequest body) { + return updateTeamPermissionSettingWithHttpInfoAsync(teamId, action, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Update a team permission setting for a given team. + * + * @param teamId None (required) + * @param action None (required) + * @param body (required) + * @return ApiResponse<TeamPermissionSettingResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
404 API error response. -
429 Too many requests -
+ */ + public ApiResponse updateTeamPermissionSettingWithHttpInfo( + String teamId, String action, TeamPermissionSettingUpdateRequest body) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'teamId' is set + if (teamId == null) { + throw new ApiException( + 400, "Missing the required parameter 'teamId' when calling updateTeamPermissionSetting"); + } + + // verify the required parameter 'action' is set + if (action == null) { + throw new ApiException( + 400, "Missing the required parameter 'action' when calling updateTeamPermissionSetting"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling updateTeamPermissionSetting"); + } + // create path and map variables + String localVarPath = + "/api/v2/team/{team_id}/permission-settings/{action}" + .replaceAll("\\{" + "team_id" + "\\}", apiClient.escapeString(teamId.toString())) + .replaceAll("\\{" + "action" + "\\}", apiClient.escapeString(action.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.TeamsApi.updateTeamPermissionSetting", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "PUT", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Update permission setting for team. + * + *

See {@link #updateTeamPermissionSettingWithHttpInfo}. + * + * @param teamId None (required) + * @param action None (required) + * @param body (required) + * @return CompletableFuture<ApiResponse<TeamPermissionSettingResponse>> + */ + public CompletableFuture> + updateTeamPermissionSettingWithHttpInfoAsync( + String teamId, String action, TeamPermissionSettingUpdateRequest body) { + Object localVarPostBody = body; + + // verify the required parameter 'teamId' is set + if (teamId == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'teamId' when calling updateTeamPermissionSetting")); + return result; + } + + // verify the required parameter 'action' is set + if (action == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'action' when calling updateTeamPermissionSetting")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'body' when calling updateTeamPermissionSetting")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/team/{team_id}/permission-settings/{action}" + .replaceAll("\\{" + "team_id" + "\\}", apiClient.escapeString(teamId.toString())) + .replaceAll("\\{" + "action" + "\\}", apiClient.escapeString(action.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.TeamsApi.updateTeamPermissionSetting", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "PUT", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/GetAllTeamsInclude.java b/src/main/java/com/datadog/api/client/v2/model/GetAllTeamsInclude.java new file mode 100644 index 00000000000..d4336f134ad --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GetAllTeamsInclude.java @@ -0,0 +1,94 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Objects; +import java.util.Set; + +/** Included related resources optionally requested. */ +@JsonSerialize(using = GetAllTeamsInclude.GetAllTeamsIncludeSerializer.class) +public class GetAllTeamsInclude { + + public static final GetAllTeamsInclude TEAM_LINKS = new GetAllTeamsInclude("team_links"); + public static final GetAllTeamsInclude USER_TEAM_PERMISSIONS = + new GetAllTeamsInclude("user_team_permissions"); + + private static final Set allowedValues = + new HashSet(Arrays.asList("team_links", "user_team_permissions")); + + private String value; + + public boolean isValid() { + return allowedValues.contains(this.value); + } + + GetAllTeamsInclude(String value) { + this.value = value; + } + + public static class GetAllTeamsIncludeSerializer extends StdSerializer { + public GetAllTeamsIncludeSerializer(Class t) { + super(t); + } + + public GetAllTeamsIncludeSerializer() { + this(null); + } + + @Override + public void serialize(GetAllTeamsInclude value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonValue + public String getValue() { + return this.value; + } + + public void setValue(String value) { + this.value = value; + } + + /** Return true if this GetAllTeamsInclude object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return this.value.equals(((GetAllTeamsInclude) o).value); + } + + @Override + public int hashCode() { + return Objects.hash(value); + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static GetAllTeamsInclude fromValue(String value) { + return new GetAllTeamsInclude(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/GetAllTeamsSort.java b/src/main/java/com/datadog/api/client/v2/model/GetAllTeamsSort.java new file mode 100644 index 00000000000..f527c92b323 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GetAllTeamsSort.java @@ -0,0 +1,95 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Objects; +import java.util.Set; + +/** Specifies the order of the returned teams */ +@JsonSerialize(using = GetAllTeamsSort.GetAllTeamsSortSerializer.class) +public class GetAllTeamsSort { + + public static final GetAllTeamsSort NAME = new GetAllTeamsSort("name"); + public static final GetAllTeamsSort _NAME = new GetAllTeamsSort("-name"); + public static final GetAllTeamsSort USER_COUNT = new GetAllTeamsSort("user_count"); + public static final GetAllTeamsSort _USER_COUNT = new GetAllTeamsSort("-user_count"); + + private static final Set allowedValues = + new HashSet(Arrays.asList("name", "-name", "user_count", "-user_count")); + + private String value; + + public boolean isValid() { + return allowedValues.contains(this.value); + } + + GetAllTeamsSort(String value) { + this.value = value; + } + + public static class GetAllTeamsSortSerializer extends StdSerializer { + public GetAllTeamsSortSerializer(Class t) { + super(t); + } + + public GetAllTeamsSortSerializer() { + this(null); + } + + @Override + public void serialize(GetAllTeamsSort value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonValue + public String getValue() { + return this.value; + } + + public void setValue(String value) { + this.value = value; + } + + /** Return true if this GetAllTeamsSort object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return this.value.equals(((GetAllTeamsSort) o).value); + } + + @Override + public int hashCode() { + return Objects.hash(value); + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static GetAllTeamsSort fromValue(String value) { + return new GetAllTeamsSort(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/GetTeamMembershipsSort.java b/src/main/java/com/datadog/api/client/v2/model/GetTeamMembershipsSort.java new file mode 100644 index 00000000000..b2d70faf07c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GetTeamMembershipsSort.java @@ -0,0 +1,112 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Objects; +import java.util.Set; + +/** Specifies the order of returned team memberships */ +@JsonSerialize(using = GetTeamMembershipsSort.GetTeamMembershipsSortSerializer.class) +public class GetTeamMembershipsSort { + + public static final GetTeamMembershipsSort MANAGER_NAME = + new GetTeamMembershipsSort("manager_name"); + public static final GetTeamMembershipsSort _MANAGER_NAME = + new GetTeamMembershipsSort("-manager_name"); + public static final GetTeamMembershipsSort NAME = new GetTeamMembershipsSort("name"); + public static final GetTeamMembershipsSort _NAME = new GetTeamMembershipsSort("-name"); + public static final GetTeamMembershipsSort HANDLE = new GetTeamMembershipsSort("handle"); + public static final GetTeamMembershipsSort _HANDLE = new GetTeamMembershipsSort("-handle"); + public static final GetTeamMembershipsSort EMAIL = new GetTeamMembershipsSort("email"); + public static final GetTeamMembershipsSort _EMAIL = new GetTeamMembershipsSort("-email"); + + private static final Set allowedValues = + new HashSet( + Arrays.asList( + "manager_name", + "-manager_name", + "name", + "-name", + "handle", + "-handle", + "email", + "-email")); + + private String value; + + public boolean isValid() { + return allowedValues.contains(this.value); + } + + GetTeamMembershipsSort(String value) { + this.value = value; + } + + public static class GetTeamMembershipsSortSerializer + extends StdSerializer { + public GetTeamMembershipsSortSerializer(Class t) { + super(t); + } + + public GetTeamMembershipsSortSerializer() { + this(null); + } + + @Override + public void serialize( + GetTeamMembershipsSort value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonValue + public String getValue() { + return this.value; + } + + public void setValue(String value) { + this.value = value; + } + + /** Return true if this GetTeamMembershipsSort object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return this.value.equals(((GetTeamMembershipsSort) o).value); + } + + @Override + public int hashCode() { + return Objects.hash(value); + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static GetTeamMembershipsSort fromValue(String value) { + return new GetTeamMembershipsSort(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RelationshipToTeamLinkData.java b/src/main/java/com/datadog/api/client/v2/model/RelationshipToTeamLinkData.java new file mode 100644 index 00000000000..1aa90e95216 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RelationshipToTeamLinkData.java @@ -0,0 +1,124 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** Relationship between a link and a team */ +@JsonPropertyOrder({ + RelationshipToTeamLinkData.JSON_PROPERTY_ID, + RelationshipToTeamLinkData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RelationshipToTeamLinkData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private TeamLinkType type = TeamLinkType.TEAM_LINKS; + + public RelationshipToTeamLinkData() {} + + @JsonCreator + public RelationshipToTeamLinkData( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) TeamLinkType type) { + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public RelationshipToTeamLinkData id(String id) { + this.id = id; + return this; + } + + /** + * The team link's identifier + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public RelationshipToTeamLinkData type(TeamLinkType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Team link type + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TeamLinkType getType() { + return type; + } + + public void setType(TeamLinkType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** Return true if this RelationshipToTeamLinkData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RelationshipToTeamLinkData relationshipToTeamLinkData = (RelationshipToTeamLinkData) o; + return Objects.equals(this.id, relationshipToTeamLinkData.id) + && Objects.equals(this.type, relationshipToTeamLinkData.type); + } + + @Override + public int hashCode() { + return Objects.hash(id, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RelationshipToTeamLinkData {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RelationshipToTeamLinks.java b/src/main/java/com/datadog/api/client/v2/model/RelationshipToTeamLinks.java new file mode 100644 index 00000000000..d004568a6f8 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RelationshipToTeamLinks.java @@ -0,0 +1,95 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** Relationship between a team and a team link */ +@JsonPropertyOrder({RelationshipToTeamLinks.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RelationshipToTeamLinks { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = null; + + public RelationshipToTeamLinks data(List data) { + this.data = data; + for (RelationshipToTeamLinkData item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public RelationshipToTeamLinks addDataItem(RelationshipToTeamLinkData dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * Related team links + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + /** Return true if this RelationshipToTeamLinks object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RelationshipToTeamLinks relationshipToTeamLinks = (RelationshipToTeamLinks) o; + return Objects.equals(this.data, relationshipToTeamLinks.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RelationshipToTeamLinks {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RelationshipToUserTeamPermission.java b/src/main/java/com/datadog/api/client/v2/model/RelationshipToUserTeamPermission.java new file mode 100644 index 00000000000..8744e55b332 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RelationshipToUserTeamPermission.java @@ -0,0 +1,83 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** Relationship between a user team permission and a team */ +@JsonPropertyOrder({RelationshipToUserTeamPermission.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RelationshipToUserTeamPermission { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private RelationshipToUserTeamPermissionData data; + + public RelationshipToUserTeamPermission data(RelationshipToUserTeamPermissionData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Related user team permission data + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public RelationshipToUserTeamPermissionData getData() { + return data; + } + + public void setData(RelationshipToUserTeamPermissionData data) { + this.data = data; + } + + /** Return true if this RelationshipToUserTeamPermission object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RelationshipToUserTeamPermission relationshipToUserTeamPermission = + (RelationshipToUserTeamPermission) o; + return Objects.equals(this.data, relationshipToUserTeamPermission.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RelationshipToUserTeamPermission {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RelationshipToUserTeamPermissionData.java b/src/main/java/com/datadog/api/client/v2/model/RelationshipToUserTeamPermissionData.java new file mode 100644 index 00000000000..dd42b0a2190 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RelationshipToUserTeamPermissionData.java @@ -0,0 +1,125 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** Related user team permission data */ +@JsonPropertyOrder({ + RelationshipToUserTeamPermissionData.JSON_PROPERTY_ID, + RelationshipToUserTeamPermissionData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RelationshipToUserTeamPermissionData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private UserTeamPermissionType type = UserTeamPermissionType.USER_TEAM_PERMISSIONS; + + public RelationshipToUserTeamPermissionData() {} + + @JsonCreator + public RelationshipToUserTeamPermissionData( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) UserTeamPermissionType type) { + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public RelationshipToUserTeamPermissionData id(String id) { + this.id = id; + return this; + } + + /** + * The ID of the user team permission + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public RelationshipToUserTeamPermissionData type(UserTeamPermissionType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * User team permission type + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UserTeamPermissionType getType() { + return type; + } + + public void setType(UserTeamPermissionType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** Return true if this RelationshipToUserTeamPermissionData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RelationshipToUserTeamPermissionData relationshipToUserTeamPermissionData = + (RelationshipToUserTeamPermissionData) o; + return Objects.equals(this.id, relationshipToUserTeamPermissionData.id) + && Objects.equals(this.type, relationshipToUserTeamPermissionData.type); + } + + @Override + public int hashCode() { + return Objects.hash(id, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RelationshipToUserTeamPermissionData {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RelationshipToUserTeamUser.java b/src/main/java/com/datadog/api/client/v2/model/RelationshipToUserTeamUser.java new file mode 100644 index 00000000000..a1ce67ffb66 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RelationshipToUserTeamUser.java @@ -0,0 +1,92 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** Relationship between team membership and user */ +@JsonPropertyOrder({RelationshipToUserTeamUser.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RelationshipToUserTeamUser { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private RelationshipToUserTeamUserData data; + + public RelationshipToUserTeamUser() {} + + @JsonCreator + public RelationshipToUserTeamUser( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + RelationshipToUserTeamUserData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public RelationshipToUserTeamUser data(RelationshipToUserTeamUserData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * A user's relationship with a team + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public RelationshipToUserTeamUserData getData() { + return data; + } + + public void setData(RelationshipToUserTeamUserData data) { + this.data = data; + } + + /** Return true if this RelationshipToUserTeamUser object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RelationshipToUserTeamUser relationshipToUserTeamUser = (RelationshipToUserTeamUser) o; + return Objects.equals(this.data, relationshipToUserTeamUser.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RelationshipToUserTeamUser {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RelationshipToUserTeamUserData.java b/src/main/java/com/datadog/api/client/v2/model/RelationshipToUserTeamUserData.java new file mode 100644 index 00000000000..b507eeefd4d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RelationshipToUserTeamUserData.java @@ -0,0 +1,125 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** A user's relationship with a team */ +@JsonPropertyOrder({ + RelationshipToUserTeamUserData.JSON_PROPERTY_ID, + RelationshipToUserTeamUserData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RelationshipToUserTeamUserData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private UserTeamUserType type = UserTeamUserType.USERS; + + public RelationshipToUserTeamUserData() {} + + @JsonCreator + public RelationshipToUserTeamUserData( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) UserTeamUserType type) { + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public RelationshipToUserTeamUserData id(String id) { + this.id = id; + return this; + } + + /** + * The ID of the user associated with the team + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public RelationshipToUserTeamUserData type(UserTeamUserType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * User team user type + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UserTeamUserType getType() { + return type; + } + + public void setType(UserTeamUserType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** Return true if this RelationshipToUserTeamUserData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RelationshipToUserTeamUserData relationshipToUserTeamUserData = + (RelationshipToUserTeamUserData) o; + return Objects.equals(this.id, relationshipToUserTeamUserData.id) + && Objects.equals(this.type, relationshipToUserTeamUserData.type); + } + + @Override + public int hashCode() { + return Objects.hash(id, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RelationshipToUserTeamUserData {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/Team.java b/src/main/java/com/datadog/api/client/v2/model/Team.java new file mode 100644 index 00000000000..c26d604af6d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/Team.java @@ -0,0 +1,182 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** A team */ +@JsonPropertyOrder({ + Team.JSON_PROPERTY_ATTRIBUTES, + Team.JSON_PROPERTY_ID, + Team.JSON_PROPERTY_RELATIONSHIPS, + Team.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class Team { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private TeamAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_RELATIONSHIPS = "relationships"; + private TeamRelationships relationships; + + public static final String JSON_PROPERTY_TYPE = "type"; + private TeamType type = TeamType.TEAM; + + public Team() {} + + @JsonCreator + public Team( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) TeamAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) TeamType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public Team attributes(TeamAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Team attributes + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TeamAttributes getAttributes() { + return attributes; + } + + public void setAttributes(TeamAttributes attributes) { + this.attributes = attributes; + } + + public Team id(String id) { + this.id = id; + return this; + } + + /** + * The team's identifier + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public Team relationships(TeamRelationships relationships) { + this.relationships = relationships; + this.unparsed |= relationships.unparsed; + return this; + } + + /** + * Resources related to a team + * + * @return relationships + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RELATIONSHIPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TeamRelationships getRelationships() { + return relationships; + } + + public void setRelationships(TeamRelationships relationships) { + this.relationships = relationships; + } + + public Team type(TeamType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Team type + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TeamType getType() { + return type; + } + + public void setType(TeamType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** Return true if this Team object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Team team = (Team) o; + return Objects.equals(this.attributes, team.attributes) + && Objects.equals(this.id, team.id) + && Objects.equals(this.relationships, team.relationships) + && Objects.equals(this.type, team.type); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, relationships, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Team {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" relationships: ").append(toIndentedString(relationships)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TeamAttributes.java b/src/main/java/com/datadog/api/client/v2/model/TeamAttributes.java new file mode 100644 index 00000000000..5378b106536 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamAttributes.java @@ -0,0 +1,271 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.JsonTimeSerializer; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import java.time.OffsetDateTime; +import java.util.Objects; + +/** Team attributes */ +@JsonPropertyOrder({ + TeamAttributes.JSON_PROPERTY_CREATED_AT, + TeamAttributes.JSON_PROPERTY_DESCRIPTION, + TeamAttributes.JSON_PROPERTY_HANDLE, + TeamAttributes.JSON_PROPERTY_LINK_COUNT, + TeamAttributes.JSON_PROPERTY_MODIFIED_AT, + TeamAttributes.JSON_PROPERTY_NAME, + TeamAttributes.JSON_PROPERTY_SUMMARY, + TeamAttributes.JSON_PROPERTY_USER_COUNT +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TeamAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + + @JsonSerialize(using = JsonTimeSerializer.class) + private OffsetDateTime createdAt; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_HANDLE = "handle"; + private String handle; + + public static final String JSON_PROPERTY_LINK_COUNT = "link_count"; + private Integer linkCount; + + public static final String JSON_PROPERTY_MODIFIED_AT = "modified_at"; + + @JsonSerialize(using = JsonTimeSerializer.class) + private OffsetDateTime modifiedAt; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_SUMMARY = "summary"; + private String summary; + + public static final String JSON_PROPERTY_USER_COUNT = "user_count"; + private Integer userCount; + + public TeamAttributes() {} + + @JsonCreator + public TeamAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_HANDLE) String handle, + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name) { + this.handle = handle; + this.name = name; + } + + public TeamAttributes createdAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Creation date of the team + * + * @return createdAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + public TeamAttributes description(String description) { + this.description = description; + return this; + } + + /** + * Free-form markdown description/content for the team's homepage + * + * @return description + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public TeamAttributes handle(String handle) { + this.handle = handle; + return this; + } + + /** + * The team's identifier + * + * @return handle + */ + @JsonProperty(JSON_PROPERTY_HANDLE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getHandle() { + return handle; + } + + public void setHandle(String handle) { + this.handle = handle; + } + + /** + * The number of links belonging to the team maximum: 2147483647 + * + * @return linkCount + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LINK_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getLinkCount() { + return linkCount; + } + + public TeamAttributes modifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = modifiedAt; + return this; + } + + /** + * Modification date of the team + * + * @return modifiedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MODIFIED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getModifiedAt() { + return modifiedAt; + } + + public void setModifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = modifiedAt; + } + + public TeamAttributes name(String name) { + this.name = name; + return this; + } + + /** + * The name of the team + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public TeamAttributes summary(String summary) { + this.summary = summary; + return this; + } + + /** + * A brief summary of the team, derived from the description + * + * @return summary + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SUMMARY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSummary() { + return summary; + } + + public void setSummary(String summary) { + this.summary = summary; + } + + /** + * The number of users belonging to the team maximum: 2147483647 + * + * @return userCount + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USER_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getUserCount() { + return userCount; + } + + /** Return true if this TeamAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamAttributes teamAttributes = (TeamAttributes) o; + return Objects.equals(this.createdAt, teamAttributes.createdAt) + && Objects.equals(this.description, teamAttributes.description) + && Objects.equals(this.handle, teamAttributes.handle) + && Objects.equals(this.linkCount, teamAttributes.linkCount) + && Objects.equals(this.modifiedAt, teamAttributes.modifiedAt) + && Objects.equals(this.name, teamAttributes.name) + && Objects.equals(this.summary, teamAttributes.summary) + && Objects.equals(this.userCount, teamAttributes.userCount); + } + + @Override + public int hashCode() { + return Objects.hash( + createdAt, description, handle, linkCount, modifiedAt, name, summary, userCount); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamAttributes {\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" handle: ").append(toIndentedString(handle)).append("\n"); + sb.append(" linkCount: ").append(toIndentedString(linkCount)).append("\n"); + sb.append(" modifiedAt: ").append(toIndentedString(modifiedAt)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" summary: ").append(toIndentedString(summary)).append("\n"); + sb.append(" userCount: ").append(toIndentedString(userCount)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TeamCreate.java b/src/main/java/com/datadog/api/client/v2/model/TeamCreate.java new file mode 100644 index 00000000000..2cb08a87e40 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamCreate.java @@ -0,0 +1,155 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** Team create */ +@JsonPropertyOrder({ + TeamCreate.JSON_PROPERTY_ATTRIBUTES, + TeamCreate.JSON_PROPERTY_RELATIONSHIPS, + TeamCreate.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TeamCreate { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private TeamCreateAttributes attributes; + + public static final String JSON_PROPERTY_RELATIONSHIPS = "relationships"; + private TeamCreateRelationships relationships; + + public static final String JSON_PROPERTY_TYPE = "type"; + private TeamType type = TeamType.TEAM; + + public TeamCreate() {} + + @JsonCreator + public TeamCreate( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + TeamCreateAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) TeamType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public TeamCreate attributes(TeamCreateAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Team creation attributes + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TeamCreateAttributes getAttributes() { + return attributes; + } + + public void setAttributes(TeamCreateAttributes attributes) { + this.attributes = attributes; + } + + public TeamCreate relationships(TeamCreateRelationships relationships) { + this.relationships = relationships; + this.unparsed |= relationships.unparsed; + return this; + } + + /** + * Relationships formed with the team on creation + * + * @return relationships + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RELATIONSHIPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TeamCreateRelationships getRelationships() { + return relationships; + } + + public void setRelationships(TeamCreateRelationships relationships) { + this.relationships = relationships; + } + + public TeamCreate type(TeamType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Team type + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TeamType getType() { + return type; + } + + public void setType(TeamType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** Return true if this TeamCreate object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamCreate teamCreate = (TeamCreate) o; + return Objects.equals(this.attributes, teamCreate.attributes) + && Objects.equals(this.relationships, teamCreate.relationships) + && Objects.equals(this.type, teamCreate.type); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, relationships, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamCreate {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" relationships: ").append(toIndentedString(relationships)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TeamCreateAttributes.java b/src/main/java/com/datadog/api/client/v2/model/TeamCreateAttributes.java new file mode 100644 index 00000000000..48650778d6c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamCreateAttributes.java @@ -0,0 +1,164 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** Team creation attributes */ +@JsonPropertyOrder({ + TeamCreateAttributes.JSON_PROPERTY_DESCRIPTION, + TeamCreateAttributes.JSON_PROPERTY_HANDLE, + TeamCreateAttributes.JSON_PROPERTY_LINK_COUNT, + TeamCreateAttributes.JSON_PROPERTY_NAME +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TeamCreateAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_HANDLE = "handle"; + private String handle; + + public static final String JSON_PROPERTY_LINK_COUNT = "link_count"; + private Integer linkCount; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public TeamCreateAttributes() {} + + @JsonCreator + public TeamCreateAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_HANDLE) String handle, + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name) { + this.handle = handle; + this.name = name; + } + + public TeamCreateAttributes description(String description) { + this.description = description; + return this; + } + + /** + * Free-form markdown description/content for the team's homepage + * + * @return description + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public TeamCreateAttributes handle(String handle) { + this.handle = handle; + return this; + } + + /** + * The team's identifier + * + * @return handle + */ + @JsonProperty(JSON_PROPERTY_HANDLE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getHandle() { + return handle; + } + + public void setHandle(String handle) { + this.handle = handle; + } + + /** + * The number of links belonging to the team maximum: 2147483647 + * + * @return linkCount + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LINK_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getLinkCount() { + return linkCount; + } + + public TeamCreateAttributes name(String name) { + this.name = name; + return this; + } + + /** + * The name of the team + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + /** Return true if this TeamCreateAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamCreateAttributes teamCreateAttributes = (TeamCreateAttributes) o; + return Objects.equals(this.description, teamCreateAttributes.description) + && Objects.equals(this.handle, teamCreateAttributes.handle) + && Objects.equals(this.linkCount, teamCreateAttributes.linkCount) + && Objects.equals(this.name, teamCreateAttributes.name); + } + + @Override + public int hashCode() { + return Objects.hash(description, handle, linkCount, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamCreateAttributes {\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" handle: ").append(toIndentedString(handle)).append("\n"); + sb.append(" linkCount: ").append(toIndentedString(linkCount)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TeamCreateRelationships.java b/src/main/java/com/datadog/api/client/v2/model/TeamCreateRelationships.java new file mode 100644 index 00000000000..5d5577856fb --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamCreateRelationships.java @@ -0,0 +1,82 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** Relationships formed with the team on creation */ +@JsonPropertyOrder({TeamCreateRelationships.JSON_PROPERTY_USERS}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TeamCreateRelationships { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_USERS = "users"; + private RelationshipToUsers users; + + public TeamCreateRelationships users(RelationshipToUsers users) { + this.users = users; + this.unparsed |= users.unparsed; + return this; + } + + /** + * Relationship to users. + * + * @return users + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public RelationshipToUsers getUsers() { + return users; + } + + public void setUsers(RelationshipToUsers users) { + this.users = users; + } + + /** Return true if this TeamCreateRelationships object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamCreateRelationships teamCreateRelationships = (TeamCreateRelationships) o; + return Objects.equals(this.users, teamCreateRelationships.users); + } + + @Override + public int hashCode() { + return Objects.hash(users); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamCreateRelationships {\n"); + sb.append(" users: ").append(toIndentedString(users)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TeamCreateRequest.java b/src/main/java/com/datadog/api/client/v2/model/TeamCreateRequest.java new file mode 100644 index 00000000000..c5733098a4f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamCreateRequest.java @@ -0,0 +1,91 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** Request to create a team */ +@JsonPropertyOrder({TeamCreateRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TeamCreateRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private TeamCreate data; + + public TeamCreateRequest() {} + + @JsonCreator + public TeamCreateRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) TeamCreate data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public TeamCreateRequest data(TeamCreate data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Team create + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TeamCreate getData() { + return data; + } + + public void setData(TeamCreate data) { + this.data = data; + } + + /** Return true if this TeamCreateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamCreateRequest teamCreateRequest = (TeamCreateRequest) o; + return Objects.equals(this.data, teamCreateRequest.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamCreateRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TeamData.java b/src/main/java/com/datadog/api/client/v2/model/TeamData.java new file mode 100644 index 00000000000..bcc2553cafb --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamData.java @@ -0,0 +1,154 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** A team */ +@JsonPropertyOrder({ + TeamData.JSON_PROPERTY_ATTRIBUTES, + TeamData.JSON_PROPERTY_ID, + TeamData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TeamData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private TeamAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private TeamType type = TeamType.TEAM; + + public TeamData() {} + + @JsonCreator + public TeamData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) TeamAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) TeamType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public TeamData attributes(TeamAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Team attributes + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TeamAttributes getAttributes() { + return attributes; + } + + public void setAttributes(TeamAttributes attributes) { + this.attributes = attributes; + } + + public TeamData id(String id) { + this.id = id; + return this; + } + + /** + * The team's identifier + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public TeamData type(TeamType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Team type + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TeamType getType() { + return type; + } + + public void setType(TeamType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** Return true if this TeamData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamData teamData = (TeamData) o; + return Objects.equals(this.attributes, teamData.attributes) + && Objects.equals(this.id, teamData.id) + && Objects.equals(this.type, teamData.type); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TeamIncluded.java b/src/main/java/com/datadog/api/client/v2/model/TeamIncluded.java new file mode 100644 index 00000000000..741d7823be6 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamIncluded.java @@ -0,0 +1,333 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.AbstractOpenApiSchema; +import com.datadog.api.client.JSON; +import com.datadog.api.client.UnparsedObject; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.JsonToken; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.MapperFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import jakarta.ws.rs.core.GenericType; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; + +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +@JsonDeserialize(using = TeamIncluded.TeamIncludedDeserializer.class) +@JsonSerialize(using = TeamIncluded.TeamIncludedSerializer.class) +public class TeamIncluded extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(TeamIncluded.class.getName()); + + @JsonIgnore public boolean unparsed = false; + + public static class TeamIncludedSerializer extends StdSerializer { + public TeamIncludedSerializer(Class t) { + super(t); + } + + public TeamIncludedSerializer() { + this(null); + } + + @Override + public void serialize(TeamIncluded value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.getActualInstance()); + } + } + + public static class TeamIncludedDeserializer extends StdDeserializer { + public TeamIncludedDeserializer() { + this(TeamIncluded.class); + } + + public TeamIncludedDeserializer(Class vc) { + super(vc); + } + + @Override + public TeamIncluded deserialize(JsonParser jp, DeserializationContext ctxt) + throws IOException, JsonProcessingException { + JsonNode tree = jp.readValueAsTree(); + Object deserialized = null; + Object tmp = null; + boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); + int match = 0; + JsonToken token = tree.traverse(jp.getCodec()).nextToken(); + // deserialize User + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (User.class.equals(Integer.class) + || User.class.equals(Long.class) + || User.class.equals(Float.class) + || User.class.equals(Double.class) + || User.class.equals(Boolean.class) + || User.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((User.class.equals(Integer.class) || User.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((User.class.equals(Float.class) || User.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (User.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (User.class.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(User.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + if (!((User) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'User'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'User'", e); + } + + // deserialize TeamLink + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (TeamLink.class.equals(Integer.class) + || TeamLink.class.equals(Long.class) + || TeamLink.class.equals(Float.class) + || TeamLink.class.equals(Double.class) + || TeamLink.class.equals(Boolean.class) + || TeamLink.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((TeamLink.class.equals(Integer.class) || TeamLink.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((TeamLink.class.equals(Float.class) || TeamLink.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (TeamLink.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (TeamLink.class.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(TeamLink.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + if (!((TeamLink) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'TeamLink'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'TeamLink'", e); + } + + // deserialize UserTeamPermission + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (UserTeamPermission.class.equals(Integer.class) + || UserTeamPermission.class.equals(Long.class) + || UserTeamPermission.class.equals(Float.class) + || UserTeamPermission.class.equals(Double.class) + || UserTeamPermission.class.equals(Boolean.class) + || UserTeamPermission.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((UserTeamPermission.class.equals(Integer.class) + || UserTeamPermission.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((UserTeamPermission.class.equals(Float.class) + || UserTeamPermission.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (UserTeamPermission.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (UserTeamPermission.class.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(UserTeamPermission.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + if (!((UserTeamPermission) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'UserTeamPermission'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'UserTeamPermission'", e); + } + + TeamIncluded ret = new TeamIncluded(); + if (match == 1) { + ret.setActualInstance(deserialized); + } else { + Map res = + new ObjectMapper() + .readValue( + tree.traverse(jp.getCodec()).readValueAsTree().toString(), + new TypeReference>() {}); + ret.setActualInstance(new UnparsedObject(res)); + } + return ret; + } + + /** Handle deserialization of the 'null' value. */ + @Override + public TeamIncluded getNullValue(DeserializationContext ctxt) throws JsonMappingException { + throw new JsonMappingException(ctxt.getParser(), "TeamIncluded cannot be null"); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public TeamIncluded() { + super("oneOf", Boolean.FALSE); + } + + public TeamIncluded(User o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public TeamIncluded(TeamLink o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public TeamIncluded(UserTeamPermission o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("User", new GenericType() {}); + schemas.put("TeamLink", new GenericType() {}); + schemas.put("UserTeamPermission", new GenericType() {}); + JSON.registerDescendants(TeamIncluded.class, Collections.unmodifiableMap(schemas)); + } + + @Override + public Map getSchemas() { + return TeamIncluded.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: User, TeamLink, UserTeamPermission + * + *

It could be an instance of the 'oneOf' schemas. The oneOf child schemas may themselves be a + * composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (JSON.isInstanceOf(User.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf(TeamLink.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf(UserTeamPermission.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(UnparsedObject.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + throw new RuntimeException("Invalid instance type. Must be User, TeamLink, UserTeamPermission"); + } + + /** + * Get the actual instance, which can be the following: User, TeamLink, UserTeamPermission + * + * @return The actual instance (User, TeamLink, UserTeamPermission) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `User`. If the actual instance is not `User`, the ClassCastException + * will be thrown. + * + * @return The actual instance of `User` + * @throws ClassCastException if the instance is not `User` + */ + public User getUser() throws ClassCastException { + return (User) super.getActualInstance(); + } + + /** + * Get the actual instance of `TeamLink`. If the actual instance is not `TeamLink`, the + * ClassCastException will be thrown. + * + * @return The actual instance of `TeamLink` + * @throws ClassCastException if the instance is not `TeamLink` + */ + public TeamLink getTeamLink() throws ClassCastException { + return (TeamLink) super.getActualInstance(); + } + + /** + * Get the actual instance of `UserTeamPermission`. If the actual instance is not + * `UserTeamPermission`, the ClassCastException will be thrown. + * + * @return The actual instance of `UserTeamPermission` + * @throws ClassCastException if the instance is not `UserTeamPermission` + */ + public UserTeamPermission getUserTeamPermission() throws ClassCastException { + return (UserTeamPermission) super.getActualInstance(); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TeamLink.java b/src/main/java/com/datadog/api/client/v2/model/TeamLink.java new file mode 100644 index 00000000000..9988c7d596c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamLink.java @@ -0,0 +1,155 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** Team link */ +@JsonPropertyOrder({ + TeamLink.JSON_PROPERTY_ATTRIBUTES, + TeamLink.JSON_PROPERTY_ID, + TeamLink.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TeamLink { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private TeamLinkAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private TeamLinkType type = TeamLinkType.TEAM_LINKS; + + public TeamLink() {} + + @JsonCreator + public TeamLink( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + TeamLinkAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) TeamLinkType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public TeamLink attributes(TeamLinkAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Team link attributes + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TeamLinkAttributes getAttributes() { + return attributes; + } + + public void setAttributes(TeamLinkAttributes attributes) { + this.attributes = attributes; + } + + public TeamLink id(String id) { + this.id = id; + return this; + } + + /** + * The team link's identifier + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public TeamLink type(TeamLinkType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Team link type + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TeamLinkType getType() { + return type; + } + + public void setType(TeamLinkType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** Return true if this TeamLink object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamLink teamLink = (TeamLink) o; + return Objects.equals(this.attributes, teamLink.attributes) + && Objects.equals(this.id, teamLink.id) + && Objects.equals(this.type, teamLink.type); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamLink {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TeamLinkAttributes.java b/src/main/java/com/datadog/api/client/v2/model/TeamLinkAttributes.java new file mode 100644 index 00000000000..c5c945bca61 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamLinkAttributes.java @@ -0,0 +1,164 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** Team link attributes */ +@JsonPropertyOrder({ + TeamLinkAttributes.JSON_PROPERTY_LABEL, + TeamLinkAttributes.JSON_PROPERTY_POSITION, + TeamLinkAttributes.JSON_PROPERTY_TEAM_ID, + TeamLinkAttributes.JSON_PROPERTY_URL +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TeamLinkAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_LABEL = "label"; + private String label; + + public static final String JSON_PROPERTY_POSITION = "position"; + private Integer position; + + public static final String JSON_PROPERTY_TEAM_ID = "team_id"; + private String teamId; + + public static final String JSON_PROPERTY_URL = "url"; + private String url; + + public TeamLinkAttributes() {} + + @JsonCreator + public TeamLinkAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_LABEL) String label, + @JsonProperty(required = true, value = JSON_PROPERTY_URL) String url) { + this.label = label; + this.url = url; + } + + public TeamLinkAttributes label(String label) { + this.label = label; + return this; + } + + /** + * The link's label + * + * @return label + */ + @JsonProperty(JSON_PROPERTY_LABEL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getLabel() { + return label; + } + + public void setLabel(String label) { + this.label = label; + } + + public TeamLinkAttributes position(Integer position) { + this.position = position; + return this; + } + + /** + * The link's position, used to sort links for the team maximum: 2147483647 + * + * @return position + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_POSITION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPosition() { + return position; + } + + public void setPosition(Integer position) { + this.position = position; + } + + /** + * ID of the team the link is associated with + * + * @return teamId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEAM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTeamId() { + return teamId; + } + + public TeamLinkAttributes url(String url) { + this.url = url; + return this; + } + + /** + * The URL for the link + * + * @return url + */ + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + /** Return true if this TeamLinkAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamLinkAttributes teamLinkAttributes = (TeamLinkAttributes) o; + return Objects.equals(this.label, teamLinkAttributes.label) + && Objects.equals(this.position, teamLinkAttributes.position) + && Objects.equals(this.teamId, teamLinkAttributes.teamId) + && Objects.equals(this.url, teamLinkAttributes.url); + } + + @Override + public int hashCode() { + return Objects.hash(label, position, teamId, url); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamLinkAttributes {\n"); + sb.append(" label: ").append(toIndentedString(label)).append("\n"); + sb.append(" position: ").append(toIndentedString(position)).append("\n"); + sb.append(" teamId: ").append(toIndentedString(teamId)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TeamLinkCreate.java b/src/main/java/com/datadog/api/client/v2/model/TeamLinkCreate.java new file mode 100644 index 00000000000..f4e4fe1a8dd --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamLinkCreate.java @@ -0,0 +1,124 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** Team link create */ +@JsonPropertyOrder({TeamLinkCreate.JSON_PROPERTY_ATTRIBUTES, TeamLinkCreate.JSON_PROPERTY_TYPE}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TeamLinkCreate { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private TeamLinkAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private TeamLinkType type = TeamLinkType.TEAM_LINKS; + + public TeamLinkCreate() {} + + @JsonCreator + public TeamLinkCreate( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + TeamLinkAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) TeamLinkType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public TeamLinkCreate attributes(TeamLinkAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Team link attributes + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TeamLinkAttributes getAttributes() { + return attributes; + } + + public void setAttributes(TeamLinkAttributes attributes) { + this.attributes = attributes; + } + + public TeamLinkCreate type(TeamLinkType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Team link type + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TeamLinkType getType() { + return type; + } + + public void setType(TeamLinkType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** Return true if this TeamLinkCreate object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamLinkCreate teamLinkCreate = (TeamLinkCreate) o; + return Objects.equals(this.attributes, teamLinkCreate.attributes) + && Objects.equals(this.type, teamLinkCreate.type); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamLinkCreate {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TeamLinkCreateRequest.java b/src/main/java/com/datadog/api/client/v2/model/TeamLinkCreateRequest.java new file mode 100644 index 00000000000..c6fd67aae7a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamLinkCreateRequest.java @@ -0,0 +1,91 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** Team link create request */ +@JsonPropertyOrder({TeamLinkCreateRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TeamLinkCreateRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private TeamLinkCreate data; + + public TeamLinkCreateRequest() {} + + @JsonCreator + public TeamLinkCreateRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) TeamLinkCreate data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public TeamLinkCreateRequest data(TeamLinkCreate data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Team link create + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TeamLinkCreate getData() { + return data; + } + + public void setData(TeamLinkCreate data) { + this.data = data; + } + + /** Return true if this TeamLinkCreateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamLinkCreateRequest teamLinkCreateRequest = (TeamLinkCreateRequest) o; + return Objects.equals(this.data, teamLinkCreateRequest.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamLinkCreateRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TeamLinkResponse.java b/src/main/java/com/datadog/api/client/v2/model/TeamLinkResponse.java new file mode 100644 index 00000000000..99c2b68f73c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamLinkResponse.java @@ -0,0 +1,82 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** Team link response */ +@JsonPropertyOrder({TeamLinkResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TeamLinkResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private TeamLink data; + + public TeamLinkResponse data(TeamLink data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Team link + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TeamLink getData() { + return data; + } + + public void setData(TeamLink data) { + this.data = data; + } + + /** Return true if this TeamLinkResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamLinkResponse teamLinkResponse = (TeamLinkResponse) o; + return Objects.equals(this.data, teamLinkResponse.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamLinkResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TeamLinkType.java b/src/main/java/com/datadog/api/client/v2/model/TeamLinkType.java new file mode 100644 index 00000000000..3be82fb4181 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamLinkType.java @@ -0,0 +1,91 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Objects; +import java.util.Set; + +/** Team link type */ +@JsonSerialize(using = TeamLinkType.TeamLinkTypeSerializer.class) +public class TeamLinkType { + + public static final TeamLinkType TEAM_LINKS = new TeamLinkType("team_links"); + + private static final Set allowedValues = new HashSet(Arrays.asList("team_links")); + + private String value; + + public boolean isValid() { + return allowedValues.contains(this.value); + } + + TeamLinkType(String value) { + this.value = value; + } + + public static class TeamLinkTypeSerializer extends StdSerializer { + public TeamLinkTypeSerializer(Class t) { + super(t); + } + + public TeamLinkTypeSerializer() { + this(null); + } + + @Override + public void serialize(TeamLinkType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonValue + public String getValue() { + return this.value; + } + + public void setValue(String value) { + this.value = value; + } + + /** Return true if this TeamLinkType object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return this.value.equals(((TeamLinkType) o).value); + } + + @Override + public int hashCode() { + return Objects.hash(value); + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TeamLinkType fromValue(String value) { + return new TeamLinkType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TeamLinksResponse.java b/src/main/java/com/datadog/api/client/v2/model/TeamLinksResponse.java new file mode 100644 index 00000000000..b53a4627390 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamLinksResponse.java @@ -0,0 +1,95 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** Team links response */ +@JsonPropertyOrder({TeamLinksResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TeamLinksResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = null; + + public TeamLinksResponse data(List data) { + this.data = data; + for (TeamLink item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public TeamLinksResponse addDataItem(TeamLink dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * Team links response data + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + /** Return true if this TeamLinksResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamLinksResponse teamLinksResponse = (TeamLinksResponse) o; + return Objects.equals(this.data, teamLinksResponse.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamLinksResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TeamPermissionSetting.java b/src/main/java/com/datadog/api/client/v2/model/TeamPermissionSetting.java new file mode 100644 index 00000000000..88d6681bcb6 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamPermissionSetting.java @@ -0,0 +1,152 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** Team permission setting */ +@JsonPropertyOrder({ + TeamPermissionSetting.JSON_PROPERTY_ATTRIBUTES, + TeamPermissionSetting.JSON_PROPERTY_ID, + TeamPermissionSetting.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TeamPermissionSetting { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private TeamPermissionSettingAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private TeamPermissionSettingType type = TeamPermissionSettingType.TEAM_PERMISSION_SETTINGS; + + public TeamPermissionSetting() {} + + @JsonCreator + public TeamPermissionSetting( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) TeamPermissionSettingType type) { + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public TeamPermissionSetting attributes(TeamPermissionSettingAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Team permission setting attributes + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TeamPermissionSettingAttributes getAttributes() { + return attributes; + } + + public void setAttributes(TeamPermissionSettingAttributes attributes) { + this.attributes = attributes; + } + + public TeamPermissionSetting id(String id) { + this.id = id; + return this; + } + + /** + * The team permission setting's identifier + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public TeamPermissionSetting type(TeamPermissionSettingType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Team permission setting type + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TeamPermissionSettingType getType() { + return type; + } + + public void setType(TeamPermissionSettingType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** Return true if this TeamPermissionSetting object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamPermissionSetting teamPermissionSetting = (TeamPermissionSetting) o; + return Objects.equals(this.attributes, teamPermissionSetting.attributes) + && Objects.equals(this.id, teamPermissionSetting.id) + && Objects.equals(this.type, teamPermissionSetting.type); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamPermissionSetting {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TeamPermissionSettingAttributes.java b/src/main/java/com/datadog/api/client/v2/model/TeamPermissionSettingAttributes.java new file mode 100644 index 00000000000..96cccb228f6 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamPermissionSettingAttributes.java @@ -0,0 +1,161 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.List; +import java.util.Objects; + +/** Team permission setting attributes */ +@JsonPropertyOrder({ + TeamPermissionSettingAttributes.JSON_PROPERTY_ACTION, + TeamPermissionSettingAttributes.JSON_PROPERTY_EDITABLE, + TeamPermissionSettingAttributes.JSON_PROPERTY_OPTIONS, + TeamPermissionSettingAttributes.JSON_PROPERTY_TITLE, + TeamPermissionSettingAttributes.JSON_PROPERTY_VALUE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TeamPermissionSettingAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ACTION = "action"; + private TeamPermissionSettingSerializerAction action; + + public static final String JSON_PROPERTY_EDITABLE = "editable"; + private Boolean editable; + + public static final String JSON_PROPERTY_OPTIONS = "options"; + private List options = null; + + public static final String JSON_PROPERTY_TITLE = "title"; + private String title; + + public static final String JSON_PROPERTY_VALUE = "value"; + private TeamPermissionSettingValue value; + + /** + * The identifier for the action + * + * @return action + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ACTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TeamPermissionSettingSerializerAction getAction() { + return action; + } + + /** + * Whether or not the permission setting is editable by the current user + * + * @return editable + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EDITABLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEditable() { + return editable; + } + + /** + * Possible values for action + * + * @return options + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getOptions() { + return options; + } + + /** + * The team permission name + * + * @return title + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTitle() { + return title; + } + + public TeamPermissionSettingAttributes value(TeamPermissionSettingValue value) { + this.value = value; + this.unparsed |= !value.isValid(); + return this; + } + + /** + * What type of user is allowed to perform the specified action + * + * @return value + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TeamPermissionSettingValue getValue() { + return value; + } + + public void setValue(TeamPermissionSettingValue value) { + if (!value.isValid()) { + this.unparsed = true; + } + this.value = value; + } + + /** Return true if this TeamPermissionSettingAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamPermissionSettingAttributes teamPermissionSettingAttributes = + (TeamPermissionSettingAttributes) o; + return Objects.equals(this.action, teamPermissionSettingAttributes.action) + && Objects.equals(this.editable, teamPermissionSettingAttributes.editable) + && Objects.equals(this.options, teamPermissionSettingAttributes.options) + && Objects.equals(this.title, teamPermissionSettingAttributes.title) + && Objects.equals(this.value, teamPermissionSettingAttributes.value); + } + + @Override + public int hashCode() { + return Objects.hash(action, editable, options, title, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamPermissionSettingAttributes {\n"); + sb.append(" action: ").append(toIndentedString(action)).append("\n"); + sb.append(" editable: ").append(toIndentedString(editable)).append("\n"); + sb.append(" options: ").append(toIndentedString(options)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TeamPermissionSettingResponse.java b/src/main/java/com/datadog/api/client/v2/model/TeamPermissionSettingResponse.java new file mode 100644 index 00000000000..633c9befb69 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamPermissionSettingResponse.java @@ -0,0 +1,82 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** Team permission setting response */ +@JsonPropertyOrder({TeamPermissionSettingResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TeamPermissionSettingResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private TeamPermissionSetting data; + + public TeamPermissionSettingResponse data(TeamPermissionSetting data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Team permission setting + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TeamPermissionSetting getData() { + return data; + } + + public void setData(TeamPermissionSetting data) { + this.data = data; + } + + /** Return true if this TeamPermissionSettingResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamPermissionSettingResponse teamPermissionSettingResponse = (TeamPermissionSettingResponse) o; + return Objects.equals(this.data, teamPermissionSettingResponse.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamPermissionSettingResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TeamPermissionSettingSerializerAction.java b/src/main/java/com/datadog/api/client/v2/model/TeamPermissionSettingSerializerAction.java new file mode 100644 index 00000000000..448fb9e7c07 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamPermissionSettingSerializerAction.java @@ -0,0 +1,102 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Objects; +import java.util.Set; + +/** The identifier for the action */ +@JsonSerialize( + using = + TeamPermissionSettingSerializerAction.TeamPermissionSettingSerializerActionSerializer.class) +public class TeamPermissionSettingSerializerAction { + + public static final TeamPermissionSettingSerializerAction MANAGE_MEMBERSHIP = + new TeamPermissionSettingSerializerAction("manage_membership"); + public static final TeamPermissionSettingSerializerAction EDIT = + new TeamPermissionSettingSerializerAction("edit"); + + private static final Set allowedValues = + new HashSet(Arrays.asList("manage_membership", "edit")); + + private String value; + + public boolean isValid() { + return allowedValues.contains(this.value); + } + + TeamPermissionSettingSerializerAction(String value) { + this.value = value; + } + + public static class TeamPermissionSettingSerializerActionSerializer + extends StdSerializer { + public TeamPermissionSettingSerializerActionSerializer( + Class t) { + super(t); + } + + public TeamPermissionSettingSerializerActionSerializer() { + this(null); + } + + @Override + public void serialize( + TeamPermissionSettingSerializerAction value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonValue + public String getValue() { + return this.value; + } + + public void setValue(String value) { + this.value = value; + } + + /** Return true if this TeamPermissionSettingSerializerAction object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return this.value.equals(((TeamPermissionSettingSerializerAction) o).value); + } + + @Override + public int hashCode() { + return Objects.hash(value); + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TeamPermissionSettingSerializerAction fromValue(String value) { + return new TeamPermissionSettingSerializerAction(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TeamPermissionSettingType.java b/src/main/java/com/datadog/api/client/v2/model/TeamPermissionSettingType.java new file mode 100644 index 00000000000..2864abc4d60 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamPermissionSettingType.java @@ -0,0 +1,95 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Objects; +import java.util.Set; + +/** Team permission setting type */ +@JsonSerialize(using = TeamPermissionSettingType.TeamPermissionSettingTypeSerializer.class) +public class TeamPermissionSettingType { + + public static final TeamPermissionSettingType TEAM_PERMISSION_SETTINGS = + new TeamPermissionSettingType("team_permission_settings"); + + private static final Set allowedValues = + new HashSet(Arrays.asList("team_permission_settings")); + + private String value; + + public boolean isValid() { + return allowedValues.contains(this.value); + } + + TeamPermissionSettingType(String value) { + this.value = value; + } + + public static class TeamPermissionSettingTypeSerializer + extends StdSerializer { + public TeamPermissionSettingTypeSerializer(Class t) { + super(t); + } + + public TeamPermissionSettingTypeSerializer() { + this(null); + } + + @Override + public void serialize( + TeamPermissionSettingType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonValue + public String getValue() { + return this.value; + } + + public void setValue(String value) { + this.value = value; + } + + /** Return true if this TeamPermissionSettingType object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return this.value.equals(((TeamPermissionSettingType) o).value); + } + + @Override + public int hashCode() { + return Objects.hash(value); + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TeamPermissionSettingType fromValue(String value) { + return new TeamPermissionSettingType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TeamPermissionSettingUpdate.java b/src/main/java/com/datadog/api/client/v2/model/TeamPermissionSettingUpdate.java new file mode 100644 index 00000000000..8bda1fa9ab7 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamPermissionSettingUpdate.java @@ -0,0 +1,124 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** Team permission setting update */ +@JsonPropertyOrder({ + TeamPermissionSettingUpdate.JSON_PROPERTY_ATTRIBUTES, + TeamPermissionSettingUpdate.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TeamPermissionSettingUpdate { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private TeamPermissionSettingUpdateAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private TeamPermissionSettingType type = TeamPermissionSettingType.TEAM_PERMISSION_SETTINGS; + + public TeamPermissionSettingUpdate() {} + + @JsonCreator + public TeamPermissionSettingUpdate( + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) TeamPermissionSettingType type) { + this.type = type; + this.unparsed |= !type.isValid(); + } + + public TeamPermissionSettingUpdate attributes(TeamPermissionSettingUpdateAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Team permission setting update attributes + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TeamPermissionSettingUpdateAttributes getAttributes() { + return attributes; + } + + public void setAttributes(TeamPermissionSettingUpdateAttributes attributes) { + this.attributes = attributes; + } + + public TeamPermissionSettingUpdate type(TeamPermissionSettingType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Team permission setting type + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TeamPermissionSettingType getType() { + return type; + } + + public void setType(TeamPermissionSettingType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** Return true if this TeamPermissionSettingUpdate object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamPermissionSettingUpdate teamPermissionSettingUpdate = (TeamPermissionSettingUpdate) o; + return Objects.equals(this.attributes, teamPermissionSettingUpdate.attributes) + && Objects.equals(this.type, teamPermissionSettingUpdate.type); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamPermissionSettingUpdate {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TeamPermissionSettingUpdateAttributes.java b/src/main/java/com/datadog/api/client/v2/model/TeamPermissionSettingUpdateAttributes.java new file mode 100644 index 00000000000..7037bef642d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamPermissionSettingUpdateAttributes.java @@ -0,0 +1,86 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** Team permission setting update attributes */ +@JsonPropertyOrder({TeamPermissionSettingUpdateAttributes.JSON_PROPERTY_VALUE}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TeamPermissionSettingUpdateAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_VALUE = "value"; + private TeamPermissionSettingValue value; + + public TeamPermissionSettingUpdateAttributes value(TeamPermissionSettingValue value) { + this.value = value; + this.unparsed |= !value.isValid(); + return this; + } + + /** + * What type of user is allowed to perform the specified action + * + * @return value + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TeamPermissionSettingValue getValue() { + return value; + } + + public void setValue(TeamPermissionSettingValue value) { + if (!value.isValid()) { + this.unparsed = true; + } + this.value = value; + } + + /** Return true if this TeamPermissionSettingUpdateAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamPermissionSettingUpdateAttributes teamPermissionSettingUpdateAttributes = + (TeamPermissionSettingUpdateAttributes) o; + return Objects.equals(this.value, teamPermissionSettingUpdateAttributes.value); + } + + @Override + public int hashCode() { + return Objects.hash(value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamPermissionSettingUpdateAttributes {\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TeamPermissionSettingUpdateRequest.java b/src/main/java/com/datadog/api/client/v2/model/TeamPermissionSettingUpdateRequest.java new file mode 100644 index 00000000000..3fc7f05ecb8 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamPermissionSettingUpdateRequest.java @@ -0,0 +1,92 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** Team permission setting update request */ +@JsonPropertyOrder({TeamPermissionSettingUpdateRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TeamPermissionSettingUpdateRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private TeamPermissionSettingUpdate data; + + public TeamPermissionSettingUpdateRequest() {} + + @JsonCreator + public TeamPermissionSettingUpdateRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) TeamPermissionSettingUpdate data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public TeamPermissionSettingUpdateRequest data(TeamPermissionSettingUpdate data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Team permission setting update + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TeamPermissionSettingUpdate getData() { + return data; + } + + public void setData(TeamPermissionSettingUpdate data) { + this.data = data; + } + + /** Return true if this TeamPermissionSettingUpdateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamPermissionSettingUpdateRequest teamPermissionSettingUpdateRequest = + (TeamPermissionSettingUpdateRequest) o; + return Objects.equals(this.data, teamPermissionSettingUpdateRequest.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamPermissionSettingUpdateRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TeamPermissionSettingValue.java b/src/main/java/com/datadog/api/client/v2/model/TeamPermissionSettingValue.java new file mode 100644 index 00000000000..5afcdf154c8 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamPermissionSettingValue.java @@ -0,0 +1,103 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Objects; +import java.util.Set; + +/** What type of user is allowed to perform the specified action */ +@JsonSerialize(using = TeamPermissionSettingValue.TeamPermissionSettingValueSerializer.class) +public class TeamPermissionSettingValue { + + public static final TeamPermissionSettingValue ADMINS = new TeamPermissionSettingValue("admins"); + public static final TeamPermissionSettingValue MEMBERS = + new TeamPermissionSettingValue("members"); + public static final TeamPermissionSettingValue ORGANIZATION = + new TeamPermissionSettingValue("organization"); + public static final TeamPermissionSettingValue USER_ACCESS_MANAGE = + new TeamPermissionSettingValue("user_access_manage"); + public static final TeamPermissionSettingValue TEAMS_MANAGE = + new TeamPermissionSettingValue("teams_manage"); + + private static final Set allowedValues = + new HashSet( + Arrays.asList("admins", "members", "organization", "user_access_manage", "teams_manage")); + + private String value; + + public boolean isValid() { + return allowedValues.contains(this.value); + } + + TeamPermissionSettingValue(String value) { + this.value = value; + } + + public static class TeamPermissionSettingValueSerializer + extends StdSerializer { + public TeamPermissionSettingValueSerializer(Class t) { + super(t); + } + + public TeamPermissionSettingValueSerializer() { + this(null); + } + + @Override + public void serialize( + TeamPermissionSettingValue value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonValue + public String getValue() { + return this.value; + } + + public void setValue(String value) { + this.value = value; + } + + /** Return true if this TeamPermissionSettingValue object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return this.value.equals(((TeamPermissionSettingValue) o).value); + } + + @Override + public int hashCode() { + return Objects.hash(value); + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TeamPermissionSettingValue fromValue(String value) { + return new TeamPermissionSettingValue(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TeamPermissionSettingsResponse.java b/src/main/java/com/datadog/api/client/v2/model/TeamPermissionSettingsResponse.java new file mode 100644 index 00000000000..fb4667c185b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamPermissionSettingsResponse.java @@ -0,0 +1,96 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** Team permission settings response */ +@JsonPropertyOrder({TeamPermissionSettingsResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TeamPermissionSettingsResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = null; + + public TeamPermissionSettingsResponse data(List data) { + this.data = data; + for (TeamPermissionSetting item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public TeamPermissionSettingsResponse addDataItem(TeamPermissionSetting dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * Team permission settings response data + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + /** Return true if this TeamPermissionSettingsResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamPermissionSettingsResponse teamPermissionSettingsResponse = + (TeamPermissionSettingsResponse) o; + return Objects.equals(this.data, teamPermissionSettingsResponse.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamPermissionSettingsResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TeamRelationships.java b/src/main/java/com/datadog/api/client/v2/model/TeamRelationships.java new file mode 100644 index 00000000000..f35d32df92b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamRelationships.java @@ -0,0 +1,115 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** Resources related to a team */ +@JsonPropertyOrder({ + TeamRelationships.JSON_PROPERTY_TEAM_LINKS, + TeamRelationships.JSON_PROPERTY_USER_TEAM_PERMISSIONS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TeamRelationships { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_TEAM_LINKS = "team_links"; + private RelationshipToTeamLinks teamLinks; + + public static final String JSON_PROPERTY_USER_TEAM_PERMISSIONS = "user_team_permissions"; + private RelationshipToUserTeamPermission userTeamPermissions; + + public TeamRelationships teamLinks(RelationshipToTeamLinks teamLinks) { + this.teamLinks = teamLinks; + this.unparsed |= teamLinks.unparsed; + return this; + } + + /** + * Relationship between a team and a team link + * + * @return teamLinks + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEAM_LINKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public RelationshipToTeamLinks getTeamLinks() { + return teamLinks; + } + + public void setTeamLinks(RelationshipToTeamLinks teamLinks) { + this.teamLinks = teamLinks; + } + + public TeamRelationships userTeamPermissions( + RelationshipToUserTeamPermission userTeamPermissions) { + this.userTeamPermissions = userTeamPermissions; + this.unparsed |= userTeamPermissions.unparsed; + return this; + } + + /** + * Relationship between a user team permission and a team + * + * @return userTeamPermissions + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USER_TEAM_PERMISSIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public RelationshipToUserTeamPermission getUserTeamPermissions() { + return userTeamPermissions; + } + + public void setUserTeamPermissions(RelationshipToUserTeamPermission userTeamPermissions) { + this.userTeamPermissions = userTeamPermissions; + } + + /** Return true if this TeamRelationships object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamRelationships teamRelationships = (TeamRelationships) o; + return Objects.equals(this.teamLinks, teamRelationships.teamLinks) + && Objects.equals(this.userTeamPermissions, teamRelationships.userTeamPermissions); + } + + @Override + public int hashCode() { + return Objects.hash(teamLinks, userTeamPermissions); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamRelationships {\n"); + sb.append(" teamLinks: ").append(toIndentedString(teamLinks)).append("\n"); + sb.append(" userTeamPermissions: ") + .append(toIndentedString(userTeamPermissions)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TeamResponse.java b/src/main/java/com/datadog/api/client/v2/model/TeamResponse.java new file mode 100644 index 00000000000..d131e54a2fb --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamResponse.java @@ -0,0 +1,82 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** Response with a team */ +@JsonPropertyOrder({TeamResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TeamResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private TeamData data; + + public TeamResponse data(TeamData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * A team + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TeamData getData() { + return data; + } + + public void setData(TeamData data) { + this.data = data; + } + + /** Return true if this TeamResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamResponse teamResponse = (TeamResponse) o; + return Objects.equals(this.data, teamResponse.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TeamType.java b/src/main/java/com/datadog/api/client/v2/model/TeamType.java new file mode 100644 index 00000000000..3c7e149a30a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamType.java @@ -0,0 +1,91 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Objects; +import java.util.Set; + +/** Team type */ +@JsonSerialize(using = TeamType.TeamTypeSerializer.class) +public class TeamType { + + public static final TeamType TEAM = new TeamType("team"); + + private static final Set allowedValues = new HashSet(Arrays.asList("team")); + + private String value; + + public boolean isValid() { + return allowedValues.contains(this.value); + } + + TeamType(String value) { + this.value = value; + } + + public static class TeamTypeSerializer extends StdSerializer { + public TeamTypeSerializer(Class t) { + super(t); + } + + public TeamTypeSerializer() { + this(null); + } + + @Override + public void serialize(TeamType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonValue + public String getValue() { + return this.value; + } + + public void setValue(String value) { + this.value = value; + } + + /** Return true if this TeamType object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return this.value.equals(((TeamType) o).value); + } + + @Override + public int hashCode() { + return Objects.hash(value); + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TeamType fromValue(String value) { + return new TeamType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TeamUpdate.java b/src/main/java/com/datadog/api/client/v2/model/TeamUpdate.java new file mode 100644 index 00000000000..6568b245d80 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamUpdate.java @@ -0,0 +1,155 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** Team update request */ +@JsonPropertyOrder({ + TeamUpdate.JSON_PROPERTY_ATTRIBUTES, + TeamUpdate.JSON_PROPERTY_RELATIONSHIPS, + TeamUpdate.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TeamUpdate { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private TeamUpdateAttributes attributes; + + public static final String JSON_PROPERTY_RELATIONSHIPS = "relationships"; + private TeamUpdateRelationships relationships; + + public static final String JSON_PROPERTY_TYPE = "type"; + private TeamType type = TeamType.TEAM; + + public TeamUpdate() {} + + @JsonCreator + public TeamUpdate( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + TeamUpdateAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) TeamType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public TeamUpdate attributes(TeamUpdateAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Team update attributes + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TeamUpdateAttributes getAttributes() { + return attributes; + } + + public void setAttributes(TeamUpdateAttributes attributes) { + this.attributes = attributes; + } + + public TeamUpdate relationships(TeamUpdateRelationships relationships) { + this.relationships = relationships; + this.unparsed |= relationships.unparsed; + return this; + } + + /** + * Team update relationships + * + * @return relationships + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RELATIONSHIPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TeamUpdateRelationships getRelationships() { + return relationships; + } + + public void setRelationships(TeamUpdateRelationships relationships) { + this.relationships = relationships; + } + + public TeamUpdate type(TeamType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Team type + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TeamType getType() { + return type; + } + + public void setType(TeamType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** Return true if this TeamUpdate object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamUpdate teamUpdate = (TeamUpdate) o; + return Objects.equals(this.attributes, teamUpdate.attributes) + && Objects.equals(this.relationships, teamUpdate.relationships) + && Objects.equals(this.type, teamUpdate.type); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, relationships, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamUpdate {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" relationships: ").append(toIndentedString(relationships)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TeamUpdateAttributes.java b/src/main/java/com/datadog/api/client/v2/model/TeamUpdateAttributes.java new file mode 100644 index 00000000000..6de7c48f15c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamUpdateAttributes.java @@ -0,0 +1,191 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** Team update attributes */ +@JsonPropertyOrder({ + TeamUpdateAttributes.JSON_PROPERTY_COLOR, + TeamUpdateAttributes.JSON_PROPERTY_DESCRIPTION, + TeamUpdateAttributes.JSON_PROPERTY_HANDLE, + TeamUpdateAttributes.JSON_PROPERTY_LINK_COUNT, + TeamUpdateAttributes.JSON_PROPERTY_NAME +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TeamUpdateAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_COLOR = "color"; + private Integer color; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_HANDLE = "handle"; + private String handle; + + public static final String JSON_PROPERTY_LINK_COUNT = "link_count"; + private Integer linkCount; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public TeamUpdateAttributes() {} + + @JsonCreator + public TeamUpdateAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_HANDLE) String handle, + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name) { + this.handle = handle; + this.name = name; + } + + public TeamUpdateAttributes color(Integer color) { + this.color = color; + return this; + } + + /** + * An identifier for the color representing the team minimum: 0 maximum: 13 + * + * @return color + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getColor() { + return color; + } + + public void setColor(Integer color) { + this.color = color; + } + + public TeamUpdateAttributes description(String description) { + this.description = description; + return this; + } + + /** + * Free-form markdown description/content for the team's homepage + * + * @return description + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public TeamUpdateAttributes handle(String handle) { + this.handle = handle; + return this; + } + + /** + * The team's identifier + * + * @return handle + */ + @JsonProperty(JSON_PROPERTY_HANDLE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getHandle() { + return handle; + } + + public void setHandle(String handle) { + this.handle = handle; + } + + /** + * The number of links belonging to the team maximum: 2147483647 + * + * @return linkCount + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LINK_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getLinkCount() { + return linkCount; + } + + public TeamUpdateAttributes name(String name) { + this.name = name; + return this; + } + + /** + * The name of the team + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + /** Return true if this TeamUpdateAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamUpdateAttributes teamUpdateAttributes = (TeamUpdateAttributes) o; + return Objects.equals(this.color, teamUpdateAttributes.color) + && Objects.equals(this.description, teamUpdateAttributes.description) + && Objects.equals(this.handle, teamUpdateAttributes.handle) + && Objects.equals(this.linkCount, teamUpdateAttributes.linkCount) + && Objects.equals(this.name, teamUpdateAttributes.name); + } + + @Override + public int hashCode() { + return Objects.hash(color, description, handle, linkCount, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamUpdateAttributes {\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" handle: ").append(toIndentedString(handle)).append("\n"); + sb.append(" linkCount: ").append(toIndentedString(linkCount)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TeamUpdateRelationships.java b/src/main/java/com/datadog/api/client/v2/model/TeamUpdateRelationships.java new file mode 100644 index 00000000000..1c40f8cd3b6 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamUpdateRelationships.java @@ -0,0 +1,82 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** Team update relationships */ +@JsonPropertyOrder({TeamUpdateRelationships.JSON_PROPERTY_TEAM_LINKS}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TeamUpdateRelationships { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_TEAM_LINKS = "team_links"; + private RelationshipToTeamLinks teamLinks; + + public TeamUpdateRelationships teamLinks(RelationshipToTeamLinks teamLinks) { + this.teamLinks = teamLinks; + this.unparsed |= teamLinks.unparsed; + return this; + } + + /** + * Relationship between a team and a team link + * + * @return teamLinks + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEAM_LINKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public RelationshipToTeamLinks getTeamLinks() { + return teamLinks; + } + + public void setTeamLinks(RelationshipToTeamLinks teamLinks) { + this.teamLinks = teamLinks; + } + + /** Return true if this TeamUpdateRelationships object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamUpdateRelationships teamUpdateRelationships = (TeamUpdateRelationships) o; + return Objects.equals(this.teamLinks, teamUpdateRelationships.teamLinks); + } + + @Override + public int hashCode() { + return Objects.hash(teamLinks); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamUpdateRelationships {\n"); + sb.append(" teamLinks: ").append(toIndentedString(teamLinks)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TeamUpdateRequest.java b/src/main/java/com/datadog/api/client/v2/model/TeamUpdateRequest.java new file mode 100644 index 00000000000..b0086fb8724 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamUpdateRequest.java @@ -0,0 +1,91 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** Team update request */ +@JsonPropertyOrder({TeamUpdateRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TeamUpdateRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private TeamUpdate data; + + public TeamUpdateRequest() {} + + @JsonCreator + public TeamUpdateRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) TeamUpdate data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public TeamUpdateRequest data(TeamUpdate data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Team update request + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TeamUpdate getData() { + return data; + } + + public void setData(TeamUpdate data) { + this.data = data; + } + + /** Return true if this TeamUpdateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamUpdateRequest teamUpdateRequest = (TeamUpdateRequest) o; + return Objects.equals(this.data, teamUpdateRequest.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamUpdateRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TeamsResponse.java b/src/main/java/com/datadog/api/client/v2/model/TeamsResponse.java new file mode 100644 index 00000000000..580ddd591aa --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamsResponse.java @@ -0,0 +1,133 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** Response with multiple teams */ +@JsonPropertyOrder({TeamsResponse.JSON_PROPERTY_DATA, TeamsResponse.JSON_PROPERTY_INCLUDED}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TeamsResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = null; + + public static final String JSON_PROPERTY_INCLUDED = "included"; + private List included = null; + + public TeamsResponse data(List data) { + this.data = data; + for (Team item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public TeamsResponse addDataItem(Team dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * Teams response data + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + public TeamsResponse included(List included) { + this.included = included; + for (TeamIncluded item : included) { + this.unparsed |= item.unparsed; + } + return this; + } + + public TeamsResponse addIncludedItem(TeamIncluded includedItem) { + if (this.included == null) { + this.included = new ArrayList<>(); + } + this.included.add(includedItem); + this.unparsed |= includedItem.unparsed; + return this; + } + + /** + * Resources related to the team + * + * @return included + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INCLUDED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getIncluded() { + return included; + } + + public void setIncluded(List included) { + this.included = included; + } + + /** Return true if this TeamsResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamsResponse teamsResponse = (TeamsResponse) o; + return Objects.equals(this.data, teamsResponse.data) + && Objects.equals(this.included, teamsResponse.included); + } + + @Override + public int hashCode() { + return Objects.hash(data, included); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamsResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" included: ").append(toIndentedString(included)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/UserTeam.java b/src/main/java/com/datadog/api/client/v2/model/UserTeam.java new file mode 100644 index 00000000000..a9e5804ebd1 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UserTeam.java @@ -0,0 +1,180 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** A user's relationship with a team */ +@JsonPropertyOrder({ + UserTeam.JSON_PROPERTY_ATTRIBUTES, + UserTeam.JSON_PROPERTY_ID, + UserTeam.JSON_PROPERTY_RELATIONSHIPS, + UserTeam.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class UserTeam { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private UserTeamAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_RELATIONSHIPS = "relationships"; + private UserTeamRelationships relationships; + + public static final String JSON_PROPERTY_TYPE = "type"; + private UserTeamType type = UserTeamType.TEAM_MEMBERSHIPS; + + public UserTeam() {} + + @JsonCreator + public UserTeam( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) UserTeamType type) { + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public UserTeam attributes(UserTeamAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Team membership attributes + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UserTeamAttributes getAttributes() { + return attributes; + } + + public void setAttributes(UserTeamAttributes attributes) { + this.attributes = attributes; + } + + public UserTeam id(String id) { + this.id = id; + return this; + } + + /** + * The ID of a user's relationship with a team + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public UserTeam relationships(UserTeamRelationships relationships) { + this.relationships = relationships; + this.unparsed |= relationships.unparsed; + return this; + } + + /** + * Relationship between membership and a user + * + * @return relationships + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RELATIONSHIPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UserTeamRelationships getRelationships() { + return relationships; + } + + public void setRelationships(UserTeamRelationships relationships) { + this.relationships = relationships; + } + + public UserTeam type(UserTeamType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Team membership type + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UserTeamType getType() { + return type; + } + + public void setType(UserTeamType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** Return true if this UserTeam object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserTeam userTeam = (UserTeam) o; + return Objects.equals(this.attributes, userTeam.attributes) + && Objects.equals(this.id, userTeam.id) + && Objects.equals(this.relationships, userTeam.relationships) + && Objects.equals(this.type, userTeam.type); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, relationships, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserTeam {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" relationships: ").append(toIndentedString(relationships)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/UserTeamAttributes.java b/src/main/java/com/datadog/api/client/v2/model/UserTeamAttributes.java new file mode 100644 index 00000000000..ab8217e5667 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UserTeamAttributes.java @@ -0,0 +1,95 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; +import org.openapitools.jackson.nullable.JsonNullable; + +/** Team membership attributes */ +@JsonPropertyOrder({UserTeamAttributes.JSON_PROPERTY_ROLE}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class UserTeamAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ROLE = "role"; + private JsonNullable role = JsonNullable.undefined(); + + public UserTeamAttributes role(UserTeamRole role) { + this.role = JsonNullable.of(role); + return this; + } + + /** + * The user's role within the team + * + * @return role + */ + @jakarta.annotation.Nullable + @JsonIgnore + public UserTeamRole getRole() { + return role.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_ROLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getRole_JsonNullable() { + return role; + } + + @JsonProperty(JSON_PROPERTY_ROLE) + public void setRole_JsonNullable(JsonNullable role) { + this.role = role; + } + + public void setRole(UserTeamRole role) { + if (!role.isValid()) { + this.unparsed = true; + } + this.role = JsonNullable.of(role); + } + + /** Return true if this UserTeamAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserTeamAttributes userTeamAttributes = (UserTeamAttributes) o; + return Objects.equals(this.role, userTeamAttributes.role); + } + + @Override + public int hashCode() { + return Objects.hash(role); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserTeamAttributes {\n"); + sb.append(" role: ").append(toIndentedString(role)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/UserTeamCreate.java b/src/main/java/com/datadog/api/client/v2/model/UserTeamCreate.java new file mode 100644 index 00000000000..514f98e09d3 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UserTeamCreate.java @@ -0,0 +1,152 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** A user's relationship with a team */ +@JsonPropertyOrder({ + UserTeamCreate.JSON_PROPERTY_ATTRIBUTES, + UserTeamCreate.JSON_PROPERTY_RELATIONSHIPS, + UserTeamCreate.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class UserTeamCreate { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private UserTeamAttributes attributes; + + public static final String JSON_PROPERTY_RELATIONSHIPS = "relationships"; + private UserTeamRelationships relationships; + + public static final String JSON_PROPERTY_TYPE = "type"; + private UserTeamType type = UserTeamType.TEAM_MEMBERSHIPS; + + public UserTeamCreate() {} + + @JsonCreator + public UserTeamCreate( + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) UserTeamType type) { + this.type = type; + this.unparsed |= !type.isValid(); + } + + public UserTeamCreate attributes(UserTeamAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Team membership attributes + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UserTeamAttributes getAttributes() { + return attributes; + } + + public void setAttributes(UserTeamAttributes attributes) { + this.attributes = attributes; + } + + public UserTeamCreate relationships(UserTeamRelationships relationships) { + this.relationships = relationships; + this.unparsed |= relationships.unparsed; + return this; + } + + /** + * Relationship between membership and a user + * + * @return relationships + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RELATIONSHIPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UserTeamRelationships getRelationships() { + return relationships; + } + + public void setRelationships(UserTeamRelationships relationships) { + this.relationships = relationships; + } + + public UserTeamCreate type(UserTeamType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Team membership type + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UserTeamType getType() { + return type; + } + + public void setType(UserTeamType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** Return true if this UserTeamCreate object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserTeamCreate userTeamCreate = (UserTeamCreate) o; + return Objects.equals(this.attributes, userTeamCreate.attributes) + && Objects.equals(this.relationships, userTeamCreate.relationships) + && Objects.equals(this.type, userTeamCreate.type); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, relationships, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserTeamCreate {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" relationships: ").append(toIndentedString(relationships)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/UserTeamPermission.java b/src/main/java/com/datadog/api/client/v2/model/UserTeamPermission.java new file mode 100644 index 00000000000..c8036fbadce --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UserTeamPermission.java @@ -0,0 +1,152 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** A user's permissions for a given team */ +@JsonPropertyOrder({ + UserTeamPermission.JSON_PROPERTY_ATTRIBUTES, + UserTeamPermission.JSON_PROPERTY_ID, + UserTeamPermission.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class UserTeamPermission { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private UserTeamPermissionAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private UserTeamPermissionType type = UserTeamPermissionType.USER_TEAM_PERMISSIONS; + + public UserTeamPermission() {} + + @JsonCreator + public UserTeamPermission( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) UserTeamPermissionType type) { + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public UserTeamPermission attributes(UserTeamPermissionAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * User team permission attributes + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UserTeamPermissionAttributes getAttributes() { + return attributes; + } + + public void setAttributes(UserTeamPermissionAttributes attributes) { + this.attributes = attributes; + } + + public UserTeamPermission id(String id) { + this.id = id; + return this; + } + + /** + * The user team permission's identifier + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public UserTeamPermission type(UserTeamPermissionType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * User team permission type + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UserTeamPermissionType getType() { + return type; + } + + public void setType(UserTeamPermissionType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** Return true if this UserTeamPermission object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserTeamPermission userTeamPermission = (UserTeamPermission) o; + return Objects.equals(this.attributes, userTeamPermission.attributes) + && Objects.equals(this.id, userTeamPermission.id) + && Objects.equals(this.type, userTeamPermission.type); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserTeamPermission {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/UserTeamPermissionAttributes.java b/src/main/java/com/datadog/api/client/v2/model/UserTeamPermissionAttributes.java new file mode 100644 index 00000000000..02e111f2197 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UserTeamPermissionAttributes.java @@ -0,0 +1,73 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** User team permission attributes */ +@JsonPropertyOrder({UserTeamPermissionAttributes.JSON_PROPERTY_PERMISSIONS}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class UserTeamPermissionAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_PERMISSIONS = "permissions"; + private Object permissions; + + /** + * Object of team permission actions and boolean values indicating of the currently logged in user + * can perform them on this team + * + * @return permissions + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PERMISSIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getPermissions() { + return permissions; + } + + /** Return true if this UserTeamPermissionAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserTeamPermissionAttributes userTeamPermissionAttributes = (UserTeamPermissionAttributes) o; + return Objects.equals(this.permissions, userTeamPermissionAttributes.permissions); + } + + @Override + public int hashCode() { + return Objects.hash(permissions); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserTeamPermissionAttributes {\n"); + sb.append(" permissions: ").append(toIndentedString(permissions)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/UserTeamPermissionType.java b/src/main/java/com/datadog/api/client/v2/model/UserTeamPermissionType.java new file mode 100644 index 00000000000..dc6ef7bbe3d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UserTeamPermissionType.java @@ -0,0 +1,95 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Objects; +import java.util.Set; + +/** User team permission type */ +@JsonSerialize(using = UserTeamPermissionType.UserTeamPermissionTypeSerializer.class) +public class UserTeamPermissionType { + + public static final UserTeamPermissionType USER_TEAM_PERMISSIONS = + new UserTeamPermissionType("user_team_permissions"); + + private static final Set allowedValues = + new HashSet(Arrays.asList("user_team_permissions")); + + private String value; + + public boolean isValid() { + return allowedValues.contains(this.value); + } + + UserTeamPermissionType(String value) { + this.value = value; + } + + public static class UserTeamPermissionTypeSerializer + extends StdSerializer { + public UserTeamPermissionTypeSerializer(Class t) { + super(t); + } + + public UserTeamPermissionTypeSerializer() { + this(null); + } + + @Override + public void serialize( + UserTeamPermissionType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonValue + public String getValue() { + return this.value; + } + + public void setValue(String value) { + this.value = value; + } + + /** Return true if this UserTeamPermissionType object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return this.value.equals(((UserTeamPermissionType) o).value); + } + + @Override + public int hashCode() { + return Objects.hash(value); + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static UserTeamPermissionType fromValue(String value) { + return new UserTeamPermissionType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/UserTeamRelationships.java b/src/main/java/com/datadog/api/client/v2/model/UserTeamRelationships.java new file mode 100644 index 00000000000..e310f4352ea --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UserTeamRelationships.java @@ -0,0 +1,82 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** Relationship between membership and a user */ +@JsonPropertyOrder({UserTeamRelationships.JSON_PROPERTY_USER}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class UserTeamRelationships { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_USER = "user"; + private RelationshipToUserTeamUser user; + + public UserTeamRelationships user(RelationshipToUserTeamUser user) { + this.user = user; + this.unparsed |= user.unparsed; + return this; + } + + /** + * Relationship between team membership and user + * + * @return user + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public RelationshipToUserTeamUser getUser() { + return user; + } + + public void setUser(RelationshipToUserTeamUser user) { + this.user = user; + } + + /** Return true if this UserTeamRelationships object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserTeamRelationships userTeamRelationships = (UserTeamRelationships) o; + return Objects.equals(this.user, userTeamRelationships.user); + } + + @Override + public int hashCode() { + return Objects.hash(user); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserTeamRelationships {\n"); + sb.append(" user: ").append(toIndentedString(user)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/UserTeamRequest.java b/src/main/java/com/datadog/api/client/v2/model/UserTeamRequest.java new file mode 100644 index 00000000000..b3654beb8c0 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UserTeamRequest.java @@ -0,0 +1,91 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** Team membership request */ +@JsonPropertyOrder({UserTeamRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class UserTeamRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private UserTeamCreate data; + + public UserTeamRequest() {} + + @JsonCreator + public UserTeamRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) UserTeamCreate data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public UserTeamRequest data(UserTeamCreate data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * A user's relationship with a team + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UserTeamCreate getData() { + return data; + } + + public void setData(UserTeamCreate data) { + this.data = data; + } + + /** Return true if this UserTeamRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserTeamRequest userTeamRequest = (UserTeamRequest) o; + return Objects.equals(this.data, userTeamRequest.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserTeamRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/UserTeamResponse.java b/src/main/java/com/datadog/api/client/v2/model/UserTeamResponse.java new file mode 100644 index 00000000000..97672d638db --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UserTeamResponse.java @@ -0,0 +1,82 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** Team membership response */ +@JsonPropertyOrder({UserTeamResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class UserTeamResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private UserTeam data; + + public UserTeamResponse data(UserTeam data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * A user's relationship with a team + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UserTeam getData() { + return data; + } + + public void setData(UserTeam data) { + this.data = data; + } + + /** Return true if this UserTeamResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserTeamResponse userTeamResponse = (UserTeamResponse) o; + return Objects.equals(this.data, userTeamResponse.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserTeamResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/UserTeamRole.java b/src/main/java/com/datadog/api/client/v2/model/UserTeamRole.java new file mode 100644 index 00000000000..7698b5fc701 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UserTeamRole.java @@ -0,0 +1,91 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Objects; +import java.util.Set; + +/** The user's role within the team */ +@JsonSerialize(using = UserTeamRole.UserTeamRoleSerializer.class) +public class UserTeamRole { + + public static final UserTeamRole ADMIN = new UserTeamRole("admin"); + + private static final Set allowedValues = new HashSet(Arrays.asList("admin")); + + private String value; + + public boolean isValid() { + return allowedValues.contains(this.value); + } + + UserTeamRole(String value) { + this.value = value; + } + + public static class UserTeamRoleSerializer extends StdSerializer { + public UserTeamRoleSerializer(Class t) { + super(t); + } + + public UserTeamRoleSerializer() { + this(null); + } + + @Override + public void serialize(UserTeamRole value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonValue + public String getValue() { + return this.value; + } + + public void setValue(String value) { + this.value = value; + } + + /** Return true if this UserTeamRole object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return this.value.equals(((UserTeamRole) o).value); + } + + @Override + public int hashCode() { + return Objects.hash(value); + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static UserTeamRole fromValue(String value) { + return new UserTeamRole(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/UserTeamType.java b/src/main/java/com/datadog/api/client/v2/model/UserTeamType.java new file mode 100644 index 00000000000..bb246a342c6 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UserTeamType.java @@ -0,0 +1,92 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Objects; +import java.util.Set; + +/** Team membership type */ +@JsonSerialize(using = UserTeamType.UserTeamTypeSerializer.class) +public class UserTeamType { + + public static final UserTeamType TEAM_MEMBERSHIPS = new UserTeamType("team_memberships"); + + private static final Set allowedValues = + new HashSet(Arrays.asList("team_memberships")); + + private String value; + + public boolean isValid() { + return allowedValues.contains(this.value); + } + + UserTeamType(String value) { + this.value = value; + } + + public static class UserTeamTypeSerializer extends StdSerializer { + public UserTeamTypeSerializer(Class t) { + super(t); + } + + public UserTeamTypeSerializer() { + this(null); + } + + @Override + public void serialize(UserTeamType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonValue + public String getValue() { + return this.value; + } + + public void setValue(String value) { + this.value = value; + } + + /** Return true if this UserTeamType object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return this.value.equals(((UserTeamType) o).value); + } + + @Override + public int hashCode() { + return Objects.hash(value); + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static UserTeamType fromValue(String value) { + return new UserTeamType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/UserTeamUpdate.java b/src/main/java/com/datadog/api/client/v2/model/UserTeamUpdate.java new file mode 100644 index 00000000000..bb11dbb8382 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UserTeamUpdate.java @@ -0,0 +1,121 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** A user's relationship with a team */ +@JsonPropertyOrder({UserTeamUpdate.JSON_PROPERTY_ATTRIBUTES, UserTeamUpdate.JSON_PROPERTY_TYPE}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class UserTeamUpdate { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private UserTeamAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private UserTeamType type = UserTeamType.TEAM_MEMBERSHIPS; + + public UserTeamUpdate() {} + + @JsonCreator + public UserTeamUpdate( + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) UserTeamType type) { + this.type = type; + this.unparsed |= !type.isValid(); + } + + public UserTeamUpdate attributes(UserTeamAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Team membership attributes + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UserTeamAttributes getAttributes() { + return attributes; + } + + public void setAttributes(UserTeamAttributes attributes) { + this.attributes = attributes; + } + + public UserTeamUpdate type(UserTeamType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Team membership type + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UserTeamType getType() { + return type; + } + + public void setType(UserTeamType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** Return true if this UserTeamUpdate object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserTeamUpdate userTeamUpdate = (UserTeamUpdate) o; + return Objects.equals(this.attributes, userTeamUpdate.attributes) + && Objects.equals(this.type, userTeamUpdate.type); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserTeamUpdate {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/UserTeamUpdateRequest.java b/src/main/java/com/datadog/api/client/v2/model/UserTeamUpdateRequest.java new file mode 100644 index 00000000000..023ac7489ec --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UserTeamUpdateRequest.java @@ -0,0 +1,91 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** Team membership request */ +@JsonPropertyOrder({UserTeamUpdateRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class UserTeamUpdateRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private UserTeamUpdate data; + + public UserTeamUpdateRequest() {} + + @JsonCreator + public UserTeamUpdateRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) UserTeamUpdate data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public UserTeamUpdateRequest data(UserTeamUpdate data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * A user's relationship with a team + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UserTeamUpdate getData() { + return data; + } + + public void setData(UserTeamUpdate data) { + this.data = data; + } + + /** Return true if this UserTeamUpdateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserTeamUpdateRequest userTeamUpdateRequest = (UserTeamUpdateRequest) o; + return Objects.equals(this.data, userTeamUpdateRequest.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserTeamUpdateRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/UserTeamUserType.java b/src/main/java/com/datadog/api/client/v2/model/UserTeamUserType.java new file mode 100644 index 00000000000..c5ccef9f3e3 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UserTeamUserType.java @@ -0,0 +1,91 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Objects; +import java.util.Set; + +/** User team user type */ +@JsonSerialize(using = UserTeamUserType.UserTeamUserTypeSerializer.class) +public class UserTeamUserType { + + public static final UserTeamUserType USERS = new UserTeamUserType("users"); + + private static final Set allowedValues = new HashSet(Arrays.asList("users")); + + private String value; + + public boolean isValid() { + return allowedValues.contains(this.value); + } + + UserTeamUserType(String value) { + this.value = value; + } + + public static class UserTeamUserTypeSerializer extends StdSerializer { + public UserTeamUserTypeSerializer(Class t) { + super(t); + } + + public UserTeamUserTypeSerializer() { + this(null); + } + + @Override + public void serialize(UserTeamUserType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonValue + public String getValue() { + return this.value; + } + + public void setValue(String value) { + this.value = value; + } + + /** Return true if this UserTeamUserType object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return this.value.equals(((UserTeamUserType) o).value); + } + + @Override + public int hashCode() { + return Objects.hash(value); + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static UserTeamUserType fromValue(String value) { + return new UserTeamUserType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/UserTeamsResponse.java b/src/main/java/com/datadog/api/client/v2/model/UserTeamsResponse.java new file mode 100644 index 00000000000..56eca37e091 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UserTeamsResponse.java @@ -0,0 +1,95 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** Team memberships response */ +@JsonPropertyOrder({UserTeamsResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class UserTeamsResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = null; + + public UserTeamsResponse data(List data) { + this.data = data; + for (UserTeam item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public UserTeamsResponse addDataItem(UserTeam dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * Team memberships response data + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + /** Return true if this UserTeamsResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserTeamsResponse userTeamsResponse = (UserTeamsResponse) o; + return Objects.equals(this.data, userTeamsResponse.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserTeamsResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/test/resources/cassettes/features/v2/Create_a_team_link_returns_API_error_response_response.freeze b/src/test/resources/cassettes/features/v2/Create_a_team_link_returns_API_error_response_response.freeze new file mode 100644 index 00000000000..492a4a99f37 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_a_team_link_returns_API_error_response_response.freeze @@ -0,0 +1 @@ +2023-03-27T18:32:58.153Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_a_team_link_returns_API_error_response_response.json b/src/test/resources/cassettes/features/v2/Create_a_team_link_returns_API_error_response_response.json new file mode 100644 index 00000000000..c009a1f9271 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_a_team_link_returns_API_error_response_response.json @@ -0,0 +1,83 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"handle\":\"1679941978\",\"name\":\"1679941978\"},\"type\":\"team\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/team", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"type\":\"team\",\"id\":\"cc3d71dc-cccd-11ed-ac3a-da7ad0900002\",\"attributes\":{\"name\":\"1679941978\",\"handle\":\"1679941978\",\"summary\":null,\"description\":null,\"color\":10,\"created_at\":\"2023-03-27T18:32:58.528371+00:00\",\"modified_at\":\"2023-03-27T18:32:58.528375+00:00\",\"user_count\":0,\"link_count\":0},\"relationships\":{\"team_links\":{\"links\":{\"related\":\"/api/v2/team/cc3d71dc-cccd-11ed-ac3a-da7ad0900002/links\"}},\"user_team_permissions\":{\"links\":{\"related\":\"/api/v2/team/cc3d71dc-cccd-11ed-ac3a-da7ad0900002/permission-settings\"}}}}}\n", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "c4fea764-3393-21aa-76b7-a7786bf1a7db" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"label\":\"\",\"position\":0,\"url\":\"https://example.com\"},\"type\":\"team_links\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/team/cc3d71dc-cccd-11ed-ac3a-da7ad0900002/links", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[\"label cannot be empty\"]}", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 422, + "reasonPhrase": "Unprocessable Entity" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "90f4ba2a-4e04-c7d7-5e52-3976a0b7b361" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/team/cc3d71dc-cccd-11ed-ac3a-da7ad0900002", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "31b51d9f-eaf5-614b-0722-d5b7e2e96a57" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_a_team_link_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Create_a_team_link_returns_OK_response.freeze new file mode 100644 index 00000000000..c06dd1805cf --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_a_team_link_returns_OK_response.freeze @@ -0,0 +1 @@ +2023-03-27T18:32:59.347Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_a_team_link_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Create_a_team_link_returns_OK_response.json new file mode 100644 index 00000000000..72ef71044ef --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_a_team_link_returns_OK_response.json @@ -0,0 +1,104 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"handle\":\"1679941979\",\"name\":\"1679941979\"},\"type\":\"team\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/team", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"type\":\"team\",\"id\":\"cceda3d6-cccd-11ed-aae5-da7ad0900002\",\"attributes\":{\"name\":\"1679941979\",\"handle\":\"1679941979\",\"summary\":null,\"description\":null,\"color\":0,\"created_at\":\"2023-03-27T18:32:59.683291+00:00\",\"modified_at\":\"2023-03-27T18:32:59.683295+00:00\",\"user_count\":0,\"link_count\":0},\"relationships\":{\"team_links\":{\"links\":{\"related\":\"/api/v2/team/cceda3d6-cccd-11ed-aae5-da7ad0900002/links\"}},\"user_team_permissions\":{\"links\":{\"related\":\"/api/v2/team/cceda3d6-cccd-11ed-aae5-da7ad0900002/permission-settings\"}}}}}\n", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "bac88302-52b6-297b-e40f-a92ac223c9f1" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"label\":\"Link label\",\"position\":0,\"url\":\"https://example.com\"},\"type\":\"team_links\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/team/cceda3d6-cccd-11ed-aae5-da7ad0900002/links", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"type\":\"team_links\",\"id\":\"cd25c6bc-cccd-11ed-830b-da7ad0900002\",\"attributes\":{\"team_id\":\"cceda3d6-cccd-11ed-aae5-da7ad0900002\",\"label\":\"Link label\",\"url\":\"https://example.com\",\"position\":0}}}\n", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "8ca86d71-31e3-819d-fffa-a61a11a104a3" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/team/cceda3d6-cccd-11ed-aae5-da7ad0900002/links/cd25c6bc-cccd-11ed-830b-da7ad0900002", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "df706bbc-7770-a42b-d4d8-a99552129850" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/team/cceda3d6-cccd-11ed-aae5-da7ad0900002", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "be28b64e-b7c6-6423-b207-3053768ec738" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_a_team_returns_API_error_response_response.freeze b/src/test/resources/cassettes/features/v2/Create_a_team_returns_API_error_response_response.freeze new file mode 100644 index 00000000000..f73c9561642 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_a_team_returns_API_error_response_response.freeze @@ -0,0 +1 @@ +2023-03-27T18:33:01.052Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_a_team_returns_API_error_response_response.json b/src/test/resources/cassettes/features/v2/Create_a_team_returns_API_error_response_response.json new file mode 100644 index 00000000000..3f6be1b3f7b --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_a_team_returns_API_error_response_response.json @@ -0,0 +1,83 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"handle\":\"1679941981\",\"name\":\"1679941981\"},\"type\":\"team\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/team", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"type\":\"team\",\"id\":\"cddc7ff6-cccd-11ed-9329-da7ad0900002\",\"attributes\":{\"name\":\"1679941981\",\"handle\":\"1679941981\",\"summary\":null,\"description\":null,\"color\":11,\"created_at\":\"2023-03-27T18:33:01.249180+00:00\",\"modified_at\":\"2023-03-27T18:33:01.249185+00:00\",\"user_count\":0,\"link_count\":0},\"relationships\":{\"team_links\":{\"links\":{\"related\":\"/api/v2/team/cddc7ff6-cccd-11ed-9329-da7ad0900002/links\"}},\"user_team_permissions\":{\"links\":{\"related\":\"/api/v2/team/cddc7ff6-cccd-11ed-9329-da7ad0900002/permission-settings\"}}}}}\n", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "52639f5d-062d-eb81-2bbb-efb6b98d2b82" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"handle\":\"1679941981\",\"name\":\"Example Team\"},\"relationships\":{\"users\":{\"data\":[]}},\"type\":\"team\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/team", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[\"Team name and handle must be unique\"]}", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 409, + "reasonPhrase": "Conflict" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "57616193-b5c4-2817-6297-89d470bba3cc" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/team/cddc7ff6-cccd-11ed-9329-da7ad0900002", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "aad14632-6308-a1b2-cf5f-ea71a9bbede2" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_a_team_returns_CREATED_response.freeze b/src/test/resources/cassettes/features/v2/Create_a_team_returns_CREATED_response.freeze new file mode 100644 index 00000000000..7f42af9f7b1 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_a_team_returns_CREATED_response.freeze @@ -0,0 +1 @@ +2023-03-27T18:33:02.181Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_a_team_returns_CREATED_response.json b/src/test/resources/cassettes/features/v2/Create_a_team_returns_CREATED_response.json new file mode 100644 index 00000000000..58ab28c3702 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_a_team_returns_CREATED_response.json @@ -0,0 +1,53 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"handle\":\"1679941982\",\"name\":\"1679941982\"},\"relationships\":{\"users\":{\"data\":[]}},\"type\":\"team\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/team", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"type\":\"team\",\"id\":\"cebec38e-cccd-11ed-a1a8-da7ad0900002\",\"attributes\":{\"name\":\"1679941982\",\"handle\":\"1679941982\",\"summary\":null,\"description\":null,\"color\":10,\"created_at\":\"2023-03-27T18:33:02.731559+00:00\",\"modified_at\":\"2023-03-27T18:33:02.731566+00:00\",\"user_count\":0,\"link_count\":0},\"relationships\":{\"team_links\":{\"links\":{\"related\":\"/api/v2/team/cebec38e-cccd-11ed-a1a8-da7ad0900002/links\"}},\"user_team_permissions\":{\"links\":{\"related\":\"/api/v2/team/cebec38e-cccd-11ed-a1a8-da7ad0900002/permission-settings\"}}}}}\n", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "b9a8ca94-f5aa-05fd-8f24-0892fda135e7" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/team/cebec38e-cccd-11ed-a1a8-da7ad0900002", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "55aafb2a-f6f8-0207-c468-e6264ecf3a40" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_a_team_link_returns_API_error_response_response.freeze b/src/test/resources/cassettes/features/v2/Get_a_team_link_returns_API_error_response_response.freeze new file mode 100644 index 00000000000..213a8cfe5e5 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_a_team_link_returns_API_error_response_response.freeze @@ -0,0 +1 @@ +2023-03-27T18:33:03.716Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_a_team_link_returns_API_error_response_response.json b/src/test/resources/cassettes/features/v2/Get_a_team_link_returns_API_error_response_response.json new file mode 100644 index 00000000000..c7dc30f7bb0 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_a_team_link_returns_API_error_response_response.json @@ -0,0 +1,79 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"handle\":\"1679941983\",\"name\":\"1679941983\"},\"type\":\"team\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/team", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"type\":\"team\",\"id\":\"cf7d13e8-cccd-11ed-ae79-da7ad0900002\",\"attributes\":{\"name\":\"1679941983\",\"handle\":\"1679941983\",\"summary\":null,\"description\":null,\"color\":8,\"created_at\":\"2023-03-27T18:33:03.978804+00:00\",\"modified_at\":\"2023-03-27T18:33:03.978808+00:00\",\"user_count\":0,\"link_count\":0},\"relationships\":{\"team_links\":{\"links\":{\"related\":\"/api/v2/team/cf7d13e8-cccd-11ed-ae79-da7ad0900002/links\"}},\"user_team_permissions\":{\"links\":{\"related\":\"/api/v2/team/cf7d13e8-cccd-11ed-ae79-da7ad0900002/permission-settings\"}}}}}\n", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "e7412e38-62ba-e084-cdbf-7ca14b583485" + }, + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/team/cf7d13e8-cccd-11ed-ae79-da7ad0900002/links/REPLACE.ME", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[\"REPLACE.ME is not a valid UUID not found\"]}", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "ebafc8d3-37d0-8e07-5179-704c8638fa17" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/team/cf7d13e8-cccd-11ed-ae79-da7ad0900002", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "ff548275-fc5d-6d45-e036-ee1498d623ea" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_a_team_link_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Get_a_team_link_returns_OK_response.freeze new file mode 100644 index 00000000000..dfc126200d9 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_a_team_link_returns_OK_response.freeze @@ -0,0 +1 @@ +2023-03-27T18:33:04.939Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_a_team_link_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Get_a_team_link_returns_OK_response.json new file mode 100644 index 00000000000..88b234f71e8 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_a_team_link_returns_OK_response.json @@ -0,0 +1,130 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"handle\":\"1679941984\",\"name\":\"1679941984\"},\"type\":\"team\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/team", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"type\":\"team\",\"id\":\"d04115ae-cccd-11ed-9e78-da7ad0900002\",\"attributes\":{\"name\":\"1679941984\",\"handle\":\"1679941984\",\"summary\":null,\"description\":null,\"color\":4,\"created_at\":\"2023-03-27T18:33:05.263569+00:00\",\"modified_at\":\"2023-03-27T18:33:05.263573+00:00\",\"user_count\":0,\"link_count\":0},\"relationships\":{\"team_links\":{\"links\":{\"related\":\"/api/v2/team/d04115ae-cccd-11ed-9e78-da7ad0900002/links\"}},\"user_team_permissions\":{\"links\":{\"related\":\"/api/v2/team/d04115ae-cccd-11ed-9e78-da7ad0900002/permission-settings\"}}}}}\n", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "7a12c4a1-4600-ee3a-f68a-dcfe0ec79c9f" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"label\":\"Test-Get_a_team_link_returns_OK_response-1679941984\",\"position\":0,\"url\":\"https://example.com\"},\"type\":\"team_links\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/team/d04115ae-cccd-11ed-9e78-da7ad0900002/links", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"type\":\"team_links\",\"id\":\"d085fc8c-cccd-11ed-8dbe-da7ad0900002\",\"attributes\":{\"team_id\":\"d04115ae-cccd-11ed-9e78-da7ad0900002\",\"label\":\"Test-Get_a_team_link_returns_OK_response-1679941984\",\"url\":\"https://example.com\",\"position\":0}}}\n", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "27281909-b53b-15c7-97d9-94c41ed3fc33" + }, + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/team/d04115ae-cccd-11ed-9e78-da7ad0900002/links/d085fc8c-cccd-11ed-8dbe-da7ad0900002", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"type\":\"team_links\",\"id\":\"d085fc8c-cccd-11ed-8dbe-da7ad0900002\",\"attributes\":{\"team_id\":\"d04115ae-cccd-11ed-9e78-da7ad0900002\",\"label\":\"Test-Get_a_team_link_returns_OK_response-1679941984\",\"url\":\"https://example.com\",\"position\":0}}}\n", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "faff3de6-07fb-c80d-08f6-d37f48fa2d81" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/team/d04115ae-cccd-11ed-9e78-da7ad0900002/links/d085fc8c-cccd-11ed-8dbe-da7ad0900002", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "6a5c5dfc-ba53-3338-94ec-8796b88bfa6e" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/team/d04115ae-cccd-11ed-9e78-da7ad0900002", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "ca87de3c-590a-8cff-3389-8a70e7259b3d" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_a_team_returns_API_error_response_response.freeze b/src/test/resources/cassettes/features/v2/Get_a_team_returns_API_error_response_response.freeze new file mode 100644 index 00000000000..25b9e21fda2 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_a_team_returns_API_error_response_response.freeze @@ -0,0 +1 @@ +2023-03-27T18:33:06.924Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_a_team_returns_API_error_response_response.json b/src/test/resources/cassettes/features/v2/Get_a_team_returns_API_error_response_response.json new file mode 100644 index 00000000000..be1e5e5e1b5 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_a_team_returns_API_error_response_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/team/REPLACE.ME", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[\"REPLACE.ME is not a valid UUID not found\"]}", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "20b968c1-68a2-30f8-d751-3e787fd2c219" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_a_team_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Get_a_team_returns_OK_response.freeze new file mode 100644 index 00000000000..66e0676f70f --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_a_team_returns_OK_response.freeze @@ -0,0 +1 @@ +2023-03-27T18:33:07.404Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_a_team_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Get_a_team_returns_OK_response.json new file mode 100644 index 00000000000..943fc2c541d --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_a_team_returns_OK_response.json @@ -0,0 +1,79 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"handle\":\"1679941987\",\"name\":\"1679941987\"},\"type\":\"team\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/team", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"type\":\"team\",\"id\":\"d1a59ae6-cccd-11ed-9cff-da7ad0900002\",\"attributes\":{\"name\":\"1679941987\",\"handle\":\"1679941987\",\"summary\":null,\"description\":null,\"color\":11,\"created_at\":\"2023-03-27T18:33:07.600350+00:00\",\"modified_at\":\"2023-03-27T18:33:07.600354+00:00\",\"user_count\":0,\"link_count\":0},\"relationships\":{\"team_links\":{\"links\":{\"related\":\"/api/v2/team/d1a59ae6-cccd-11ed-9cff-da7ad0900002/links\"}},\"user_team_permissions\":{\"links\":{\"related\":\"/api/v2/team/d1a59ae6-cccd-11ed-9cff-da7ad0900002/permission-settings\"}}}}}\n", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "9454f226-1b91-7c00-7ec2-ad092fd2d373" + }, + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/team/d1a59ae6-cccd-11ed-9cff-da7ad0900002", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"type\":\"team\",\"id\":\"d1a59ae6-cccd-11ed-9cff-da7ad0900002\",\"attributes\":{\"name\":\"1679941987\",\"handle\":\"1679941987\",\"summary\":null,\"description\":null,\"color\":11,\"created_at\":\"2023-03-27T18:33:07.600350+00:00\",\"modified_at\":\"2023-03-27T18:33:07.600354+00:00\",\"user_count\":0,\"link_count\":0},\"relationships\":{\"team_links\":{\"links\":{\"related\":\"/api/v2/team/d1a59ae6-cccd-11ed-9cff-da7ad0900002/links\"}},\"user_team_permissions\":{\"links\":{\"related\":\"/api/v2/team/d1a59ae6-cccd-11ed-9cff-da7ad0900002/permission-settings\"}}}}}\n", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "92d4057e-4404-dd79-387f-2690942ee2b3" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/team/d1a59ae6-cccd-11ed-9cff-da7ad0900002", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "86f84240-7312-3a69-1c95-8546a38af7b9" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_all_teams_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Get_all_teams_returns_OK_response.freeze new file mode 100644 index 00000000000..afe7c517c96 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_all_teams_returns_OK_response.freeze @@ -0,0 +1 @@ +2023-03-27T18:33:08.426Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_all_teams_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Get_all_teams_returns_OK_response.json new file mode 100644 index 00000000000..3773ee5fef8 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_all_teams_returns_OK_response.json @@ -0,0 +1,79 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"handle\":\"1679941988\",\"name\":\"1679941988\"},\"type\":\"team\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/team", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"type\":\"team\",\"id\":\"d246a436-cccd-11ed-bf44-da7ad0900002\",\"attributes\":{\"name\":\"1679941988\",\"handle\":\"1679941988\",\"summary\":null,\"description\":null,\"color\":6,\"created_at\":\"2023-03-27T18:33:08.655656+00:00\",\"modified_at\":\"2023-03-27T18:33:08.655661+00:00\",\"user_count\":0,\"link_count\":0},\"relationships\":{\"team_links\":{\"links\":{\"related\":\"/api/v2/team/d246a436-cccd-11ed-bf44-da7ad0900002/links\"}},\"user_team_permissions\":{\"links\":{\"related\":\"/api/v2/team/d246a436-cccd-11ed-bf44-da7ad0900002/permission-settings\"}}}}}\n", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "d6dcacac-022c-2058-796e-5456b2125558" + }, + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/team", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":[{\"type\":\"team\",\"id\":\"d246a436-cccd-11ed-bf44-da7ad0900002\",\"attributes\":{\"name\":\"1679941988\",\"handle\":\"1679941988\",\"summary\":null,\"description\":null,\"color\":6,\"created_at\":\"2023-03-27T18:33:08.655656+00:00\",\"modified_at\":\"2023-03-27T18:33:08.655661+00:00\",\"user_count\":0,\"link_count\":0},\"relationships\":{\"team_links\":{\"links\":{\"related\":\"/api/v2/team/d246a436-cccd-11ed-bf44-da7ad0900002/links\"}},\"user_team_permissions\":{\"links\":{\"related\":\"/api/v2/team/d246a436-cccd-11ed-bf44-da7ad0900002/permission-settings\"}}}},{\"type\":\"team\",\"id\":\"ac73040e-c8d4-11ed-b2ea-da7ad0900002\",\"attributes\":{\"name\":\"Example Team\",\"handle\":\"api-spec-test-team\",\"summary\":null,\"description\":null,\"color\":12,\"created_at\":\"2023-03-22T17:12:07.018313+00:00\",\"modified_at\":\"2023-03-22T17:12:07.018317+00:00\",\"user_count\":0,\"link_count\":0},\"relationships\":{\"team_links\":{\"links\":{\"related\":\"/api/v2/team/ac73040e-c8d4-11ed-b2ea-da7ad0900002/links\"}},\"user_team_permissions\":{\"links\":{\"related\":\"/api/v2/team/ac73040e-c8d4-11ed-b2ea-da7ad0900002/permission-settings\"}}}}],\"meta\":{\"pagination\":{\"offset\":0,\"first_offset\":0,\"prev_offset\":0,\"next_offset\":100,\"last_offset\":0,\"limit\":100,\"type\":\"offset_limit\",\"total\":2}},\"links\":{\"self\":\"https://api.datadoghq.com/api/v2/team\",\"last\":null,\"next\":\"https://api.datadoghq.com/api/v2/team?page[offset]=100&page[limit]=100\",\"prev\":null,\"first\":\"https://api.datadoghq.com/api/v2/team?page[offset]=0&page[limit]=100\"}}\n", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "83b737f5-ac1d-8aee-4440-0eee32af9de6" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/team/d246a436-cccd-11ed-bf44-da7ad0900002", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "2f993d16-7b62-f0ab-b72c-2502a1f71857" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_links_for_a_team_returns_API_error_response_response.freeze b/src/test/resources/cassettes/features/v2/Get_links_for_a_team_returns_API_error_response_response.freeze new file mode 100644 index 00000000000..7aec5bb382e --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_links_for_a_team_returns_API_error_response_response.freeze @@ -0,0 +1 @@ +2023-03-27T18:33:09.439Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_links_for_a_team_returns_API_error_response_response.json b/src/test/resources/cassettes/features/v2/Get_links_for_a_team_returns_API_error_response_response.json new file mode 100644 index 00000000000..b78154d5d65 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_links_for_a_team_returns_API_error_response_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/team/REPLACE.ME/links", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[\"REPLACE.ME is not a valid UUID not found\"]}", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "6c5eef85-9c87-2a02-550a-e7ecfe340f21" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_links_for_a_team_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Get_links_for_a_team_returns_OK_response.freeze new file mode 100644 index 00000000000..0a00fdfe40f --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_links_for_a_team_returns_OK_response.freeze @@ -0,0 +1 @@ +2023-03-27T18:33:09.793Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_links_for_a_team_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Get_links_for_a_team_returns_OK_response.json new file mode 100644 index 00000000000..5548bd3455c --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_links_for_a_team_returns_OK_response.json @@ -0,0 +1,79 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"handle\":\"1679941989\",\"name\":\"1679941989\"},\"type\":\"team\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/team", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"type\":\"team\",\"id\":\"d3141588-cccd-11ed-93f1-da7ad0900002\",\"attributes\":{\"name\":\"1679941989\",\"handle\":\"1679941989\",\"summary\":null,\"description\":null,\"color\":6,\"created_at\":\"2023-03-27T18:33:10.001530+00:00\",\"modified_at\":\"2023-03-27T18:33:10.001534+00:00\",\"user_count\":0,\"link_count\":0},\"relationships\":{\"team_links\":{\"links\":{\"related\":\"/api/v2/team/d3141588-cccd-11ed-93f1-da7ad0900002/links\"}},\"user_team_permissions\":{\"links\":{\"related\":\"/api/v2/team/d3141588-cccd-11ed-93f1-da7ad0900002/permission-settings\"}}}}}\n", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "b9be0f75-0b9f-5979-8035-d87aef234f41" + }, + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/team/d3141588-cccd-11ed-93f1-da7ad0900002/links", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":[]}\n", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "20dff176-b536-9e4b-c437-27235477a80a" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/team/d3141588-cccd-11ed-93f1-da7ad0900002", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "735b2841-7a55-b8aa-8dbb-97e09106c3d3" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_permission_settings_for_a_team_returns_API_error_response_response.freeze b/src/test/resources/cassettes/features/v2/Get_permission_settings_for_a_team_returns_API_error_response_response.freeze new file mode 100644 index 00000000000..dbb3c2d13ba --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_permission_settings_for_a_team_returns_API_error_response_response.freeze @@ -0,0 +1 @@ +2023-03-27T18:33:10.831Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_permission_settings_for_a_team_returns_API_error_response_response.json b/src/test/resources/cassettes/features/v2/Get_permission_settings_for_a_team_returns_API_error_response_response.json new file mode 100644 index 00000000000..74c0bf90eb6 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_permission_settings_for_a_team_returns_API_error_response_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/team/REPLACE.ME/permission-settings", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[\"REPLACE.ME is not a valid UUID not found\"]}", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "d6d323b5-76f5-89ff-3187-476d58b41135" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_permission_settings_for_a_team_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Get_permission_settings_for_a_team_returns_OK_response.freeze new file mode 100644 index 00000000000..20447632d6f --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_permission_settings_for_a_team_returns_OK_response.freeze @@ -0,0 +1 @@ +2023-03-27T18:33:11.084Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_permission_settings_for_a_team_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Get_permission_settings_for_a_team_returns_OK_response.json new file mode 100644 index 00000000000..04eddc96013 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_permission_settings_for_a_team_returns_OK_response.json @@ -0,0 +1,79 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"handle\":\"1679941991\",\"name\":\"1679941991\"},\"type\":\"team\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/team", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"type\":\"team\",\"id\":\"d3fcfa50-cccd-11ed-ba3b-da7ad0900002\",\"attributes\":{\"name\":\"1679941991\",\"handle\":\"1679941991\",\"summary\":null,\"description\":null,\"color\":11,\"created_at\":\"2023-03-27T18:33:11.528141+00:00\",\"modified_at\":\"2023-03-27T18:33:11.528147+00:00\",\"user_count\":0,\"link_count\":0},\"relationships\":{\"team_links\":{\"links\":{\"related\":\"/api/v2/team/d3fcfa50-cccd-11ed-ba3b-da7ad0900002/links\"}},\"user_team_permissions\":{\"links\":{\"related\":\"/api/v2/team/d3fcfa50-cccd-11ed-ba3b-da7ad0900002/permission-settings\"}}}}}\n", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "100e024d-5fdd-bb53-1094-6274332bbdab" + }, + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/team/d3fcfa50-cccd-11ed-ba3b-da7ad0900002/permission-settings", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":[{\"type\":\"team_permission_settings\",\"attributes\":{\"title\":\"Add and Remove Members\",\"editable\":true,\"value\":\"organization\",\"options\":[\"user_access_manage\",\"admins\",\"members\",\"organization\"],\"action\":\"manage_membership\"},\"id\":\"TeamPermission-d3fcfa50-cccd-11ed-ba3b-da7ad0900002-manage_membership\"},{\"type\":\"team_permission_settings\",\"attributes\":{\"title\":\"Edit Team Details\",\"editable\":true,\"value\":\"members\",\"options\":[\"teams_manage\",\"admins\",\"members\"],\"action\":\"edit\"},\"id\":\"TeamPermission-d3fcfa50-cccd-11ed-ba3b-da7ad0900002-edit\"}]}\n", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "81f39beb-bfbc-3464-9236-e20bcb956759" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/team/d3fcfa50-cccd-11ed-ba3b-da7ad0900002", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "6539a861-68c0-1726-3fb9-5995beadc888" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_team_memberships_returns_API_error_response_response.freeze b/src/test/resources/cassettes/features/v2/Get_team_memberships_returns_API_error_response_response.freeze new file mode 100644 index 00000000000..a0a7a9da1db --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_team_memberships_returns_API_error_response_response.freeze @@ -0,0 +1 @@ +2023-03-27T18:33:12.757Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_team_memberships_returns_API_error_response_response.json b/src/test/resources/cassettes/features/v2/Get_team_memberships_returns_API_error_response_response.json new file mode 100644 index 00000000000..bc3c02f25bf --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_team_memberships_returns_API_error_response_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/team/REPLACE.ME/memberships", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[\"REPLACE.ME is not a valid UUID not found\"]}", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "9784c769-cd89-2117-ef90-ce0409a8f711" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_team_memberships_returns_Represents_a_user_s_association_to_a_team_response.freeze b/src/test/resources/cassettes/features/v2/Get_team_memberships_returns_Represents_a_user_s_association_to_a_team_response.freeze new file mode 100644 index 00000000000..e04114ed3bd --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_team_memberships_returns_Represents_a_user_s_association_to_a_team_response.freeze @@ -0,0 +1 @@ +2023-03-27T18:33:13.328Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_team_memberships_returns_Represents_a_user_s_association_to_a_team_response.json b/src/test/resources/cassettes/features/v2/Get_team_memberships_returns_Represents_a_user_s_association_to_a_team_response.json new file mode 100644 index 00000000000..452fc8d4120 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_team_memberships_returns_Represents_a_user_s_association_to_a_team_response.json @@ -0,0 +1,79 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"handle\":\"1679941993\",\"name\":\"1679941993\"},\"type\":\"team\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/team", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"type\":\"team\",\"id\":\"d5406960-cccd-11ed-b1e3-da7ad0900002\",\"attributes\":{\"name\":\"1679941993\",\"handle\":\"1679941993\",\"summary\":null,\"description\":null,\"color\":4,\"created_at\":\"2023-03-27T18:33:13.647495+00:00\",\"modified_at\":\"2023-03-27T18:33:13.647499+00:00\",\"user_count\":0,\"link_count\":0},\"relationships\":{\"team_links\":{\"links\":{\"related\":\"/api/v2/team/d5406960-cccd-11ed-b1e3-da7ad0900002/links\"}},\"user_team_permissions\":{\"links\":{\"related\":\"/api/v2/team/d5406960-cccd-11ed-b1e3-da7ad0900002/permission-settings\"}}}}}\n", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "a3500dba-8c06-747a-a4ac-cefce9e428d5" + }, + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/team/d5406960-cccd-11ed-b1e3-da7ad0900002/memberships", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":[],\"meta\":{\"pagination\":{\"offset\":0,\"first_offset\":0,\"prev_offset\":0,\"next_offset\":100,\"last_offset\":0,\"limit\":100,\"type\":\"offset_limit\",\"total\":0}},\"links\":{\"self\":\"https://api.datadoghq.com/api/v2/team/d5406960-cccd-11ed-b1e3-da7ad0900002/memberships\",\"last\":null,\"next\":\"https://api.datadoghq.com/api/v2/team/d5406960-cccd-11ed-b1e3-da7ad0900002/memberships?page[offset]=100&page[limit]=100\",\"prev\":null,\"first\":\"https://api.datadoghq.com/api/v2/team/d5406960-cccd-11ed-b1e3-da7ad0900002/memberships?page[offset]=0&page[limit]=100\"}}\n", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "bfca6e5e-0c96-1b3c-8035-b4f6f2c75d40" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/team/d5406960-cccd-11ed-b1e3-da7ad0900002", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "aae41c23-c2bf-a241-3cde-a9e74e98e4b9" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Remove_a_team_link_returns_API_error_response_response.freeze b/src/test/resources/cassettes/features/v2/Remove_a_team_link_returns_API_error_response_response.freeze new file mode 100644 index 00000000000..39aed026bf9 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Remove_a_team_link_returns_API_error_response_response.freeze @@ -0,0 +1 @@ +2023-03-27T18:33:14.528Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Remove_a_team_link_returns_API_error_response_response.json b/src/test/resources/cassettes/features/v2/Remove_a_team_link_returns_API_error_response_response.json new file mode 100644 index 00000000000..287b7501466 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Remove_a_team_link_returns_API_error_response_response.json @@ -0,0 +1,79 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"handle\":\"1679941994\",\"name\":\"1679941994\"},\"type\":\"team\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/team", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"type\":\"team\",\"id\":\"d5ed9248-cccd-11ed-bdb0-da7ad0900002\",\"attributes\":{\"name\":\"1679941994\",\"handle\":\"1679941994\",\"summary\":null,\"description\":null,\"color\":12,\"created_at\":\"2023-03-27T18:33:14.782729+00:00\",\"modified_at\":\"2023-03-27T18:33:14.782734+00:00\",\"user_count\":0,\"link_count\":0},\"relationships\":{\"team_links\":{\"links\":{\"related\":\"/api/v2/team/d5ed9248-cccd-11ed-bdb0-da7ad0900002/links\"}},\"user_team_permissions\":{\"links\":{\"related\":\"/api/v2/team/d5ed9248-cccd-11ed-bdb0-da7ad0900002/permission-settings\"}}}}}\n", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "0c214bbd-d8c5-8bf2-254f-2c291e47da8b" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/team/d5ed9248-cccd-11ed-bdb0-da7ad0900002/links/REPLACE.ME", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[\"REPLACE.ME is not a valid UUID not found\"]}", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "aed8a80c-9ccd-a3db-09b5-b15896447bcd" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/team/d5ed9248-cccd-11ed-bdb0-da7ad0900002", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "873b94e9-f975-c125-d1cd-a4da6980e832" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Remove_a_team_link_returns_No_Content_response.freeze b/src/test/resources/cassettes/features/v2/Remove_a_team_link_returns_No_Content_response.freeze new file mode 100644 index 00000000000..61c2bbf2ca8 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Remove_a_team_link_returns_No_Content_response.freeze @@ -0,0 +1 @@ +2023-03-27T18:33:15.734Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Remove_a_team_link_returns_No_Content_response.json b/src/test/resources/cassettes/features/v2/Remove_a_team_link_returns_No_Content_response.json new file mode 100644 index 00000000000..53f3ced168b --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Remove_a_team_link_returns_No_Content_response.json @@ -0,0 +1,130 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"handle\":\"1679941995\",\"name\":\"1679941995\"},\"type\":\"team\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/team", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"type\":\"team\",\"id\":\"d6a8c612-cccd-11ed-9a15-da7ad0900002\",\"attributes\":{\"name\":\"1679941995\",\"handle\":\"1679941995\",\"summary\":null,\"description\":null,\"color\":0,\"created_at\":\"2023-03-27T18:33:16.009128+00:00\",\"modified_at\":\"2023-03-27T18:33:16.009133+00:00\",\"user_count\":0,\"link_count\":0},\"relationships\":{\"team_links\":{\"links\":{\"related\":\"/api/v2/team/d6a8c612-cccd-11ed-9a15-da7ad0900002/links\"}},\"user_team_permissions\":{\"links\":{\"related\":\"/api/v2/team/d6a8c612-cccd-11ed-9a15-da7ad0900002/permission-settings\"}}}}}\n", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "d7bc3506-7a7b-264f-17e7-dacc7bea1160" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"label\":\"Test-Remove_a_team_link_returns_No_Content_response-1679941995\",\"position\":0,\"url\":\"https://example.com\"},\"type\":\"team_links\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/team/d6a8c612-cccd-11ed-9a15-da7ad0900002/links", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"type\":\"team_links\",\"id\":\"d6d77a5c-cccd-11ed-8328-da7ad0900002\",\"attributes\":{\"team_id\":\"d6a8c612-cccd-11ed-9a15-da7ad0900002\",\"label\":\"Test-Remove_a_team_link_returns_No_Content_response-1679941995\",\"url\":\"https://example.com\",\"position\":0}}}\n", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "2f5aaaf1-1956-26a3-97c7-c94f74ea1044" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/team/d6a8c612-cccd-11ed-9a15-da7ad0900002/links/d6d77a5c-cccd-11ed-8328-da7ad0900002", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "d0f5b1ae-494a-d7d7-775d-a55fe709020c" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/team/d6a8c612-cccd-11ed-9a15-da7ad0900002/links/d6d77a5c-cccd-11ed-8328-da7ad0900002", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[\"Link for ID d6d77a5c-cccd-11ed-8328-da7ad0900002 not found\"]}", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "d0f5b1ae-494a-d7d7-775d-a55fe709020d" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/team/d6a8c612-cccd-11ed-9a15-da7ad0900002", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "42944e78-4522-afcb-556c-17ce2fbe0bee" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Remove_a_team_returns_API_error_response_response.freeze b/src/test/resources/cassettes/features/v2/Remove_a_team_returns_API_error_response_response.freeze new file mode 100644 index 00000000000..ee6db1e5ba6 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Remove_a_team_returns_API_error_response_response.freeze @@ -0,0 +1 @@ +2023-03-27T18:33:17.516Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Remove_a_team_returns_API_error_response_response.json b/src/test/resources/cassettes/features/v2/Remove_a_team_returns_API_error_response_response.json new file mode 100644 index 00000000000..e2949dd4026 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Remove_a_team_returns_API_error_response_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/team/REPLACE.ME", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[\"REPLACE.ME is not a valid UUID not found\"]}", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "5a1acb00-2cea-e6ae-16df-7b23441a19ee" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Remove_a_team_returns_No_Content_response.freeze b/src/test/resources/cassettes/features/v2/Remove_a_team_returns_No_Content_response.freeze new file mode 100644 index 00000000000..be6f4f2b346 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Remove_a_team_returns_No_Content_response.freeze @@ -0,0 +1 @@ +2023-03-27T18:33:18.574Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Remove_a_team_returns_No_Content_response.json b/src/test/resources/cassettes/features/v2/Remove_a_team_returns_No_Content_response.json new file mode 100644 index 00000000000..f2f72d5174b --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Remove_a_team_returns_No_Content_response.json @@ -0,0 +1,79 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"handle\":\"1679941998\",\"name\":\"1679941998\"},\"type\":\"team\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/team", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"type\":\"team\",\"id\":\"d8648c52-cccd-11ed-a275-da7ad0900002\",\"attributes\":{\"name\":\"1679941998\",\"handle\":\"1679941998\",\"summary\":null,\"description\":null,\"color\":3,\"created_at\":\"2023-03-27T18:33:18.917793+00:00\",\"modified_at\":\"2023-03-27T18:33:18.917799+00:00\",\"user_count\":0,\"link_count\":0},\"relationships\":{\"team_links\":{\"links\":{\"related\":\"/api/v2/team/d8648c52-cccd-11ed-a275-da7ad0900002/links\"}},\"user_team_permissions\":{\"links\":{\"related\":\"/api/v2/team/d8648c52-cccd-11ed-a275-da7ad0900002/permission-settings\"}}}}}\n", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "c2805196-d59c-d0fa-2dab-f8ee5363f1ea" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/team/d8648c52-cccd-11ed-a275-da7ad0900002", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "0bc54bb3-e3b6-a318-26f0-bfc8ca1c847f" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/team/d8648c52-cccd-11ed-a275-da7ad0900002", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[\"Team for ID d8648c52-cccd-11ed-a275-da7ad0900002 not found\"]}", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "0bc54bb3-e3b6-a318-26f0-bfc8ca1c8480" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Remove_a_user_from_a_team_returns_API_error_response_response.freeze b/src/test/resources/cassettes/features/v2/Remove_a_user_from_a_team_returns_API_error_response_response.freeze new file mode 100644 index 00000000000..5bedff53cdc --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Remove_a_user_from_a_team_returns_API_error_response_response.freeze @@ -0,0 +1 @@ +2023-03-27T18:33:19.750Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Remove_a_user_from_a_team_returns_API_error_response_response.json b/src/test/resources/cassettes/features/v2/Remove_a_user_from_a_team_returns_API_error_response_response.json new file mode 100644 index 00000000000..5a76dbff20b --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Remove_a_user_from_a_team_returns_API_error_response_response.json @@ -0,0 +1,79 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"handle\":\"1679941999\",\"name\":\"1679941999\"},\"type\":\"team\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/team", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"type\":\"team\",\"id\":\"d90487a2-cccd-11ed-b49b-da7ad0900002\",\"attributes\":{\"name\":\"1679941999\",\"handle\":\"1679941999\",\"summary\":null,\"description\":null,\"color\":7,\"created_at\":\"2023-03-27T18:33:19.965841+00:00\",\"modified_at\":\"2023-03-27T18:33:19.965846+00:00\",\"user_count\":0,\"link_count\":0},\"relationships\":{\"team_links\":{\"links\":{\"related\":\"/api/v2/team/d90487a2-cccd-11ed-b49b-da7ad0900002/links\"}},\"user_team_permissions\":{\"links\":{\"related\":\"/api/v2/team/d90487a2-cccd-11ed-b49b-da7ad0900002/permission-settings\"}}}}}\n", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "59f74397-1a3a-4a93-b4c1-b885f89b7f3d" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/team/d90487a2-cccd-11ed-b49b-da7ad0900002/memberships/REPLACE.ME", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[\"REPLACE.ME is not a valid UUID not found\"]}", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "62191305-6c42-9b6e-4cb6-7cd49cdc00b5" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/team/d90487a2-cccd-11ed-b49b-da7ad0900002", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "5ebff90f-ad7a-c846-4239-86850515dad7" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_a_team_link_returns_API_error_response_response.freeze b/src/test/resources/cassettes/features/v2/Update_a_team_link_returns_API_error_response_response.freeze new file mode 100644 index 00000000000..202ae2a507c --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_a_team_link_returns_API_error_response_response.freeze @@ -0,0 +1 @@ +2023-03-27T18:33:21.380Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_a_team_link_returns_API_error_response_response.json b/src/test/resources/cassettes/features/v2/Update_a_team_link_returns_API_error_response_response.json new file mode 100644 index 00000000000..0417b0d3bad --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_a_team_link_returns_API_error_response_response.json @@ -0,0 +1,83 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"handle\":\"1679942001\",\"name\":\"1679942001\"},\"type\":\"team\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/team", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"type\":\"team\",\"id\":\"d9f9633a-cccd-11ed-b011-da7ad0900002\",\"attributes\":{\"name\":\"1679942001\",\"handle\":\"1679942001\",\"summary\":null,\"description\":null,\"color\":9,\"created_at\":\"2023-03-27T18:33:21.571325+00:00\",\"modified_at\":\"2023-03-27T18:33:21.571330+00:00\",\"user_count\":0,\"link_count\":0},\"relationships\":{\"team_links\":{\"links\":{\"related\":\"/api/v2/team/d9f9633a-cccd-11ed-b011-da7ad0900002/links\"}},\"user_team_permissions\":{\"links\":{\"related\":\"/api/v2/team/d9f9633a-cccd-11ed-b011-da7ad0900002/permission-settings\"}}}}}\n", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "36393aac-1b5a-f645-ffe8-1bc43b3aabec" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"label\":\"Link label\",\"url\":\"https://example.com\"},\"type\":\"team_links\"}}" + }, + "headers": {}, + "method": "PATCH", + "path": "/api/v2/team/d9f9633a-cccd-11ed-b011-da7ad0900002/links/REPLACE.ME", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[\"REPLACE.ME is not a valid UUID not found\"]}", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "681ebe3b-e473-7e97-0e3e-1f018c4214f9" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/team/d9f9633a-cccd-11ed-b011-da7ad0900002", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "bc29ed09-5987-1906-43af-72e2cc76d6bc" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_a_team_link_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Update_a_team_link_returns_OK_response.freeze new file mode 100644 index 00000000000..b0c26e02305 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_a_team_link_returns_OK_response.freeze @@ -0,0 +1 @@ +2023-03-27T18:33:22.365Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_a_team_link_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Update_a_team_link_returns_OK_response.json new file mode 100644 index 00000000000..28fcee5335a --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_a_team_link_returns_OK_response.json @@ -0,0 +1,134 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"handle\":\"1679942002\",\"name\":\"1679942002\"},\"type\":\"team\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/team", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"type\":\"team\",\"id\":\"da910f28-cccd-11ed-bf7d-da7ad0900002\",\"attributes\":{\"name\":\"1679942002\",\"handle\":\"1679942002\",\"summary\":null,\"description\":null,\"color\":9,\"created_at\":\"2023-03-27T18:33:22.564937+00:00\",\"modified_at\":\"2023-03-27T18:33:22.564941+00:00\",\"user_count\":0,\"link_count\":0},\"relationships\":{\"team_links\":{\"links\":{\"related\":\"/api/v2/team/da910f28-cccd-11ed-bf7d-da7ad0900002/links\"}},\"user_team_permissions\":{\"links\":{\"related\":\"/api/v2/team/da910f28-cccd-11ed-bf7d-da7ad0900002/permission-settings\"}}}}}\n", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "57a39807-ee90-7268-b6eb-8a2e03aa1e6b" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"label\":\"Test-Update_a_team_link_returns_OK_response-1679942002\",\"position\":0,\"url\":\"https://example.com\"},\"type\":\"team_links\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/team/da910f28-cccd-11ed-bf7d-da7ad0900002/links", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"type\":\"team_links\",\"id\":\"dadfcaa0-cccd-11ed-9ea9-da7ad0900002\",\"attributes\":{\"team_id\":\"da910f28-cccd-11ed-bf7d-da7ad0900002\",\"label\":\"Test-Update_a_team_link_returns_OK_response-1679942002\",\"url\":\"https://example.com\",\"position\":0}}}\n", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "68f7dd29-f9e1-11fc-6e39-1c58b1fbdda8" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"label\":\"New Label\",\"url\":\"https://example.com\"},\"type\":\"team_links\"}}" + }, + "headers": {}, + "method": "PATCH", + "path": "/api/v2/team/da910f28-cccd-11ed-bf7d-da7ad0900002/links/dadfcaa0-cccd-11ed-9ea9-da7ad0900002", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"type\":\"team_links\",\"id\":\"dadfcaa0-cccd-11ed-9ea9-da7ad0900002\",\"attributes\":{\"team_id\":\"da910f28-cccd-11ed-bf7d-da7ad0900002\",\"label\":\"New Label\",\"url\":\"https://example.com\",\"position\":0}}}\n", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "607514de-50ea-8282-bd8a-6212e75bc746" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/team/da910f28-cccd-11ed-bf7d-da7ad0900002/links/dadfcaa0-cccd-11ed-9ea9-da7ad0900002", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "6212b70f-9e0b-cc5f-0566-d0496df706f0" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/team/da910f28-cccd-11ed-bf7d-da7ad0900002", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "5c688c32-58af-ec73-e693-41813be79cfe" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_a_team_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Update_a_team_returns_OK_response.freeze new file mode 100644 index 00000000000..9e637214290 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_a_team_returns_OK_response.freeze @@ -0,0 +1 @@ +2023-03-27T18:33:24.467Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_a_team_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Update_a_team_returns_OK_response.json new file mode 100644 index 00000000000..99972a1066a --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_a_team_returns_OK_response.json @@ -0,0 +1,83 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"handle\":\"1679942004\",\"name\":\"1679942004\"},\"type\":\"team\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/team", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"type\":\"team\",\"id\":\"dbd52aae-cccd-11ed-988f-da7ad0900002\",\"attributes\":{\"name\":\"1679942004\",\"handle\":\"1679942004\",\"summary\":null,\"description\":null,\"color\":12,\"created_at\":\"2023-03-27T18:33:24.689063+00:00\",\"modified_at\":\"2023-03-27T18:33:24.689067+00:00\",\"user_count\":0,\"link_count\":0},\"relationships\":{\"team_links\":{\"links\":{\"related\":\"/api/v2/team/dbd52aae-cccd-11ed-988f-da7ad0900002/links\"}},\"user_team_permissions\":{\"links\":{\"related\":\"/api/v2/team/dbd52aae-cccd-11ed-988f-da7ad0900002/permission-settings\"}}}}}\n", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "5cc86f9b-5341-fa9e-c281-76dc2f7fa38e" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"handle\":\"1679942004\",\"name\":\"1679942004 updated\"},\"type\":\"team\"}}" + }, + "headers": {}, + "method": "PATCH", + "path": "/api/v2/team/dbd52aae-cccd-11ed-988f-da7ad0900002", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"type\":\"team\",\"id\":\"dbd52aae-cccd-11ed-988f-da7ad0900002\",\"attributes\":{\"name\":\"1679942004 updated\",\"handle\":\"1679942004\",\"summary\":null,\"description\":null,\"color\":12,\"created_at\":\"2023-03-27T18:33:24.689063+00:00\",\"modified_at\":\"2023-03-27T18:33:25.139823+00:00\",\"user_count\":0,\"link_count\":0},\"relationships\":{\"team_links\":{\"links\":{\"related\":\"/api/v2/team/dbd52aae-cccd-11ed-988f-da7ad0900002/links\"}},\"user_team_permissions\":{\"links\":{\"related\":\"/api/v2/team/dbd52aae-cccd-11ed-988f-da7ad0900002/permission-settings\"}}}}}\n", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "1a7ebdd8-7201-8885-a6ce-1e8e4f73f360" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/team/dbd52aae-cccd-11ed-988f-da7ad0900002", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "846ef997-fb12-23cd-30d0-4eb5bbcd72e5" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_a_user_s_role_on_a_team_returns_API_error_response_response.freeze b/src/test/resources/cassettes/features/v2/Update_a_user_s_role_on_a_team_returns_API_error_response_response.freeze new file mode 100644 index 00000000000..94febf74cd2 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_a_user_s_role_on_a_team_returns_API_error_response_response.freeze @@ -0,0 +1 @@ +2023-03-27T18:33:25.513Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_a_user_s_role_on_a_team_returns_API_error_response_response.json b/src/test/resources/cassettes/features/v2/Update_a_user_s_role_on_a_team_returns_API_error_response_response.json new file mode 100644 index 00000000000..8f5abfa53d9 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_a_user_s_role_on_a_team_returns_API_error_response_response.json @@ -0,0 +1,83 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"handle\":\"1679942005\",\"name\":\"1679942005\"},\"type\":\"team\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/team", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"type\":\"team\",\"id\":\"dc7e6240-cccd-11ed-bc0b-da7ad0900002\",\"attributes\":{\"name\":\"1679942005\",\"handle\":\"1679942005\",\"summary\":null,\"description\":null,\"color\":8,\"created_at\":\"2023-03-27T18:33:25.798162+00:00\",\"modified_at\":\"2023-03-27T18:33:25.798166+00:00\",\"user_count\":0,\"link_count\":0},\"relationships\":{\"team_links\":{\"links\":{\"related\":\"/api/v2/team/dc7e6240-cccd-11ed-bc0b-da7ad0900002/links\"}},\"user_team_permissions\":{\"links\":{\"related\":\"/api/v2/team/dc7e6240-cccd-11ed-bc0b-da7ad0900002/permission-settings\"}}}}}\n", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "a6d1ac40-a57c-e10b-c183-733e939a160d" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"role\":\"admin\"},\"type\":\"team_memberships\"}}" + }, + "headers": {}, + "method": "PATCH", + "path": "/api/v2/team/dc7e6240-cccd-11ed-bc0b-da7ad0900002/memberships/REPLACE.ME", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[\"REPLACE.ME is not a valid UUID not found\"]}", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "a3e67f05-5867-f324-367c-22a08c639763" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/team/dc7e6240-cccd-11ed-bc0b-da7ad0900002", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "9252b976-1c7b-63c8-3bdd-aaa3698b7d36" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_permission_setting_for_team_returns_API_error_response_response.freeze b/src/test/resources/cassettes/features/v2/Update_permission_setting_for_team_returns_API_error_response_response.freeze new file mode 100644 index 00000000000..d4b09319272 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_permission_setting_for_team_returns_API_error_response_response.freeze @@ -0,0 +1 @@ +2023-03-27T18:33:26.751Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_permission_setting_for_team_returns_API_error_response_response.json b/src/test/resources/cassettes/features/v2/Update_permission_setting_for_team_returns_API_error_response_response.json new file mode 100644 index 00000000000..061d47f330d --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_permission_setting_for_team_returns_API_error_response_response.json @@ -0,0 +1,83 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"handle\":\"1679942006\",\"name\":\"1679942006\"},\"type\":\"team\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/team", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"type\":\"team\",\"id\":\"dd3c1916-cccd-11ed-b35c-da7ad0900002\",\"attributes\":{\"name\":\"1679942006\",\"handle\":\"1679942006\",\"summary\":null,\"description\":null,\"color\":11,\"created_at\":\"2023-03-27T18:33:27.041313+00:00\",\"modified_at\":\"2023-03-27T18:33:27.041316+00:00\",\"user_count\":0,\"link_count\":0},\"relationships\":{\"team_links\":{\"links\":{\"related\":\"/api/v2/team/dd3c1916-cccd-11ed-b35c-da7ad0900002/links\"}},\"user_team_permissions\":{\"links\":{\"related\":\"/api/v2/team/dd3c1916-cccd-11ed-b35c-da7ad0900002/permission-settings\"}}}}}\n", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "743bffe0-c652-d5ff-de4d-01801d3cb5af" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"value\":\"admins\"},\"type\":\"team_permission_settings\"}}" + }, + "headers": {}, + "method": "PUT", + "path": "/api/v2/team/dd3c1916-cccd-11ed-b35c-da7ad0900002/permission-settings/REPLACE.ME", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[\"Invalid action type \\\"REPLACE.ME\\\". Valid actions: manage_membership, edit not found\"]}", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "bb614e3f-ad51-e844-8bdf-a1bb6b0b47e4" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/team/dd3c1916-cccd-11ed-b35c-da7ad0900002", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "39eb9f6a-e289-1d45-38c1-3a1aa4697024" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_permission_setting_for_team_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Update_permission_setting_for_team_returns_OK_response.freeze new file mode 100644 index 00000000000..fcc4623be14 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_permission_setting_for_team_returns_OK_response.freeze @@ -0,0 +1 @@ +2023-03-27T18:33:27.820Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_permission_setting_for_team_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Update_permission_setting_for_team_returns_OK_response.json new file mode 100644 index 00000000000..e4df102a98e --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_permission_setting_for_team_returns_OK_response.json @@ -0,0 +1,83 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"handle\":\"1679942007\",\"name\":\"1679942007\"},\"type\":\"team\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/team", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"type\":\"team\",\"id\":\"ddf389ac-cccd-11ed-ae16-da7ad0900002\",\"attributes\":{\"name\":\"1679942007\",\"handle\":\"1679942007\",\"summary\":null,\"description\":null,\"color\":9,\"created_at\":\"2023-03-27T18:33:28.242940+00:00\",\"modified_at\":\"2023-03-27T18:33:28.242944+00:00\",\"user_count\":0,\"link_count\":0},\"relationships\":{\"team_links\":{\"links\":{\"related\":\"/api/v2/team/ddf389ac-cccd-11ed-ae16-da7ad0900002/links\"}},\"user_team_permissions\":{\"links\":{\"related\":\"/api/v2/team/ddf389ac-cccd-11ed-ae16-da7ad0900002/permission-settings\"}}}}}\n", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "859b7ba6-ba95-a079-f36f-4a46338f795f" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"value\":\"admins\"},\"type\":\"team_permission_settings\"}}" + }, + "headers": {}, + "method": "PUT", + "path": "/api/v2/team/ddf389ac-cccd-11ed-ae16-da7ad0900002/permission-settings/manage_membership", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"type\":\"team_permission_settings\",\"id\":\"TeamPermission-ddf389ac-cccd-11ed-ae16-da7ad0900002-manage_membership\",\"attributes\":{\"value\":\"admins\",\"action\":\"manage_membership\",\"options\":[\"admins\",\"members\",\"organization\",\"user_access_manage\",\"teams_manage\"]}}}\n", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "a974ef99-e2cf-bfc7-9fbb-ea576de0de37" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/team/ddf389ac-cccd-11ed-ae16-da7ad0900002", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "21225708-e5cb-2c38-c51f-ad214b9fe30c" + } +] \ No newline at end of file diff --git a/src/test/resources/com/datadog/api/client/v2/api/given.json b/src/test/resources/com/datadog/api/client/v2/api/given.json index 868c8c12e3d..4a87b2fe4d9 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/given.json +++ b/src/test/resources/com/datadog/api/client/v2/api/given.json @@ -456,6 +456,46 @@ "tag": "Service Definition", "operationId": "CreateOrUpdateServiceDefinitions" }, + { + "parameters": [ + { + "name": "body", + "value": "{\n \"data\": {\n \"attributes\": {\n \"handle\": \"{{timestamp('now')}}\",\n \"name\": \"{{timestamp('now')}}\"\n },\n \"type\": \"team\"\n }\n}" + } + ], + "step": "there is a valid \"dd_team\" in the system", + "key": "dd_team", + "tag": "Teams", + "operationId": "CreateTeam" + }, + { + "parameters": [ + { + "name": "team_id", + "source": "dd_team.data.id" + }, + { + "name": "body", + "value": "{\n \"data\": {\n \"attributes\": {\n \"label\": \"{{unique}}\",\n \"url\": \"https://example.com\",\n \"position\": 0\n },\n \"type\": \"team_links\"\n }\n}" + } + ], + "step": "there is a valid \"team_link\" in the system", + "key": "team_link", + "tag": "Teams", + "operationId": "CreateTeamLink" + }, + { + "parameters": [ + { + "name": "body", + "value": "{\n \"data\": {\n \"attributes\": {\n \"role\": \"admin\"\n },\n \"relationships\": {\n \"user\": {\n \"data\": {\n \"id\": \"{{user.data.id}}\",\n \"type\": \"users\"\n }\n }\n },\n \"type\": \"team_memberships\"\n }\n}" + } + ], + "step": "there is a valid \"team_membership\" in the system", + "key": "team_membership", + "tag": "Teams", + "operationId": "CreateTeamMembership" + }, { "parameters": [ { diff --git a/src/test/resources/com/datadog/api/client/v2/api/teams.feature b/src/test/resources/com/datadog/api/client/v2/api/teams.feature new file mode 100644 index 00000000000..917d8783456 --- /dev/null +++ b/src/test/resources/com/datadog/api/client/v2/api/teams.feature @@ -0,0 +1,281 @@ +@endpoint(team) @endpoint(team-v2) @endpoint(teams) @endpoint(teams-v2) +Feature: Teams + View and manage teams within Datadog. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "Teams" API + + @generated @skip @team:DataDog/core-app + 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"}} + 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"}} + When the request is sent + Then the response status is 200 Represents a user's association to a team + + @team:DataDog/core-app + Scenario: Create a team link returns "API error response." response + Given new "CreateTeamLink" request + And there is a valid "dd_team" in the system + And request contains "team_id" parameter from "dd_team.data.id" + And body with value {"data": {"attributes": {"label": "", "url": "https://example.com", "position": 0}, "type": "team_links"}} + When the request is sent + Then the response status is 422 API error response. + + @team:DataDog/core-app + Scenario: Create a team link returns "OK" response + Given new "CreateTeamLink" request + And there is a valid "dd_team" in the system + And request contains "team_id" parameter from "dd_team.data.id" + And body with value {"data": {"attributes": {"label": "Link label", "url": "https://example.com", "position": 0}, "type": "team_links"}} + When the request is sent + Then the response status is 200 OK + + @team:DataDog/core-app + Scenario: Create a team returns "API error response." response + Given new "CreateTeam" request + And there is a valid "dd_team" in the system + And body with value {"data": {"attributes": {"handle": "{{dd_team.data.attributes.handle}}", "name": "Example Team"}, "relationships": {"users": {"data": []}}, "type": "team"}} + When the request is sent + Then the response status is 409 API error response. + + @team:DataDog/core-app + Scenario: Create a team returns "CREATED" response + Given new "CreateTeam" request + And body with value {"data": {"attributes": {"handle": "{{timestamp('now')}}", "name": "{{timestamp('now')}}"}, "relationships": {"users": {"data": []}}, "type": "team"}} + When the request is sent + Then the response status is 201 CREATED + + @team:DataDog/core-app + Scenario: Get a team link returns "API error response." response + Given new "GetTeamLink" request + And there is a valid "dd_team" in the system + And request contains "team_id" parameter from "dd_team.data.id" + And request contains "link_id" parameter with value "REPLACE.ME" + When the request is sent + Then the response status is 404 API error response. + + @team:DataDog/core-app + Scenario: Get a team link returns "OK" response + Given new "GetTeamLink" request + And there is a valid "dd_team" in the system + And there is a valid "team_link" in the system + And request contains "team_id" parameter from "dd_team.data.id" + And request contains "link_id" parameter from "team_link.data.id" + When the request is sent + Then the response status is 200 OK + + @team:DataDog/core-app + Scenario: Get a team returns "API error response." response + Given new "GetTeam" request + And request contains "team_id" parameter with value "REPLACE.ME" + When the request is sent + Then the response status is 404 API error response. + + @team:DataDog/core-app + Scenario: Get a team returns "OK" response + Given new "GetTeam" request + And there is a valid "dd_team" in the system + And request contains "team_id" parameter from "dd_team.data.id" + When the request is sent + Then the response status is 200 OK + + @team:DataDog/core-app + Scenario: Get all teams returns "OK" response + Given new "GetAllTeams" request + And there is a valid "dd_team" in the system + When the request is sent + Then the response status is 200 OK + + @team:DataDog/core-app + Scenario: Get links for a team returns "API error response." response + Given new "GetTeamLinks" request + And request contains "team_id" parameter with value "REPLACE.ME" + When the request is sent + Then the response status is 404 API error response. + + @team:DataDog/core-app + Scenario: Get links for a team returns "OK" response + Given new "GetTeamLinks" request + And there is a valid "dd_team" in the system + And request contains "team_id" parameter from "dd_team.data.id" + When the request is sent + Then the response status is 200 OK + + @team:DataDog/core-app + Scenario: Get permission settings for a team returns "API error response." response + Given new "GetTeamPermissionSettings" request + And request contains "team_id" parameter with value "REPLACE.ME" + When the request is sent + Then the response status is 404 API error response. + + @team:DataDog/core-app + Scenario: Get permission settings for a team returns "OK" response + Given new "GetTeamPermissionSettings" request + And there is a valid "dd_team" in the system + And request contains "team_id" parameter from "dd_team.data.id" + When the request is sent + Then the response status is 200 OK + + @team:DataDog/core-app + Scenario: Get team memberships returns "API error response." response + Given new "GetTeamMemberships" request + And request contains "team_id" parameter with value "REPLACE.ME" + When the request is sent + Then the response status is 404 API error response. + + @team:DataDog/core-app + Scenario: Get team memberships returns "Represents a user's association to a team" response + Given new "GetTeamMemberships" request + And there is a valid "dd_team" in the system + And request contains "team_id" parameter from "dd_team.data.id" + When the request is sent + Then the response status is 200 Represents a user's association to a team + + @team:DataDog/core-app + Scenario: Remove a team link returns "API error response." response + Given new "RemoveTeamLink" request + And there is a valid "dd_team" in the system + And request contains "team_id" parameter from "dd_team.data.id" + And request contains "link_id" parameter with value "REPLACE.ME" + When the request is sent + Then the response status is 404 API error response. + + @team:DataDog/core-app + Scenario: Remove a team link returns "No Content" response + Given new "RemoveTeamLink" request + And there is a valid "dd_team" in the system + And there is a valid "team_link" in the system + And request contains "team_id" parameter from "dd_team.data.id" + And request contains "link_id" parameter from "team_link.data.id" + When the request is sent + Then the response status is 204 No Content + + @team:DataDog/core-app + Scenario: Remove a team returns "API error response." response + Given new "RemoveTeam" request + And request contains "team_id" parameter with value "REPLACE.ME" + When the request is sent + Then the response status is 404 API error response. + + @team:DataDog/core-app + Scenario: Remove a team returns "No Content" response + Given new "RemoveTeam" request + And there is a valid "dd_team" in the system + And request contains "team_id" parameter from "dd_team.data.id" + When the request is sent + Then the response status is 204 No Content + + @team:DataDog/core-app + Scenario: Remove a user from a team returns "API error response." response + Given new "RemoveTeamMembership" request + And there is a valid "dd_team" in the system + And request contains "team_id" parameter from "dd_team.data.id" + And request contains "user_id" parameter with value "REPLACE.ME" + When the request is sent + Then the response status is 404 API error response. + + @skip @team:DataDog/core-app + Scenario: Remove a user from a team returns "No Content" response + Given new "RemoveTeamMembership" request + And there is a valid "dd_team" in the system + And request contains "team_id" parameter from "dd_team.data.id" + And request contains "user_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 No Content + + @team:DataDog/core-app + Scenario: Update a team link returns "API error response." response + Given new "UpdateTeamLink" request + And there is a valid "dd_team" in the system + And request contains "team_id" parameter from "dd_team.data.id" + And request contains "link_id" parameter with value "REPLACE.ME" + And body with value {"data": {"attributes": {"label": "Link label", "url": "https://example.com"}, "type": "team_links"}} + When the request is sent + Then the response status is 404 API error response. + + @team:DataDog/core-app + Scenario: Update a team link returns "OK" response + Given new "UpdateTeamLink" request + And there is a valid "dd_team" in the system + And there is a valid "team_link" in the system + And request contains "team_id" parameter from "dd_team.data.id" + And request contains "link_id" parameter from "team_link.data.id" + And body with value {"data": {"attributes": {"label": "New Label", "url": "https://example.com"}, "type": "team_links"}} + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/core-app + Scenario: Update a team returns "API error response." response + Given new "UpdateTeam" request + And request contains "team_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"handle": "example-team", "name": "Example Team"}, "relationships": {"team_links": {"data": [{"id": "f9bb8444-af7f-11ec-ac2c-da7ad0900001", "type": "team_links"}]}}, "type": "team"}} + When the request is sent + Then the response status is 409 API error response. + + @team:DataDog/core-app + Scenario: Update a team returns "OK" response + Given new "UpdateTeam" request + And there is a valid "dd_team" in the system + And request contains "team_id" parameter from "dd_team.data.id" + And body with value {"data": {"attributes": {"handle": "{{dd_team.data.attributes.handle}}", "name": "{{dd_team.data.attributes.name}} updated"}, "type": "team"}} + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/core-app + Scenario: Update a user's membership attributes on a team returns "API error response." response + Given new "UpdateTeamMembership" request + And request contains "team_id" parameter from "REPLACE.ME" + And request contains "user_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"role": "admin"}, "type": "team_memberships"}} + When the request is sent + Then the response status is 404 API error response. + + @generated @skip @team:DataDog/core-app + Scenario: Update a user's membership attributes on a team returns "Represents a user's association to a team" response + Given new "UpdateTeamMembership" request + And request contains "team_id" parameter from "REPLACE.ME" + And request contains "user_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"role": "admin"}, "type": "team_memberships"}} + When the request is sent + Then the response status is 200 Represents a user's association to a team + + @team:DataDog/core-app + Scenario: Update a user's role on a team returns "API error response." response + Given new "UpdateTeamMembership" request + And there is a valid "dd_team" in the system + And request contains "team_id" parameter from "dd_team.data.id" + And request contains "user_id" parameter with value "REPLACE.ME" + And body with value {"data": {"attributes": {"role": "admin"}, "type": "team_memberships"}} + When the request is sent + Then the response status is 404 API error response. + + @team:DataDog/core-app + Scenario: Update permission setting for team returns "API error response." response + Given new "UpdateTeamPermissionSetting" request + And there is a valid "dd_team" in the system + And request contains "team_id" parameter from "dd_team.data.id" + And request contains "action" parameter with value "REPLACE.ME" + And body with value {"data": {"attributes": {"value": "admins"}, "type": "team_permission_settings"}} + When the request is sent + Then the response status is 404 API error response. + + @team:DataDog/core-app + Scenario: Update permission setting for team returns "OK" response + Given new "UpdateTeamPermissionSetting" request + And there is a valid "dd_team" in the system + And request contains "team_id" parameter from "dd_team.data.id" + And request contains "action" parameter with value "manage_membership" + And body with value {"data": {"attributes": {"value": "admins"}, "type": "team_permission_settings"}} + When the request is sent + Then the response status is 200 OK diff --git a/src/test/resources/com/datadog/api/client/v2/api/undo.json b/src/test/resources/com/datadog/api/client/v2/api/undo.json index 9cc0a363536..669283a8a2c 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/undo.json +++ b/src/test/resources/com/datadog/api/client/v2/api/undo.json @@ -1386,6 +1386,131 @@ "type": "safe" } }, + "GetAllTeams": { + "tag": "Teams", + "undo": { + "type": "safe" + } + }, + "CreateTeam": { + "tag": "Teams", + "undo": { + "operationId": "RemoveTeam", + "parameters": [ + { + "name": "team_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "RemoveTeam": { + "tag": "Teams", + "undo": { + "type": "idempotent" + } + }, + "GetTeam": { + "tag": "Teams", + "undo": { + "type": "safe" + } + }, + "UpdateTeam": { + "tag": "Teams", + "undo": { + "type": "idempotent" + } + }, + "GetTeamLinks": { + "tag": "Teams", + "undo": { + "type": "safe" + } + }, + "CreateTeamLink": { + "tag": "Teams", + "undo": { + "operationId": "RemoveTeamLink", + "parameters": [ + { + "name": "team_id", + "source": "data.attributes.team_id" + }, + { + "name": "link_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "RemoveTeamLink": { + "tag": "Teams", + "undo": { + "type": "idempotent" + } + }, + "GetTeamLink": { + "tag": "Teams", + "undo": { + "type": "safe" + } + }, + "UpdateTeamLink": { + "tag": "Teams", + "undo": { + "type": "idempotent" + } + }, + "GetTeamMemberships": { + "tag": "Teams", + "undo": { + "type": "safe" + } + }, + "CreateTeamMembership": { + "tag": "Teams", + "undo": { + "operationId": "RemoveTeamMembership", + "parameters": [ + { + "name": "team_id", + "template": "{{team.data.id}}" + }, + { + "name": "user_id", + "source": "data.relationships.user.data.id" + } + ], + "type": "unsafe" + } + }, + "RemoveTeamMembership": { + "tag": "Teams", + "undo": { + "type": "idempotent" + } + }, + "UpdateTeamMembership": { + "tag": "Teams", + "undo": { + "type": "idempotent" + } + }, + "GetTeamPermissionSettings": { + "tag": "Teams", + "undo": { + "type": "safe" + } + }, + "UpdateTeamPermissionSetting": { + "tag": "Teams", + "undo": { + "type": "idempotent" + } + }, "ListIncidentTeams": { "tag": "Incident Teams", "undo": {