-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtype.go
More file actions
766 lines (655 loc) · 23.2 KB
/
type.go
File metadata and controls
766 lines (655 loc) · 23.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
// Copyright The Linux Foundation and each contributor to LFX.
// SPDX-License-Identifier: MIT
package design
import (
"goa.design/goa/v3/dsl"
)
// CommitteeBase is the DSL type for a committee base.
var CommitteeBase = dsl.Type("committee-base", func() {
dsl.Description("A base representation of LFX committees without sub-objects.")
CommitteeBaseAttributes()
})
// CommitteeBaseAttributes is the DSL attributes for a committee base.
func CommitteeBaseAttributes() {
ProjectUIDAttribute()
NameAttribute()
CategoryAttribute()
DescriptionAttribute()
WebsiteAttribute()
EnableVotingAttribute()
SSOGroupEnabledAttribute()
RequiresReviewAttribute()
PublicAttribute()
CalendarAttribute()
DisplayNameAttribute()
ParentCommitteeUIDAttribute()
}
// CommitteeSettings is the DSL type for a committee settings.
var CommitteeSettings = dsl.Type("committee-settings", func() {
dsl.Description("A representation of LF Committee settings.")
CommitteeSettingsAttributes()
})
// CommitteeSettingsAttributes is the DSL attributes for a committee settings.
func CommitteeSettingsAttributes() {
BusinessEmailRequiredAttribute()
LastReviewedAtAttribute()
LastReviewedByAttribute()
MemberVisibilityAttribute()
ShowMeetingAttendeesAttribute()
}
// CommitteeFull is the DSL type for a committee full.
var CommitteeFull = dsl.Type("committee-full", func() {
dsl.Description("A full representation of LFX committees with sub-objects.")
CommitteeBaseAttributes()
CommitteeSettingsAttributes()
WritersAttribute()
AuditorsAttribute()
})
var CommitteeBaseWithReadonlyAttributes = dsl.Type("committee-base-with-readonly-attributes", func() {
dsl.Description("A base representation of LFX committees with readonly attributes.")
CommitteeUIDAttribute()
CommitteeBaseAttributes()
ProjectNameAttribute()
SSOGroupNameAttribute()
TotalMembersAttribute()
TotalVotingReposAttribute()
})
var CommitteeFullWithReadonlyAttributes = dsl.Type("committee-full-with-readonly-attributes", func() {
dsl.Description("A complete representation of LFX committees with base, settings and readonly attributes.")
CommitteeUIDAttribute()
CommitteeBaseAttributes()
SSOGroupNameAttribute()
TotalMembersAttribute()
TotalVotingReposAttribute()
// Include settings attributes for complete representation
CommitteeSettingsAttributes()
WritersAttribute()
AuditorsAttribute()
})
var CommitteeSettingsWithReadonlyAttributes = dsl.Type("committee-settings-with-readonly-attributes", func() {
dsl.Description("A representation of LF Committee settings with readonly attributes.")
CommitteeUIDAttribute()
CommitteeSettingsAttributes()
CreatedAtAttribute()
UpdatedAtAttribute()
})
// CommitteeUIDAttribute is the DSL attribute for committee UID.
func CommitteeUIDAttribute() {
dsl.Attribute("uid", dsl.String, "Committee UID -- v2 uid, not related to v1 id directly", func() {
// Read-only attribute
dsl.Example("7cad5a8d-19d0-41a4-81a6-043453daf9ee")
dsl.Format(dsl.FormatUUID)
})
}
// ProjectUIDAttribute is the DSL attribute for project UID.
func ProjectUIDAttribute() {
dsl.Attribute("project_uid", dsl.String, "Project UID this committee belongs to -- v2 uid, not related to v1 id directly", func() {
// Read-only attribute
dsl.Example("7cad5a8d-19d0-41a4-81a6-043453daf9ee")
dsl.Format(dsl.FormatUUID)
})
}
// ProjectNameAttribute is the DSL attribute for project name.
func ProjectNameAttribute() {
dsl.Attribute("project_name", dsl.String, "The name of the project this committee belongs to", func() {
dsl.MaxLength(100)
dsl.Example("Linux Foundation Project")
})
}
// NameAttribute is the DSL attribute for committee name.
func NameAttribute() {
dsl.Attribute("name", dsl.String, "The name of the committee", func() {
dsl.MaxLength(100)
dsl.Example("Technical Steering Committee")
})
}
// CategoryAttribute is the DSL attribute for committee category.
func CategoryAttribute() {
dsl.Attribute("category", dsl.String, "The category of the committee", func() {
dsl.Enum(
"Ambassador",
"Board",
"Code of Conduct",
"Committers",
"Expert Group",
"Finance Committee",
"Government Advisory Council",
"Legal Committee",
"Maintainers",
"Marketing Committee/Sub Committee",
"Marketing Mailing List",
"Marketing Oversight Committee/Marketing Advisory Committee",
"Other",
"Product Security",
"Special Interest Group",
"Technical Advisory Committee",
"Technical Mailing List",
"Technical Oversight Committee",
"Technical Steering Committee",
"Working Group",
)
dsl.Example("Technical Steering Committee")
})
}
// DescriptionAttribute is the DSL attribute for committee description.
func DescriptionAttribute() {
dsl.Attribute("description", dsl.String, "The description of the committee", func() {
dsl.MaxLength(2000)
dsl.Example("Main technical oversight committee for the project")
})
}
// WebsiteAttribute is the DSL attribute for committee website.
func WebsiteAttribute() {
dsl.Attribute("website", dsl.String, "The website URL of the committee", func() {
dsl.Format(dsl.FormatURI)
dsl.Pattern(`^(https?://)?[^\s/$.?#].[^\s]*$`)
dsl.Example("https://committee.example.org")
})
}
// EnableVotingAttribute is the DSL attribute for enabling voting.
func EnableVotingAttribute() {
dsl.Attribute("enable_voting", dsl.Boolean, "Whether voting is enabled for this committee", func() {
dsl.Default(false)
dsl.Example(true)
})
}
// BusinessEmailRequiredAttribute is the DSL attribute for business email requirement.
func BusinessEmailRequiredAttribute() {
dsl.Attribute("business_email_required", dsl.Boolean, "Whether business email is required for committee members", func() {
dsl.Default(false)
dsl.Example(false)
})
}
// SSOGroupEnabledAttribute is the DSL attribute for SSO group enablement.
func SSOGroupEnabledAttribute() {
dsl.Attribute("sso_group_enabled", dsl.Boolean, "Whether SSO group integration is enabled", func() {
dsl.Default(false)
dsl.Example(true)
})
}
// SSOGroupNameAttribute is the DSL attribute for SSO group name.
func SSOGroupNameAttribute() {
dsl.Attribute("sso_group_name", dsl.String, "The name of the SSO group - read-only", func() {
dsl.Example("lfx-committee-group")
})
}
// RequiresReviewAttribute is the DSL attribute for committee review requirement.
func RequiresReviewAttribute() {
dsl.Attribute("requires_review", dsl.Boolean, "Whether this committee is expected to be reviewed", func() {
dsl.Default(false)
dsl.Example(true)
})
}
// PublicAttribute is the DSL attribute for public visibility.
func PublicAttribute() {
dsl.Attribute("public", dsl.Boolean, "General committee visibility/access permissions", func() {
dsl.Default(false)
dsl.Example(true)
})
}
// CalendarAttribute is the DSL attribute for calendar settings.
func CalendarAttribute() {
dsl.Attribute("calendar", func() {
dsl.Description("Settings related to the committee calendar")
CalendarPublicAttribute()
})
}
// CalendarPublicAttribute is the DSL attribute for calendar public visibility.
func CalendarPublicAttribute() {
dsl.Attribute("public", dsl.Boolean, "Whether the committee calendar is publicly visible", func() {
dsl.Default(false)
dsl.Example(true)
})
}
// LastReviewedAtAttribute is the DSL attribute for last review timestamp.
func LastReviewedAtAttribute() {
dsl.Attribute("last_reviewed_at", dsl.String, "The timestamp when the committee was last reviewed in RFC3339 format", func() {
dsl.Format(dsl.FormatDateTime)
dsl.Example("2025-08-04T09:00:00Z")
})
}
// LastReviewedByAttribute is the DSL attribute for last review user.
func LastReviewedByAttribute() {
dsl.Attribute("last_reviewed_by", dsl.String, "The user ID who last reviewed this committee", func() {
dsl.Example("user_id_12345")
})
}
// DisplayNameAttribute is the DSL attribute for display name.
func DisplayNameAttribute() {
dsl.Attribute("display_name", dsl.String, "The display name of the committee", func() {
dsl.MaxLength(100)
dsl.Example("TSC Committee Calendar")
})
}
// ParentCommitteeUIDAttribute is the DSL attribute for parent committee UID.
func ParentCommitteeUIDAttribute() {
dsl.Attribute("parent_uid", dsl.String, "The UID of the parent committee -- v2 uid, not related to v1 id directly, should be empty if there is none", func() {
dsl.Format(dsl.FormatUUID)
dsl.Example("90b147f2-7cdd-157a-a2f4-9d4a567123fc")
})
}
// TotalMembersAttribute is the DSL attribute for total members count.
func TotalMembersAttribute() {
dsl.Attribute("total_members", dsl.Int, "The total number of members in this committee", func() {
dsl.Minimum(0)
dsl.Example(15)
})
}
// TotalVotingReposAttribute is the DSL attribute for total voting repositories count.
func TotalVotingReposAttribute() {
dsl.Attribute("total_voting_repos", dsl.Int, "The total number of repositories with voting permissions for this committee", func() {
dsl.Minimum(0)
dsl.Example(3)
})
}
// WritersAttribute is the DSL attribute for committee writers.
func WritersAttribute() {
dsl.Attribute("writers", dsl.ArrayOf(dsl.String), "Manager user IDs who can edit/modify this committee", func() {
dsl.Example([]string{"manager_user_id1", "manager_user_id2"})
})
}
// VersionAttribute is the DSL attribute for API version.
func VersionAttribute() {
dsl.Attribute("version", dsl.String, "Version of the API", func() {
dsl.Example("1")
dsl.Enum("1")
})
}
// ETagAttribute is the DSL attribute for ETag header.
func ETagAttribute() {
dsl.Attribute("etag", dsl.String, "ETag header value", func() {
dsl.Example("123")
})
}
// IfMatchAttribute is the DSL attribute for If-Match header (for conditional requests).
func IfMatchAttribute() {
dsl.Attribute("if_match", dsl.String, "If-Match header value for conditional requests", func() {
dsl.Example("123")
})
}
// BearerTokenAttribute is the DSL attribute for bearer token.
func BearerTokenAttribute() {
dsl.Token("bearer_token", dsl.String, func() {
dsl.Description("JWT token issued by Heimdall")
dsl.Example("eyJhbGci...")
})
}
// XSyncAttribute is the DSL attribute for X-Sync header (for synchronous/asynchronous operations).
func XSyncAttribute() {
dsl.Attribute("x_sync", dsl.Boolean, "Determines if the operation should be synchronous (true) or asynchronous (false, default)", func() {
dsl.Default(false)
dsl.Example(true)
})
}
// CreatedAtAttribute is the DSL attribute for creation timestamp.
func CreatedAtAttribute() {
dsl.Attribute("created_at", dsl.String, "The timestamp when the resource was created (read-only)", func() {
dsl.Format(dsl.FormatDateTime)
dsl.Example("2023-01-15T10:30:00Z")
})
}
// UpdatedAtAttribute is the DSL attribute for update timestamp.
func UpdatedAtAttribute() {
dsl.Attribute("updated_at", dsl.String, "The timestamp when the resource was last updated (read-only)", func() {
dsl.Format(dsl.FormatDateTime)
dsl.Example("2023-06-20T14:45:30Z")
})
}
// LastAuditedByAttribute is the DSL attribute for last audited by user.
func LastAuditedByAttribute() {
dsl.Attribute("last_audited_by", dsl.String, "The user ID who last audited the committee", func() {
dsl.Example("user_id_12345")
})
}
// LastAuditedTimeAttribute is the DSL attribute for last audit timestamp.
func LastAuditedTimeAttribute() {
dsl.Attribute("last_audited_time", dsl.String, "The timestamp when the committee was last audited", func() {
dsl.Format(dsl.FormatDateTime)
dsl.Example("2023-05-10T09:15:00Z")
})
}
// AuditorsAttribute is the DSL attribute for committee auditors.
func AuditorsAttribute() {
dsl.Attribute("auditors", dsl.ArrayOf(dsl.String), "Auditor user IDs who can audit this committee", func() {
dsl.Example([]string{"auditor_user_id1", "auditor_user_id2"})
})
}
// Committee Member Types and Attributes
// CommitteeMemberBase is the DSL type for a committee member base.
var CommitteeMemberBase = dsl.Type("committee-member-base", func() {
dsl.Description("A base representation of committee members.")
CommitteeMemberBaseAttributes()
})
// CommitteeMemberSensitive is the DSL type for a committee member sensitive information.
var CommitteeMemberSensitive = dsl.Type("committee-member-sensitive", func() {
dsl.Description("Sensitive information of a committee member.")
CommitteeMemberSensitiveAttributes()
})
// CommitteeMemberBaseAttributes defines the base attributes for a committee member.
func CommitteeMemberBaseAttributes() {
UsernameAttribute()
FirstNameAttribute()
LastNameAttribute()
JobTitleAttribute()
LinkedInProfileAttribute()
RoleInfoAttributes()
AppointedByAttribute()
StatusAttribute()
VotingInfoAttributes()
OrganizationInfoAttributes()
}
// CommitteeMemberSensitiveAttributes defines the sensitive attributes for a committee member.
func CommitteeMemberSensitiveAttributes() {
EmailAttribute()
}
// CommitteeMemberFull is the DSL type for a complete committee member.
var CommitteeMemberFull = dsl.Type("committee-member-full", func() {
dsl.Description("A complete representation of committee members with all attributes.")
CommitteeMemberBaseAttributes()
CommitteeMemberSensitiveAttributes()
})
// CommitteeMemberBasicWithReadonlyAttributes is the DSL type for a basic committee member with readonly attributes.
var CommitteeMemberBasicWithReadonlyAttributes = dsl.Type("committee-member-basic-with-readonly-attributes", func() {
dsl.Description("A basic representation of committee members with readonly attributes.")
CommitteeMemberUIDAttribute()
CommitteeUIDMemberAttribute()
CommitteeNameMemberAttribute()
CommitteeCategoryMemberAttribute()
CommitteeMemberBaseAttributes()
CreatedAtAttribute()
UpdatedAtAttribute()
})
// CommitteeMemberFullWithReadonlyAttributes is the DSL type for a complete committee member with readonly attributes.
var CommitteeMemberFullWithReadonlyAttributes = dsl.Type("committee-member-full-with-readonly-attributes", func() {
dsl.Description("A complete representation of committee members with readonly attributes.")
CommitteeMemberUIDAttribute()
CommitteeUIDMemberAttribute()
CommitteeNameMemberAttribute()
CommitteeCategoryMemberAttribute()
CommitteeMemberBaseAttributes()
CommitteeMemberSensitiveAttributes()
CreatedAtAttribute()
UpdatedAtAttribute()
})
// CommitteeMemberCreateAttributes defines attributes for creating a committee member.
func CommitteeMemberCreateAttributes() {
CommitteeMemberBaseAttributes()
CommitteeMemberSensitiveAttributes()
}
// CommitteeMemberUpdateAttributes defines attributes for updating a committee member.
func CommitteeMemberUpdateAttributes() {
CommitteeMemberBaseAttributes()
CommitteeMemberSensitiveAttributes()
}
// Organization Information Attributes
func OrganizationInfoAttributes() {
dsl.Attribute("organization", func() {
dsl.Description("Organization information for the committee member")
OrganizationIDAttribute()
OrganizationNameAttribute()
OrganizationWebsiteAttribute()
})
}
// Role Information Attributes
func RoleInfoAttributes() {
dsl.Attribute("role", func() {
dsl.Description("Committee role information")
RoleNameAttribute()
RoleStartDateAttribute()
RoleEndDateAttribute()
})
}
// Voting Information Attributes
func VotingInfoAttributes() {
dsl.Attribute("voting", func() {
dsl.Description("Voting information for the committee member")
VotingStatusAttribute()
VotingStartDateAttribute()
VotingEndDateAttribute()
})
}
// Committee Member Specific Attributes
// CommitteeMemberUIDAttribute is the DSL attribute for committee member UID.
func CommitteeMemberUIDAttribute() {
dsl.Attribute("uid", dsl.String, "Committee member UID -- v2 uid, not related to v1 id directly", func() {
dsl.Example("2200b646-fbb2-4de7-ad80-fd195a874baf")
dsl.Format(dsl.FormatUUID)
})
}
// CommitteeUIDAttribute is the DSL attribute for committee UID.
func CommitteeUIDMemberAttribute() {
dsl.Attribute("committee_uid", dsl.String, "Committee UID -- v2 uid, not related to v1 id directly", func() {
dsl.Example("7cad5a8d-19d0-41a4-81a6-043453daf9ee")
dsl.Format(dsl.FormatUUID)
})
}
// CommitteeNameMemberAttribute is the DSL attribute for committee name in member context.
func CommitteeNameMemberAttribute() {
dsl.Attribute("committee_name", dsl.String, "The name of the committee this member belongs to", func() {
dsl.MaxLength(100)
dsl.Example("Technical Steering Committee")
})
}
// CommitteeCategoryMemberAttribute is the DSL attribute for committee category in member context.
func CommitteeCategoryMemberAttribute() {
dsl.Attribute("committee_category", dsl.String, "The category of the committee this member belongs to", func() {
dsl.MaxLength(100)
dsl.Example("Board")
})
}
// MemberUIDAttribute is the DSL attribute for member UID in URL paths.
func MemberUIDAttribute() {
dsl.Attribute("member_uid", dsl.String, "Committee member UID -- v2 uid, not related to v1 id directly", func() {
dsl.Example("2200b646-fbb2-4de7-ad80-fd195a874baf")
dsl.Format(dsl.FormatUUID)
})
}
// UsernameAttribute is the DSL attribute for username.
func UsernameAttribute() {
dsl.Attribute("username", dsl.String, "User's LF ID", func() {
dsl.MaxLength(100)
dsl.Example("user123")
})
}
// EmailAttribute is the DSL attribute for email.
func EmailAttribute() {
dsl.Attribute("email", dsl.String, "Primary email address", func() {
dsl.Format(dsl.FormatEmail)
dsl.Example("user@example.com")
})
}
// FirstNameAttribute is the DSL attribute for first name.
func FirstNameAttribute() {
dsl.Attribute("first_name", dsl.String, "First name", func() {
dsl.MaxLength(100)
dsl.Example("John")
})
}
// LastNameAttribute is the DSL attribute for last name.
func LastNameAttribute() {
dsl.Attribute("last_name", dsl.String, "Last name", func() {
dsl.MaxLength(100)
dsl.Example("Doe")
})
}
// JobTitleAttribute is the DSL attribute for job title.
func JobTitleAttribute() {
dsl.Attribute("job_title", dsl.String, "Job title at organization", func() {
dsl.MaxLength(200)
dsl.Example("Chief Technology Officer")
})
}
// LinkedInProfileAttribute is the DSL attribute for LinkedIn profile URL.
func LinkedInProfileAttribute() {
dsl.Attribute("linkedin_profile", dsl.String, "LinkedIn profile URL", func() {
dsl.Format(dsl.FormatURI)
dsl.Pattern(`^(https?://)?([a-z]{2,3}\.)?linkedin\.com/.*$`)
dsl.Example("https://www.linkedin.com/in/johndoe")
})
}
// RoleNameAttribute is the DSL attribute for committee role name.
func RoleNameAttribute() {
dsl.Attribute("name", dsl.String, "Committee role name", func() {
dsl.Enum(
"Chair",
"Counsel",
"Developer Seat",
"TAC/TOC Representative",
"Director",
"Lead",
"None",
"Secretary",
"Treasurer",
"Vice Chair",
"LF Staff",
)
dsl.Default("None")
dsl.Example("Chair")
})
}
// RoleStartDateAttribute is the DSL attribute for role start date.
func RoleStartDateAttribute() {
dsl.Attribute("start_date", dsl.String, "Role start date", func() {
dsl.Format(dsl.FormatDate)
dsl.Example("2023-01-01")
})
}
// RoleEndDateAttribute is the DSL attribute for role end date.
func RoleEndDateAttribute() {
dsl.Attribute("end_date", dsl.String, "Role end date", func() {
dsl.Format(dsl.FormatDate)
dsl.Example("2024-12-31")
})
}
// AppointedByAttribute is the DSL attribute for appointed by.
func AppointedByAttribute() {
dsl.Attribute("appointed_by", dsl.String, "How the member was appointed", func() {
dsl.Enum(
"Community",
"Membership Entitlement",
"Vote of End User Member Class",
"Vote of TSC Committee",
"Vote of TAC Committee",
"Vote of Academic Member Class",
"Vote of Lab Member Class",
"Vote of Marketing Committee",
"Vote of Governing Board",
"Vote of General Member Class",
"Vote of End User Committee",
"Vote of TOC Committee",
"Vote of Gold Member Class",
"Vote of Silver Member Class",
"Vote of Strategic Membership Class",
"None",
)
dsl.Default("None")
dsl.Example("Community")
})
}
// StatusAttribute is the DSL attribute for member status.
func StatusAttribute() {
dsl.Attribute("status", dsl.String, "Member status", func() {
dsl.Enum("Active", "Inactive")
dsl.Default("Active")
dsl.Example("Active")
})
}
// VotingStatusAttribute is the DSL attribute for voting status.
func VotingStatusAttribute() {
dsl.Attribute("status", dsl.String, "Voting status", func() {
dsl.Enum(
"Alternate Voting Rep",
"Observer",
"Voting Rep",
"Emeritus",
"None",
)
dsl.Default("None")
dsl.Example("Voting Rep")
})
}
// VotingStartDateAttribute is the DSL attribute for voting start date.
func VotingStartDateAttribute() {
dsl.Attribute("start_date", dsl.String, "Voting start date", func() {
dsl.Format(dsl.FormatDate)
dsl.Example("2023-01-01")
})
}
// VotingEndDateAttribute is the DSL attribute for voting end date.
func VotingEndDateAttribute() {
dsl.Attribute("end_date", dsl.String, "Voting end date", func() {
dsl.Format(dsl.FormatDate)
dsl.Example("2024-12-31")
})
}
// Organization Specific Attributes
// OrganizationNameAttribute is the DSL attribute for organization name.
func OrganizationNameAttribute() {
dsl.Attribute("name", dsl.String, "Organization name", func() {
dsl.MaxLength(200)
dsl.Example("The Linux Foundation")
})
}
// OrganizationWebsiteAttribute is the DSL attribute for organization website.
func OrganizationWebsiteAttribute() {
dsl.Attribute("website", dsl.String, "Organization website URL", func() {
dsl.Format(dsl.FormatURI)
dsl.Example("https://linuxfoundation.org")
})
}
// OrganizationIDAttribute is the DSL attribute for organization ID.
func OrganizationIDAttribute() {
dsl.Attribute("id", dsl.String, "Organization ID", func() {
dsl.Example("org-123456")
})
}
// MemberVisibilityAttribute is the DSL attribute for the member visibility setting
func MemberVisibilityAttribute() {
dsl.Attribute("member_visibility", dsl.String, "Dertermines the visibility level of members profiles to other members of the same committee", func() {
dsl.Enum("hidden", "basic_profile")
dsl.Default("hidden")
dsl.Example("hidden")
})
}
func ShowMeetingAttendeesAttribute() {
dsl.Attribute("show_meeting_attendees", dsl.Boolean, "Determines the default show_meeting_attendees setting on meetings this committee is connected to", func() {
dsl.Default(false)
dsl.Example(false)
})
}
// Errors
// BadRequestError is the DSL type for a bad request error.
var BadRequestError = dsl.Type("bad-request-error", func() {
dsl.Attribute("message", dsl.String, "Error message", func() {
dsl.Example("The request was invalid.")
})
dsl.Required("message")
})
// NotFoundError is the DSL type for a not found error.
var NotFoundError = dsl.Type("not-found-error", func() {
dsl.Attribute("message", dsl.String, "Error message", func() {
dsl.Example("The resource was not found.")
})
dsl.Required("message")
})
// ConflictError is the DSL type for a conflict error.
var ConflictError = dsl.Type("conflict-error", func() {
dsl.Attribute("message", dsl.String, "Error message", func() {
dsl.Example("The resource already exists.")
})
dsl.Required("message")
})
// InternalServerError is the DSL type for an internal server error.
var InternalServerError = dsl.Type("internal-server-error", func() {
dsl.Attribute("message", dsl.String, "Error message", func() {
dsl.Example("An internal server error occurred.")
})
dsl.Required("message")
})
// ServiceUnavailableError is the DSL type for a service unavailable error.
var ServiceUnavailableError = dsl.Type("service-unavailable-error", func() {
dsl.Attribute("message", dsl.String, "Error message", func() {
dsl.Example("The service is unavailable.")
})
dsl.Required("message")
})