Commit 8dadafe
committed
refactor: use enum types for setPermission and setNotificationSetting
Addresses review feedback from @rozza-sb on #2219:
- setNotificationSetting now takes a new GHTeam.NotificationSetting
enum (NOTIFICATIONS_ENABLED / NOTIFICATIONS_DISABLED) instead of a
raw String. The enum overrides toString() to return the exact API
values and is passed to .with("notification_setting", ...) as a
String so transformEnum() doesn't rewrite the underscores.
- setPermission now takes GHOrganization.Permission (ADMIN, MAINTAIN,
PULL, PUSH, TRIAGE) so callers can only pass valid values. The enum
names lowercase cleanly into the API values the Teams endpoint
expects, and reuses the enum that already exists in this package
instead of inventing a new team-scoped one.1 parent 76c5506 commit 8dadafe
1 file changed
Lines changed: 27 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
37 | 59 | | |
38 | 60 | | |
39 | 61 | | |
| |||
527 | 549 | | |
528 | 550 | | |
529 | 551 | | |
530 | | - | |
| 552 | + | |
531 | 553 | | |
532 | 554 | | |
533 | 555 | | |
534 | | - | |
| 556 | + | |
535 | 557 | | |
536 | 558 | | |
537 | | - | |
| 559 | + | |
538 | 560 | | |
539 | 561 | | |
540 | 562 | | |
| |||
543 | 565 | | |
544 | 566 | | |
545 | 567 | | |
546 | | - | |
| 568 | + | |
547 | 569 | | |
548 | 570 | | |
549 | 571 | | |
550 | | - | |
| 572 | + | |
551 | 573 | | |
552 | 574 | | |
553 | 575 | | |
| |||
0 commit comments