@@ -2,12 +2,14 @@ package sentry
2
2
3
3
import (
4
4
"fmt"
5
+ "path"
5
6
"time"
6
7
)
7
8
8
9
const (
9
- // OrgEndpointName is set to roganizations
10
- OrgEndpointName = "organizations"
10
+ MembersEndpointName = "members"
11
+ OrgEndpointName = "organizations"
12
+ UsersEndpointName = "users"
11
13
)
12
14
13
15
// Quota is your quote for a project limit and max rate
@@ -37,13 +39,27 @@ func (c *Client) GetOrganization(orgslug string) (Organization, error) {
37
39
return org , err
38
40
}
39
41
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
+
40
49
// GetOrganizations will return back every organization in the sentry instance
41
50
func (c * Client ) GetOrganizations () ([]Organization , * Link , error ) {
42
51
orgs := make ([]Organization , 0 )
43
52
link , err := c .doWithPagination ("GET" , OrgEndpointName , & orgs , nil )
44
53
return orgs , link , err
45
54
}
46
55
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
+
47
63
// CreateOrganization creates a organization with a name
48
64
func (c * Client ) CreateOrganization (orgname string ) (Organization , error ) {
49
65
var org Organization
0 commit comments