@@ -2,12 +2,14 @@ package sentry
22
33import (
44 "fmt"
5+ "path"
56 "time"
67)
78
89const (
9- // OrgEndpointName is set to roganizations
10- OrgEndpointName = "organizations"
10+ MembersEndpointName = "members"
11+ OrgEndpointName = "organizations"
12+ UsersEndpointName = "users"
1113)
1214
1315// Quota is your quote for a project limit and max rate
@@ -37,13 +39,27 @@ func (c *Client) GetOrganization(orgslug string) (Organization, error) {
3739 return org , err
3840}
3941
42+ // GetOrganizationMember returns the member associated with orgslug and memberID
43+ func (c * Client ) GetOrganizationMember (orgslug string , memberID string ) (Member , error ) {
44+ var member Member
45+ err := c .do ("GET" , path .Join (OrgEndpointName , orgslug , MembersEndpointName , memberID ), & member , nil )
46+ return member , err
47+ }
48+
4049// GetOrganizations will return back every organization in the sentry instance
4150func (c * Client ) GetOrganizations () ([]Organization , * Link , error ) {
4251 orgs := make ([]Organization , 0 )
4352 link , err := c .doWithPagination ("GET" , OrgEndpointName , & orgs , nil )
4453 return orgs , link , err
4554}
4655
56+ // ListOrganizationUsers returns users in the organization identified by orgslug
57+ func (c * Client ) ListOrganizationUsers (orgslug string ) ([]User , error ) {
58+ users := make ([]User , 0 )
59+ err := c .do ("GET" , path .Join (OrgEndpointName , orgslug , UsersEndpointName ), & users , nil )
60+ return users , err
61+ }
62+
4763// CreateOrganization creates a organization with a name
4864func (c * Client ) CreateOrganization (orgname string ) (Organization , error ) {
4965 var org Organization
0 commit comments