@@ -49,15 +49,30 @@ type CustomRepoRoles struct {
49
49
UpdatedAt * Timestamp `json:"updated_at,omitempty"`
50
50
}
51
51
52
- // CreateOrUpdateOrgRoleOptions represents options required to create or update a custom organization role.
53
- type CreateOrUpdateOrgRoleOptions struct {
52
+ // CreateOrgRoleOptions represents options required to create a custom organization role.
53
+ type CreateOrgRoleOptions struct {
54
+ Name * string `json:"name"`
55
+ Description * string `json:"description"`
56
+ Permissions []string `json:"permissions"`
57
+ }
58
+
59
+ // UpdateOrgRoleOptions represents options used to update a custom organization role.
60
+ type UpdateOrgRoleOptions struct {
54
61
Name * string `json:"name,omitempty"`
55
62
Description * string `json:"description,omitempty"`
56
63
Permissions []string `json:"permissions,omitempty"`
57
64
}
58
65
59
- // CreateOrUpdateCustomRepoRoleOptions represents options required to create or update a custom repository role.
60
- type CreateOrUpdateCustomRepoRoleOptions struct {
66
+ // CreateCustomRepoRoleOptions represents options required to create a custom repository role.
67
+ type CreateCustomRepoRoleOptions struct {
68
+ Name * string `json:"name"`
69
+ Description * string `json:"description"`
70
+ BaseRole * string `json:"base_role"`
71
+ Permissions []string `json:"permissions"`
72
+ }
73
+
74
+ // UpdateCustomRepoRoleOptions represents options used to update a custom repository role.
75
+ type UpdateCustomRepoRoleOptions struct {
61
76
Name * string `json:"name,omitempty"`
62
77
Description * string `json:"description,omitempty"`
63
78
BaseRole * string `json:"base_role,omitempty"`
@@ -93,7 +108,7 @@ func (s *OrganizationsService) ListRoles(ctx context.Context, org string) (*Orga
93
108
// GitHub API docs: https://docs.github.com/rest/orgs/organization-roles#create-a-custom-organization-role
94
109
//
95
110
//meta:operation POST /orgs/{org}/organization-roles
96
- func (s * OrganizationsService ) CreateCustomOrgRole (ctx context.Context , org string , opts * CreateOrUpdateOrgRoleOptions ) (* CustomOrgRoles , * Response , error ) {
111
+ func (s * OrganizationsService ) CreateCustomOrgRole (ctx context.Context , org string , opts * CreateOrgRoleOptions ) (* CustomOrgRoles , * Response , error ) {
97
112
u := fmt .Sprintf ("orgs/%v/organization-roles" , org )
98
113
99
114
req , err := s .client .NewRequest ("POST" , u , opts )
@@ -116,7 +131,7 @@ func (s *OrganizationsService) CreateCustomOrgRole(ctx context.Context, org stri
116
131
// GitHub API docs: https://docs.github.com/rest/orgs/organization-roles#update-a-custom-organization-role
117
132
//
118
133
//meta:operation PATCH /orgs/{org}/organization-roles/{role_id}
119
- func (s * OrganizationsService ) UpdateCustomOrgRole (ctx context.Context , org string , roleID int64 , opts * CreateOrUpdateOrgRoleOptions ) (* CustomOrgRoles , * Response , error ) {
134
+ func (s * OrganizationsService ) UpdateCustomOrgRole (ctx context.Context , org string , roleID int64 , opts * UpdateOrgRoleOptions ) (* CustomOrgRoles , * Response , error ) {
120
135
u := fmt .Sprintf ("orgs/%v/organization-roles/%v" , org , roleID )
121
136
122
137
req , err := s .client .NewRequest ("PATCH" , u , opts )
@@ -185,7 +200,7 @@ func (s *OrganizationsService) ListCustomRepoRoles(ctx context.Context, org stri
185
200
// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/custom-roles#create-a-custom-repository-role
186
201
//
187
202
//meta:operation POST /orgs/{org}/custom-repository-roles
188
- func (s * OrganizationsService ) CreateCustomRepoRole (ctx context.Context , org string , opts * CreateOrUpdateCustomRepoRoleOptions ) (* CustomRepoRoles , * Response , error ) {
203
+ func (s * OrganizationsService ) CreateCustomRepoRole (ctx context.Context , org string , opts * CreateCustomRepoRoleOptions ) (* CustomRepoRoles , * Response , error ) {
189
204
u := fmt .Sprintf ("orgs/%v/custom-repository-roles" , org )
190
205
191
206
req , err := s .client .NewRequest ("POST" , u , opts )
@@ -208,7 +223,7 @@ func (s *OrganizationsService) CreateCustomRepoRole(ctx context.Context, org str
208
223
// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/custom-roles#update-a-custom-repository-role
209
224
//
210
225
//meta:operation PATCH /orgs/{org}/custom-repository-roles/{role_id}
211
- func (s * OrganizationsService ) UpdateCustomRepoRole (ctx context.Context , org string , roleID int64 , opts * CreateOrUpdateCustomRepoRoleOptions ) (* CustomRepoRoles , * Response , error ) {
226
+ func (s * OrganizationsService ) UpdateCustomRepoRole (ctx context.Context , org string , roleID int64 , opts * UpdateCustomRepoRoleOptions ) (* CustomRepoRoles , * Response , error ) {
212
227
u := fmt .Sprintf ("orgs/%v/custom-repository-roles/%v" , org , roleID )
213
228
214
229
req , err := s .client .NewRequest ("PATCH" , u , opts )
0 commit comments