Skip to content

feat(api): manual updates #25

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 111
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-a058dd6f8c83b32adb6f30bae2db8295468b8ffc391342a960ec6f393c50b83e.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-988164042da1361feb3d28364c6f14fee775ceab496b9d79d048141c0fa6da19.yml
62 changes: 31 additions & 31 deletions account.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,7 @@ func (r *AccountService) ListLoginProvidersAutoPaging(ctx context.Context, param
}

type Account struct {
ID string `json:"id" format:"uuid"`
AvatarURL string `json:"avatarUrl"`
ID string `json:"id,required" format:"uuid"`
// A Timestamp represents a point in time independent of any time zone or local
// calendar, encoded as a count of seconds and fractions of seconds at nanosecond
// resolution. The count is relative to an epoch at UTC midnight on January 1,
Expand Down Expand Up @@ -177,17 +176,12 @@ type Account struct {
// Joda Time's
// [`ISODateTimeFormat.dateTime()`](<http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime()>)
// to obtain a formatter capable of generating timestamps in this format.
CreatedAt time.Time `json:"createdAt" format:"date-time"`
Email string `json:"email"`
Joinables []JoinableOrganization `json:"joinables"`
Memberships []AccountMembership `json:"memberships"`
Name string `json:"name"`
// organization_id is the ID of the organization the account is owned by if it's
// created through custom SSO
OrganizationID string `json:"organizationId,nullable"`
CreatedAt time.Time `json:"createdAt,required" format:"date-time"`
Email string `json:"email,required"`
Name string `json:"name,required"`
// public_email_provider is true if the email for the Account matches a known
// public email provider
PublicEmailProvider bool `json:"publicEmailProvider"`
PublicEmailProvider bool `json:"publicEmailProvider,required"`
// A Timestamp represents a point in time independent of any time zone or local
// calendar, encoded as a count of seconds and fractions of seconds at nanosecond
// resolution. The count is relative to an epoch at UTC midnight on January 1,
Expand Down Expand Up @@ -276,22 +270,28 @@ type Account struct {
// Joda Time's
// [`ISODateTimeFormat.dateTime()`](<http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime()>)
// to obtain a formatter capable of generating timestamps in this format.
UpdatedAt time.Time `json:"updatedAt" format:"date-time"`
JSON accountJSON `json:"-"`
UpdatedAt time.Time `json:"updatedAt,required" format:"date-time"`
AvatarURL string `json:"avatarUrl"`
Joinables []JoinableOrganization `json:"joinables"`
Memberships []AccountMembership `json:"memberships"`
// organization_id is the ID of the organization the account is owned by if it's
// created through custom SSO
OrganizationID string `json:"organizationId,nullable"`
JSON accountJSON `json:"-"`
}

// accountJSON contains the JSON metadata for the struct [Account]
type accountJSON struct {
ID apijson.Field
AvatarURL apijson.Field
CreatedAt apijson.Field
Email apijson.Field
Joinables apijson.Field
Memberships apijson.Field
Name apijson.Field
OrganizationID apijson.Field
PublicEmailProvider apijson.Field
UpdatedAt apijson.Field
AvatarURL apijson.Field
Joinables apijson.Field
Memberships apijson.Field
OrganizationID apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
Expand All @@ -306,16 +306,16 @@ func (r accountJSON) RawJSON() string {

type AccountMembership struct {
// organization_id is the id of the organization the user is a member of
OrganizationID string `json:"organizationId" format:"uuid"`
OrganizationID string `json:"organizationId,required" format:"uuid"`
// organization_name is the member count of the organization the user is a member
// of
OrganizationMemberCount int64 `json:"organizationMemberCount"`
OrganizationMemberCount int64 `json:"organizationMemberCount,required"`
// organization_name is the name of the organization the user is a member of
OrganizationName string `json:"organizationName"`
OrganizationName string `json:"organizationName,required"`
// user_id is the ID the user has in the organization
UserID string `json:"userId" format:"uuid"`
UserID string `json:"userId,required" format:"uuid"`
// user_role is the role the user has in the organization
UserRole shared.OrganizationRole `json:"userRole"`
UserRole shared.OrganizationRole `json:"userRole,required"`
JSON accountMembershipJSON `json:"-"`
}

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

type JoinableOrganization struct {
// organization_id is the id of the organization the user can join
OrganizationID string `json:"organizationId" format:"uuid"`
OrganizationID string `json:"organizationId,required" format:"uuid"`
// organization_member_count is the member count of the organization the user can
// join
OrganizationMemberCount int64 `json:"organizationMemberCount"`
OrganizationMemberCount int64 `json:"organizationMemberCount,required"`
// organization_name is the name of the organization the user can join
OrganizationName string `json:"organizationName"`
OrganizationName string `json:"organizationName,required"`
JSON joinableOrganizationJSON `json:"-"`
}

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

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

Expand All @@ -394,7 +394,7 @@ func (r loginProviderJSON) RawJSON() string {
}

type AccountGetResponse struct {
Account Account `json:"account"`
Account Account `json:"account,required"`
JSON accountGetResponseJSON `json:"-"`
}

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

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

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

type AccountDeleteParams struct {
AccountID param.Field[string] `json:"accountId" format:"uuid"`
AccountID param.Field[string] `json:"accountId,required" format:"uuid"`
}

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

type AccountGetSSOLoginURLParams struct {
// email is the email the user wants to login with
Email param.Field[string] `json:"email" format:"email"`
Email param.Field[string] `json:"email,required" format:"email"`
// return_to is the URL the user will be redirected to after login
ReturnTo param.Field[string] `json:"returnTo" format:"uri"`
}
Expand Down
2 changes: 1 addition & 1 deletion account_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func TestAccountGetWithOptionalParams(t *testing.T) {
}
}

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