@@ -5,10 +5,10 @@ module Teams
55 # Create a new project bound to a team.
66 #
77 # @example
8- # SentryApi.create_project('team-slug',{name:'new -name'})
8+ # SentryApi.create_project('team-slug', {name:'team -name'})
99 #
10- # @param team_slug [String] the slug of the team to create a new project for.
11- # @param organization_slug [String] the slug of the organization the team belongs to.
10+ # @param team_slug [String] the slug of the team
11+ # @param organization_slug [String] the slug of the organization
1212 # @param [Hash] options A customizable set of options.
1313 # @option options [String] :name the name for the new project.
1414 # @option options [String] :slug optionally a slug for the new project. If it’s not provided a slug is generated from the name.
@@ -18,7 +18,59 @@ def create_project(team_slug, options={}, organization_slug="")
1818 post ( "/teams/#{ organization_slug } /#{ team_slug } /projects/" , body : options )
1919 end
2020
21+ # Schedules a team for deletion
22+ #
23+ # @example
24+ # SentryApi.delete_team('team-slug')
25+ #
26+ # @param team_slug [String] the slug of the team
27+ # @param organization_slug [String] the slug of the organization
28+ def delete_team ( team_slug , organization_slug = "" )
29+ organization_slug = @default_org_slug if organization_slug == ""
30+ delete ( "/teams/#{ organization_slug } /#{ team_slug } /" )
31+ end
2132
22- end
33+ # Return a list of projects bound to a team
34+ #
35+ # @example
36+ # SentryApi.delete_team('team-slug')
37+ #
38+ # @param team_slug [String] the slug of the team
39+ # @param organization_slug [String] the slug of the organization
40+ # @return [Array<SentryApi::ObjectifiedHash>]
41+ def team_projects ( team_slug , organization_slug = "" )
42+ organization_slug = @default_org_slug if organization_slug == ""
43+ get ( "/teams/#{ organization_slug } /#{ team_slug } /projects/" )
44+ end
2345
46+ # Return details on an individual team.
47+ #
48+ # @example
49+ # SentryApi.team_projects('team-slug')
50+ #
51+ # @param team_slug [String] the slug of the team
52+ # @param organization_slug [String] the slug of the organization
53+ # @return [SentryApi::ObjectifiedHash]
54+ def team ( team_slug , organization_slug = "" )
55+ organization_slug = @default_org_slug if organization_slug == ""
56+ get ( "/teams/#{ organization_slug } /#{ team_slug } /" )
57+ end
58+
59+ # Update various attributes and configurable settings for the given team.
60+ #
61+ # @example
62+ # SentryApi.update_team('team-slug', {name:'team-name'})
63+ #
64+ # @param team_slug [String] the slug of the team
65+ # @param organization_slug [String] the slug of the organization
66+ # @param [Hash] options A customizable set of options.
67+ # @option options [String] :name the name for the new project.
68+ # @option options [String] :slug optionally a slug for the new project. If it’s not provided a slug is generated from the name.
69+ # @return [SentryApi::ObjectifiedHash]
70+ def update_team ( team_slug , options = { } , organization_slug = "" )
71+ organization_slug = @default_org_slug if organization_slug == ""
72+ get ( "/teams/#{ organization_slug } /#{ team_slug } /" , body : options )
73+ end
74+
75+ end
2476end
0 commit comments