Skip to content

Commit f681502

Browse files
committed
ref: crud organization members
1 parent 9a02b31 commit f681502

5 files changed

+903
-60
lines changed

internal/apiclient/api.yaml

+220-1
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,11 @@ paths:
3737
/0/organizations/{organization_id_or_slug}/members/:
3838
parameters:
3939
- $ref: "#/components/parameters/organization_id_or_slug"
40-
- $ref: "#/components/parameters/cursor"
4140
get:
4241
summary: List Organization Members
4342
operationId: listOrganizationMembers
43+
parameters:
44+
- $ref: "#/components/parameters/cursor"
4445
responses:
4546
"200":
4647
description: OK
@@ -56,6 +57,99 @@ paths:
5657
description: Forbidden
5758
"404":
5859
description: Not Found
60+
post:
61+
summary: Create an Organization Member
62+
operationId: createOrganizationMember
63+
requestBody:
64+
required: true
65+
content:
66+
application/json:
67+
schema:
68+
type: object
69+
required:
70+
- email
71+
- orgRole
72+
properties:
73+
email:
74+
type: string
75+
orgRole:
76+
type: string
77+
teams:
78+
type: array
79+
items:
80+
type: string
81+
responses:
82+
"201":
83+
description: Created
84+
content:
85+
application/json:
86+
schema:
87+
$ref: "#/components/schemas/OrganizationMember"
88+
"401":
89+
description: Unauthorized
90+
"403":
91+
description: Forbidden
92+
/0/organizations/{organization_id_or_slug}/members/{member_id}/:
93+
parameters:
94+
- $ref: "#/components/parameters/organization_id_or_slug"
95+
- $ref: "#/components/parameters/member_id"
96+
get:
97+
summary: Retrieve an Organization Member
98+
operationId: getOrganizationMember
99+
responses:
100+
"200":
101+
description: OK
102+
content:
103+
application/json:
104+
schema:
105+
$ref: "#/components/schemas/OrganizationMemberWithRoles"
106+
"401":
107+
description: Unauthorized
108+
"403":
109+
description: Forbidden
110+
"404":
111+
description: Not Found
112+
put:
113+
summary: Update an Organization Member
114+
operationId: updateOrganizationMember
115+
requestBody:
116+
required: true
117+
content:
118+
application/json:
119+
schema:
120+
type: object
121+
properties:
122+
orgRole:
123+
type: string
124+
teamRoles:
125+
type: array
126+
items:
127+
$ref: "#/components/schemas/TeamRole"
128+
responses:
129+
"200":
130+
description: OK
131+
content:
132+
application/json:
133+
schema:
134+
$ref: "#/components/schemas/OrganizationMemberWithRoles"
135+
"401":
136+
description: Unauthorized
137+
"403":
138+
description: Forbidden
139+
"404":
140+
description: Not Found
141+
delete:
142+
summary: Delete an Organization Member
143+
operationId: deleteOrganizationMember
144+
responses:
145+
"204":
146+
description: No Content
147+
"401":
148+
description: Unauthorized
149+
"403":
150+
description: Forbidden
151+
"404":
152+
description: Not Found
59153
/0/organizations/{organization_id_or_slug}/projects/:
60154
parameters:
61155
- $ref: "#/components/parameters/organization_id_or_slug"
@@ -670,6 +764,12 @@ components:
670764
required: true
671765
schema:
672766
type: string
767+
member_id:
768+
name: member_id
769+
in: path
770+
required: true
771+
schema:
772+
type: string
673773
cursor:
674774
name: cursor
675775
in: query
@@ -683,19 +783,31 @@ components:
683783
- id
684784
- name
685785
- slug
786+
- orgRoleList
787+
- teamRoleList
686788
properties:
687789
id:
688790
type: string
689791
name:
690792
type: string
691793
slug:
692794
type: string
795+
orgRoleList:
796+
type: array
797+
items:
798+
$ref: "#/components/schemas/OrganizationRoleListItem"
799+
teamRoleList:
800+
type: array
801+
items:
802+
$ref: "#/components/schemas/TeamRoleListItem"
693803
OrganizationMember:
694804
type: object
695805
required:
696806
- id
697807
- email
698808
- name
809+
- pending
810+
- expired
699811
- orgRole
700812
properties:
701813
id:
@@ -704,8 +816,115 @@ components:
704816
type: string
705817
name:
706818
type: string
819+
pending:
820+
type: boolean
821+
expired:
822+
type: boolean
707823
orgRole:
708824
type: string
825+
OrganizationRoleListItem:
826+
type: object
827+
required:
828+
- id
829+
- name
830+
- desc
831+
- scopes
832+
- isAllowed
833+
- isRetired
834+
- isGlobal
835+
- minimumTeamRole
836+
properties:
837+
id:
838+
type: string
839+
name:
840+
type: string
841+
desc:
842+
type: string
843+
scopes:
844+
type: array
845+
items:
846+
type: string
847+
isAllowed:
848+
type: boolean
849+
isRetired:
850+
type: boolean
851+
isGlobal:
852+
type: boolean
853+
minimumTeamRole:
854+
type: string
855+
TeamRoleListItem:
856+
type: object
857+
required:
858+
- id
859+
- name
860+
- desc
861+
- scopes
862+
- isAllowed
863+
- isRetired
864+
- isMinimumRoleFor
865+
properties:
866+
id:
867+
type: string
868+
name:
869+
type: string
870+
desc:
871+
type: string
872+
scopes:
873+
type: array
874+
items:
875+
type: string
876+
isAllowed:
877+
type: boolean
878+
isRetired:
879+
type: boolean
880+
isMinimumRoleFor:
881+
type: string
882+
TeamRole:
883+
type: object
884+
required:
885+
- teamSlug
886+
properties:
887+
teamSlug:
888+
type: string
889+
role:
890+
type: string
891+
OrganizationMemberWithRoles:
892+
type: object
893+
required:
894+
- id
895+
- email
896+
- name
897+
- pending
898+
- expired
899+
- orgRole
900+
- orgRoleList
901+
- teamRoles
902+
- teamRoleList
903+
properties:
904+
id:
905+
type: string
906+
email:
907+
type: string
908+
name:
909+
type: string
910+
pending:
911+
type: boolean
912+
expired:
913+
type: boolean
914+
orgRole:
915+
type: string
916+
orgRoleList:
917+
type: array
918+
items:
919+
$ref: "#/components/schemas/OrganizationRoleListItem"
920+
teamRoles:
921+
type: array
922+
items:
923+
$ref: "#/components/schemas/TeamRole"
924+
teamRoleList:
925+
type: array
926+
items:
927+
$ref: "#/components/schemas/TeamRoleListItem"
709928
Project:
710929
type: object
711930
required:

0 commit comments

Comments
 (0)