Skip to content

Commit ccca7e5

Browse files
feat(api): manual updates
1 parent 60b3e5e commit ccca7e5

28 files changed

+769
-241
lines changed

.devcontainer/Dockerfile

Lines changed: 0 additions & 22 deletions
This file was deleted.

.devcontainer/devcontainer.json

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,7 @@
11
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
22
// README at: https://github.com/devcontainers/templates/tree/main/src/debian
33
{
4-
"name": "Debian",
5-
"build": {
6-
"dockerfile": "Dockerfile"
7-
}
8-
9-
// Features to add to the dev container. More info: https://containers.dev/features.
10-
// "features": {},
11-
12-
// Use 'forwardPorts' to make a list of ports inside the container available locally.
13-
// "forwardPorts": [],
14-
15-
// Configure tool-specific properties.
16-
// "customizations": {},
17-
18-
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
19-
// "remoteUser": "root"
4+
"name": "Development",
5+
"image": "mcr.microsoft.com/devcontainers/go:1.23-bookworm",
6+
"postCreateCommand": "go mod tidy"
207
}

.stats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 116
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-2e6ddfc9da00e33fcf13baf0b67012b97f051fa986658ff114fde989e56caa94.yml
3-
openapi_spec_hash: 5af02ea2008312d609394e548756e761
4-
config_hash: 60929489bdc1eaf979e7ef74fdd17b94
1+
configured_endpoints: 119
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-c850a6432597255fc1b788ba21a0494162e639f41dd80c0f9d07def239d31865.yml
3+
openapi_spec_hash: fba3f62e51d3ba39eea280abe29f39f1
4+
config_hash: 8e3b8fba844b78950ad4a13b75b7fffc

SECURITY.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ before making any information public.
1616
## Reporting Non-SDK Related Security Issues
1717

1818
If you encounter security issues that are not directly related to SDKs but pertain to the services
19-
or products provided by Gitpod please follow the respective company's security reporting guidelines.
19+
or products provided by Gitpod, please follow the respective company's security reporting guidelines.
2020

2121
### Gitpod Terms and Policies
2222

23-
Please contact [email protected] for any questions or concerns regarding security of our services.
23+
Please contact [email protected] for any questions or concerns regarding the security of our services.
2424

2525
---
2626

account.go

Lines changed: 69 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,30 @@ func (r *AccountService) GetSSOLoginURL(ctx context.Context, body AccountGetSSOL
120120
return
121121
}
122122

123+
// Lists organizations that the currently authenticated account can join.
124+
//
125+
// Use this method to:
126+
//
127+
// - Discover organizations associated with the account's email domain.
128+
// - Allow users to join existing organizations.
129+
// - Display potential organizations during onboarding.
130+
//
131+
// ### Examples
132+
//
133+
// - List joinable organizations:
134+
//
135+
// Retrieves a list of organizations the account can join.
136+
//
137+
// ```yaml
138+
// {}
139+
// ```
140+
func (r *AccountService) ListJoinableOrganizations(ctx context.Context, params AccountListJoinableOrganizationsParams, opts ...option.RequestOption) (res *AccountListJoinableOrganizationsResponse, err error) {
141+
opts = append(r.Options[:], opts...)
142+
path := "gitpod.v1.AccountService/ListJoinableOrganizations"
143+
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &res, opts...)
144+
return
145+
}
146+
123147
// Lists available login providers with optional filtering.
124148
//
125149
// Use this method to:
@@ -380,8 +404,11 @@ type Account struct {
380404
// Joda Time's
381405
// [`ISODateTimeFormat.dateTime()`](<http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime()>)
382406
// to obtain a formatter capable of generating timestamps in this format.
383-
UpdatedAt time.Time `json:"updatedAt,required" format:"date-time"`
384-
AvatarURL string `json:"avatarUrl"`
407+
UpdatedAt time.Time `json:"updatedAt,required" format:"date-time"`
408+
AvatarURL string `json:"avatarUrl"`
409+
// joinables is deprecated. Use ListJoinableOrganizations instead.
410+
//
411+
// Deprecated: deprecated
385412
Joinables []JoinableOrganization `json:"joinables"`
386413
Memberships []AccountMembership `json:"memberships"`
387414
// organization_id is the ID of the organization the account is owned by if it's
@@ -552,6 +579,27 @@ func (r accountGetSSOLoginURLResponseJSON) RawJSON() string {
552579
return r.raw
553580
}
554581

582+
type AccountListJoinableOrganizationsResponse struct {
583+
JoinableOrganizations []JoinableOrganization `json:"joinableOrganizations"`
584+
JSON accountListJoinableOrganizationsResponseJSON `json:"-"`
585+
}
586+
587+
// accountListJoinableOrganizationsResponseJSON contains the JSON metadata for the
588+
// struct [AccountListJoinableOrganizationsResponse]
589+
type accountListJoinableOrganizationsResponseJSON struct {
590+
JoinableOrganizations apijson.Field
591+
raw string
592+
ExtraFields map[string]apijson.Field
593+
}
594+
595+
func (r *AccountListJoinableOrganizationsResponse) UnmarshalJSON(data []byte) (err error) {
596+
return apijson.UnmarshalRoot(data, r)
597+
}
598+
599+
func (r accountListJoinableOrganizationsResponseJSON) RawJSON() string {
600+
return r.raw
601+
}
602+
555603
type AccountGetParams struct {
556604
Empty param.Field[bool] `json:"empty"`
557605
}
@@ -579,6 +627,25 @@ func (r AccountGetSSOLoginURLParams) MarshalJSON() (data []byte, err error) {
579627
return apijson.MarshalRoot(r)
580628
}
581629

630+
type AccountListJoinableOrganizationsParams struct {
631+
Token param.Field[string] `query:"token"`
632+
PageSize param.Field[int64] `query:"pageSize"`
633+
Empty param.Field[bool] `json:"empty"`
634+
}
635+
636+
func (r AccountListJoinableOrganizationsParams) MarshalJSON() (data []byte, err error) {
637+
return apijson.MarshalRoot(r)
638+
}
639+
640+
// URLQuery serializes [AccountListJoinableOrganizationsParams]'s query parameters
641+
// as `url.Values`.
642+
func (r AccountListJoinableOrganizationsParams) URLQuery() (v url.Values) {
643+
return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
644+
ArrayFormat: apiquery.ArrayQueryFormatComma,
645+
NestedFormat: apiquery.NestedQueryFormatBrackets,
646+
})
647+
}
648+
582649
type AccountListLoginProvidersParams struct {
583650
Token param.Field[string] `query:"token"`
584651
PageSize param.Field[int64] `query:"pageSize"`

account_test.go

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,33 @@ func TestAccountGetSSOLoginURLWithOptionalParams(t *testing.T) {
8989
}
9090
}
9191

92+
func TestAccountListJoinableOrganizationsWithOptionalParams(t *testing.T) {
93+
t.Skip("skipped: tests are disabled for the time being")
94+
baseURL := "http://localhost:4010"
95+
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
96+
baseURL = envURL
97+
}
98+
if !testutil.CheckTestServer(t, baseURL) {
99+
return
100+
}
101+
client := gitpod.NewClient(
102+
option.WithBaseURL(baseURL),
103+
option.WithBearerToken("My Bearer Token"),
104+
)
105+
_, err := client.Accounts.ListJoinableOrganizations(context.TODO(), gitpod.AccountListJoinableOrganizationsParams{
106+
Token: gitpod.F("token"),
107+
PageSize: gitpod.F(int64(0)),
108+
Empty: gitpod.F(true),
109+
})
110+
if err != nil {
111+
var apierr *gitpod.Error
112+
if errors.As(err, &apierr) {
113+
t.Log(string(apierr.DumpRequest(true)))
114+
}
115+
t.Fatalf("err should be nil: %s", err.Error())
116+
}
117+
}
118+
92119
func TestAccountListLoginProvidersWithOptionalParams(t *testing.T) {
93120
t.Skip("skipped: tests are disabled for the time being")
94121
baseURL := "http://localhost:4010"

aliases.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@ type FieldValue = shared.FieldValue
5555
// This is an alias to an internal type.
5656
type FieldValueParam = shared.FieldValueParam
5757

58+
// Gateway represents a system gateway that provides access to services
59+
//
60+
// This is an alias to an internal type.
61+
type Gateway = shared.Gateway
62+
5863
// This is an alias to an internal type.
5964
type OrganizationRole = shared.OrganizationRole
6065

@@ -88,6 +93,9 @@ const PrincipalEnvironment = shared.PrincipalEnvironment
8893
// This is an alias to an internal value.
8994
const PrincipalServiceAccount = shared.PrincipalServiceAccount
9095

96+
// This is an alias to an internal value.
97+
const PrincipalRunnerManager = shared.PrincipalRunnerManager
98+
9199
// This is an alias to an internal type.
92100
type RunsOn = shared.RunsOn
93101

0 commit comments

Comments
 (0)