| 1 | package bitwarden |
| 2 | |
| 3 | import ( |
| 4 | "context" |
| 5 | "net/url" |
| 6 | ) |
| 7 | |
| 8 | // OrgMembersService handles organization member operations. |
| 9 | type OrgMembersService struct { |
| 10 | t *transport |
| 11 | } |
| 12 | |
| 13 | // List returns all members of an organization. |
| 14 | func (s *OrgMembersService) List(ctx context.Context, organizationID string) ([]OrgMember, error) { |
| 15 | q := url.Values{ |
| 16 | "organizationid": {organizationID}, |
| 17 | } |
| 18 | data, err := s.t.get(ctx, "/list/object/org-members", q) |
| 19 | if err != nil { |
| 20 | return nil, err |
| 21 | } |
| 22 | return decodeListResponse[OrgMember](data) |
| 23 | } |
| 24 | |
| 25 | // Confirm confirms an invited organization member. |
| 26 | func (s *OrgMembersService) Confirm(ctx context.Context, id, organizationID string) error { |
| 27 | _, err := s.t.post(ctx, "/confirm/org-member/"+id, ConfirmRequest{OrganizationID: organizationID}) |
| 28 | return err |
| 29 | } |
| 30 | |