Skip to content

Commit 1a3a67a

Browse files
feat(api): manual updates (#25)
1 parent f0156c4 commit 1a3a67a

15 files changed

+488
-192
lines changed

Diff for: .stats.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 111
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-a058dd6f8c83b32adb6f30bae2db8295468b8ffc391342a960ec6f393c50b83e.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-988164042da1361feb3d28364c6f14fee775ceab496b9d79d048141c0fa6da19.yml

Diff for: account.go

+31-31
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,7 @@ func (r *AccountService) ListLoginProvidersAutoPaging(ctx context.Context, param
8787
}
8888

8989
type Account struct {
90-
ID string `json:"id" format:"uuid"`
91-
AvatarURL string `json:"avatarUrl"`
90+
ID string `json:"id,required" format:"uuid"`
9291
// A Timestamp represents a point in time independent of any time zone or local
9392
// calendar, encoded as a count of seconds and fractions of seconds at nanosecond
9493
// resolution. The count is relative to an epoch at UTC midnight on January 1,
@@ -177,17 +176,12 @@ type Account struct {
177176
// Joda Time's
178177
// [`ISODateTimeFormat.dateTime()`](<http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime()>)
179178
// 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"`
188182
// public_email_provider is true if the email for the Account matches a known
189183
// public email provider
190-
PublicEmailProvider bool `json:"publicEmailProvider"`
184+
PublicEmailProvider bool `json:"publicEmailProvider,required"`
191185
// A Timestamp represents a point in time independent of any time zone or local
192186
// calendar, encoded as a count of seconds and fractions of seconds at nanosecond
193187
// resolution. The count is relative to an epoch at UTC midnight on January 1,
@@ -276,22 +270,28 @@ type Account struct {
276270
// Joda Time's
277271
// [`ISODateTimeFormat.dateTime()`](<http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime()>)
278272
// 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:"-"`
281281
}
282282

283283
// accountJSON contains the JSON metadata for the struct [Account]
284284
type accountJSON struct {
285285
ID apijson.Field
286-
AvatarURL apijson.Field
287286
CreatedAt apijson.Field
288287
Email apijson.Field
289-
Joinables apijson.Field
290-
Memberships apijson.Field
291288
Name apijson.Field
292-
OrganizationID apijson.Field
293289
PublicEmailProvider apijson.Field
294290
UpdatedAt apijson.Field
291+
AvatarURL apijson.Field
292+
Joinables apijson.Field
293+
Memberships apijson.Field
294+
OrganizationID apijson.Field
295295
raw string
296296
ExtraFields map[string]apijson.Field
297297
}
@@ -306,16 +306,16 @@ func (r accountJSON) RawJSON() string {
306306

307307
type AccountMembership struct {
308308
// 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"`
310310
// organization_name is the member count of the organization the user is a member
311311
// of
312-
OrganizationMemberCount int64 `json:"organizationMemberCount"`
312+
OrganizationMemberCount int64 `json:"organizationMemberCount,required"`
313313
// 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"`
315315
// 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"`
317317
// user_role is the role the user has in the organization
318-
UserRole shared.OrganizationRole `json:"userRole"`
318+
UserRole shared.OrganizationRole `json:"userRole,required"`
319319
JSON accountMembershipJSON `json:"-"`
320320
}
321321

@@ -341,12 +341,12 @@ func (r accountMembershipJSON) RawJSON() string {
341341

342342
type JoinableOrganization struct {
343343
// 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"`
345345
// organization_member_count is the member count of the organization the user can
346346
// join
347-
OrganizationMemberCount int64 `json:"organizationMemberCount"`
347+
OrganizationMemberCount int64 `json:"organizationMemberCount,required"`
348348
// organization_name is the name of the organization the user can join
349-
OrganizationName string `json:"organizationName"`
349+
OrganizationName string `json:"organizationName,required"`
350350
JSON joinableOrganizationJSON `json:"-"`
351351
}
352352

@@ -370,10 +370,10 @@ func (r joinableOrganizationJSON) RawJSON() string {
370370

371371
type LoginProvider struct {
372372
// login_url is the URL to redirect the browser agent to for login
373-
LoginURL string `json:"loginUrl"`
373+
LoginURL string `json:"loginUrl,required"`
374374
// provider is the provider used by this login method, e.g. "github", "google",
375375
// "custom"
376-
Provider string `json:"provider"`
376+
Provider string `json:"provider,required"`
377377
JSON loginProviderJSON `json:"-"`
378378
}
379379

@@ -394,7 +394,7 @@ func (r loginProviderJSON) RawJSON() string {
394394
}
395395

396396
type AccountGetResponse struct {
397-
Account Account `json:"account"`
397+
Account Account `json:"account,required"`
398398
JSON accountGetResponseJSON `json:"-"`
399399
}
400400

@@ -418,7 +418,7 @@ type AccountDeleteResponse = interface{}
418418

419419
type AccountGetSSOLoginURLResponse struct {
420420
// login_url is the URL to redirect the user to for SSO login
421-
LoginURL string `json:"loginUrl"`
421+
LoginURL string `json:"loginUrl,required"`
422422
JSON accountGetSSOLoginURLResponseJSON `json:"-"`
423423
}
424424

@@ -447,7 +447,7 @@ func (r AccountGetParams) MarshalJSON() (data []byte, err error) {
447447
}
448448

449449
type AccountDeleteParams struct {
450-
AccountID param.Field[string] `json:"accountId" format:"uuid"`
450+
AccountID param.Field[string] `json:"accountId,required" format:"uuid"`
451451
}
452452

453453
func (r AccountDeleteParams) MarshalJSON() (data []byte, err error) {
@@ -456,7 +456,7 @@ func (r AccountDeleteParams) MarshalJSON() (data []byte, err error) {
456456

457457
type AccountGetSSOLoginURLParams struct {
458458
// 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"`
460460
// return_to is the URL the user will be redirected to after login
461461
ReturnTo param.Field[string] `json:"returnTo" format:"uri"`
462462
}

Diff for: account_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func TestAccountGetWithOptionalParams(t *testing.T) {
3838
}
3939
}
4040

41-
func TestAccountDeleteWithOptionalParams(t *testing.T) {
41+
func TestAccountDelete(t *testing.T) {
4242
t.Skip("skipped: tests are disabled for the time being")
4343
baseURL := "http://localhost:4010"
4444
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {

0 commit comments

Comments
 (0)