@@ -87,8 +87,7 @@ func (r *AccountService) ListLoginProvidersAutoPaging(ctx context.Context, param
87
87
}
88
88
89
89
type Account struct {
90
- ID string `json:"id" format:"uuid"`
91
- AvatarURL string `json:"avatarUrl"`
90
+ ID string `json:"id,required" format:"uuid"`
92
91
// A Timestamp represents a point in time independent of any time zone or local
93
92
// calendar, encoded as a count of seconds and fractions of seconds at nanosecond
94
93
// resolution. The count is relative to an epoch at UTC midnight on January 1,
@@ -177,17 +176,12 @@ type Account struct {
177
176
// Joda Time's
178
177
// [`ISODateTimeFormat.dateTime()`](<http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime()>)
179
178
// to obtain a formatter capable of generating timestamps in this format.
180
- CreatedAt time.Time `json:"createdAt" format:"date-time"`
181
- Email string `json:"email"`
182
- Joinables []JoinableOrganization `json:"joinables"`
183
- Memberships []AccountMembership `json:"memberships"`
184
- Name string `json:"name"`
185
- // organization_id is the ID of the organization the account is owned by if it's
186
- // created through custom SSO
187
- OrganizationID string `json:"organizationId,nullable"`
179
+ CreatedAt time.Time `json:"createdAt,required" format:"date-time"`
180
+ Email string `json:"email,required"`
181
+ Name string `json:"name,required"`
188
182
// public_email_provider is true if the email for the Account matches a known
189
183
// public email provider
190
- PublicEmailProvider bool `json:"publicEmailProvider"`
184
+ PublicEmailProvider bool `json:"publicEmailProvider,required "`
191
185
// A Timestamp represents a point in time independent of any time zone or local
192
186
// calendar, encoded as a count of seconds and fractions of seconds at nanosecond
193
187
// resolution. The count is relative to an epoch at UTC midnight on January 1,
@@ -276,22 +270,28 @@ type Account struct {
276
270
// Joda Time's
277
271
// [`ISODateTimeFormat.dateTime()`](<http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime()>)
278
272
// to obtain a formatter capable of generating timestamps in this format.
279
- UpdatedAt time.Time `json:"updatedAt" format:"date-time"`
280
- JSON accountJSON `json:"-"`
273
+ UpdatedAt time.Time `json:"updatedAt,required" format:"date-time"`
274
+ AvatarURL string `json:"avatarUrl"`
275
+ Joinables []JoinableOrganization `json:"joinables"`
276
+ Memberships []AccountMembership `json:"memberships"`
277
+ // organization_id is the ID of the organization the account is owned by if it's
278
+ // created through custom SSO
279
+ OrganizationID string `json:"organizationId,nullable"`
280
+ JSON accountJSON `json:"-"`
281
281
}
282
282
283
283
// accountJSON contains the JSON metadata for the struct [Account]
284
284
type accountJSON struct {
285
285
ID apijson.Field
286
- AvatarURL apijson.Field
287
286
CreatedAt apijson.Field
288
287
Email apijson.Field
289
- Joinables apijson.Field
290
- Memberships apijson.Field
291
288
Name apijson.Field
292
- OrganizationID apijson.Field
293
289
PublicEmailProvider apijson.Field
294
290
UpdatedAt apijson.Field
291
+ AvatarURL apijson.Field
292
+ Joinables apijson.Field
293
+ Memberships apijson.Field
294
+ OrganizationID apijson.Field
295
295
raw string
296
296
ExtraFields map [string ]apijson.Field
297
297
}
@@ -306,16 +306,16 @@ func (r accountJSON) RawJSON() string {
306
306
307
307
type AccountMembership struct {
308
308
// organization_id is the id of the organization the user is a member of
309
- OrganizationID string `json:"organizationId" format:"uuid"`
309
+ OrganizationID string `json:"organizationId,required " format:"uuid"`
310
310
// organization_name is the member count of the organization the user is a member
311
311
// of
312
- OrganizationMemberCount int64 `json:"organizationMemberCount"`
312
+ OrganizationMemberCount int64 `json:"organizationMemberCount,required "`
313
313
// organization_name is the name of the organization the user is a member of
314
- OrganizationName string `json:"organizationName"`
314
+ OrganizationName string `json:"organizationName,required "`
315
315
// user_id is the ID the user has in the organization
316
- UserID string `json:"userId" format:"uuid"`
316
+ UserID string `json:"userId,required " format:"uuid"`
317
317
// user_role is the role the user has in the organization
318
- UserRole shared.OrganizationRole `json:"userRole"`
318
+ UserRole shared.OrganizationRole `json:"userRole,required "`
319
319
JSON accountMembershipJSON `json:"-"`
320
320
}
321
321
@@ -341,12 +341,12 @@ func (r accountMembershipJSON) RawJSON() string {
341
341
342
342
type JoinableOrganization struct {
343
343
// organization_id is the id of the organization the user can join
344
- OrganizationID string `json:"organizationId" format:"uuid"`
344
+ OrganizationID string `json:"organizationId,required " format:"uuid"`
345
345
// organization_member_count is the member count of the organization the user can
346
346
// join
347
- OrganizationMemberCount int64 `json:"organizationMemberCount"`
347
+ OrganizationMemberCount int64 `json:"organizationMemberCount,required "`
348
348
// organization_name is the name of the organization the user can join
349
- OrganizationName string `json:"organizationName"`
349
+ OrganizationName string `json:"organizationName,required "`
350
350
JSON joinableOrganizationJSON `json:"-"`
351
351
}
352
352
@@ -370,10 +370,10 @@ func (r joinableOrganizationJSON) RawJSON() string {
370
370
371
371
type LoginProvider struct {
372
372
// login_url is the URL to redirect the browser agent to for login
373
- LoginURL string `json:"loginUrl"`
373
+ LoginURL string `json:"loginUrl,required "`
374
374
// provider is the provider used by this login method, e.g. "github", "google",
375
375
// "custom"
376
- Provider string `json:"provider"`
376
+ Provider string `json:"provider,required "`
377
377
JSON loginProviderJSON `json:"-"`
378
378
}
379
379
@@ -394,7 +394,7 @@ func (r loginProviderJSON) RawJSON() string {
394
394
}
395
395
396
396
type AccountGetResponse struct {
397
- Account Account `json:"account"`
397
+ Account Account `json:"account,required "`
398
398
JSON accountGetResponseJSON `json:"-"`
399
399
}
400
400
@@ -418,7 +418,7 @@ type AccountDeleteResponse = interface{}
418
418
419
419
type AccountGetSSOLoginURLResponse struct {
420
420
// login_url is the URL to redirect the user to for SSO login
421
- LoginURL string `json:"loginUrl"`
421
+ LoginURL string `json:"loginUrl,required "`
422
422
JSON accountGetSSOLoginURLResponseJSON `json:"-"`
423
423
}
424
424
@@ -447,7 +447,7 @@ func (r AccountGetParams) MarshalJSON() (data []byte, err error) {
447
447
}
448
448
449
449
type AccountDeleteParams struct {
450
- AccountID param.Field [string ] `json:"accountId" format:"uuid"`
450
+ AccountID param.Field [string ] `json:"accountId,required " format:"uuid"`
451
451
}
452
452
453
453
func (r AccountDeleteParams ) MarshalJSON () (data []byte , err error ) {
@@ -456,7 +456,7 @@ func (r AccountDeleteParams) MarshalJSON() (data []byte, err error) {
456
456
457
457
type AccountGetSSOLoginURLParams struct {
458
458
// email is the email the user wants to login with
459
- Email param.Field [string ] `json:"email" format:"email"`
459
+ Email param.Field [string ] `json:"email,required " format:"email"`
460
460
// return_to is the URL the user will be redirected to after login
461
461
ReturnTo param.Field [string ] `json:"returnTo" format:"uri"`
462
462
}
0 commit comments