Skip to content

Commit f49e593

Browse files
release: 0.1.0-alpha.3 (#19)
* feat(api): manual updates (#17) * feat(api): manual updates (#18) * feat(api): manual updates (#20) * feat(api): update examples (#21) * feat(api): manual updates (#22) * feat(api): manual updates (#23) * feat(api): update with latest API spec (#24) * feat(api): manual updates (#25) * feat(api): Overview page updates (#26) * release: 0.1.0-alpha.3 --------- Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com>
1 parent 254b61a commit f49e593

37 files changed

+1616
-606
lines changed

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.1.0-alpha.2"
2+
".": "0.1.0-alpha.3"
33
}

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
configured_endpoints: 106
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-da4c36c6b1d973f481abb8eefdeb085d88eaf37eeaba30d276cb3daa405b6f0c.yml
1+
configured_endpoints: 111
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-988164042da1361feb3d28364c6f14fee775ceab496b9d79d048141c0fa6da19.yml

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
# Changelog
22

3+
## 0.1.0-alpha.3 (2025-02-13)
4+
5+
Full Changelog: [v0.1.0-alpha.2...v0.1.0-alpha.3](https://github.com/gitpod-io/gitpod-sdk-go/compare/v0.1.0-alpha.2...v0.1.0-alpha.3)
6+
7+
### Features
8+
9+
* **api:** manual updates ([#17](https://github.com/gitpod-io/gitpod-sdk-go/issues/17)) ([762e8f7](https://github.com/gitpod-io/gitpod-sdk-go/commit/762e8f70ad9507a80a2cddefe31e79d128919c06))
10+
* **api:** manual updates ([#18](https://github.com/gitpod-io/gitpod-sdk-go/issues/18)) ([3d70885](https://github.com/gitpod-io/gitpod-sdk-go/commit/3d708857be80530a1b8cc5169b5b03dbc38bebd3))
11+
* **api:** manual updates ([#20](https://github.com/gitpod-io/gitpod-sdk-go/issues/20)) ([47bc0b1](https://github.com/gitpod-io/gitpod-sdk-go/commit/47bc0b103590ceace9c56bec72a8c6da133f5f17))
12+
* **api:** manual updates ([#22](https://github.com/gitpod-io/gitpod-sdk-go/issues/22)) ([fd57922](https://github.com/gitpod-io/gitpod-sdk-go/commit/fd57922f815b9c876056ea9a878ac5c352af1ca9))
13+
* **api:** manual updates ([#23](https://github.com/gitpod-io/gitpod-sdk-go/issues/23)) ([33e7aed](https://github.com/gitpod-io/gitpod-sdk-go/commit/33e7aed13c50f6458e8f0c4a7fba7fcb9e775f24))
14+
* **api:** manual updates ([#25](https://github.com/gitpod-io/gitpod-sdk-go/issues/25)) ([d8140c6](https://github.com/gitpod-io/gitpod-sdk-go/commit/d8140c673b66d53bfe58ff315ad4e9062b7cc5ac))
15+
* **api:** Overview page updates ([#26](https://github.com/gitpod-io/gitpod-sdk-go/issues/26)) ([a85f0c2](https://github.com/gitpod-io/gitpod-sdk-go/commit/a85f0c2a5d99d9616bb3013fb98b88b23967e1df))
16+
* **api:** update examples ([#21](https://github.com/gitpod-io/gitpod-sdk-go/issues/21)) ([48bf713](https://github.com/gitpod-io/gitpod-sdk-go/commit/48bf7138ab06ae118aaefc46c9ff2a9809a25d77))
17+
* **api:** update with latest API spec ([#24](https://github.com/gitpod-io/gitpod-sdk-go/issues/24)) ([7232ba6](https://github.com/gitpod-io/gitpod-sdk-go/commit/7232ba6189894f53d16d94218c7b0e2d361c4ea7))
18+
319
## 0.1.0-alpha.2 (2025-02-11)
420

521
Full Changelog: [v0.1.0-alpha.1...v0.1.0-alpha.2](https://github.com/gitpod-io/gitpod-sdk-go/compare/v0.1.0-alpha.1...v0.1.0-alpha.2)

README.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<a href="https://pkg.go.dev/github.com/gitpod-io/gitpod-sdk-go"><img src="https://pkg.go.dev/badge/github.com/gitpod-io/gitpod-sdk-go.svg" alt="Go Reference"></a>
44

55
The Gitpod Go library provides convenient access to [the Gitpod REST
6-
API](https://docs.gitpod.com) from applications written in Go. The full API of this library can be found in [api.md](api.md).
6+
API](https://docs.gitpod.io) from applications written in Go. The full API of this library can be found in [api.md](api.md).
77

88
It is generated with [Stainless](https://www.stainlessapi.com/).
99

@@ -24,7 +24,7 @@ Or to pin the version:
2424
<!-- x-release-please-start-version -->
2525

2626
```sh
27-
go get -u 'github.com/gitpod-io/[email protected].2'
27+
go get -u 'github.com/gitpod-io/[email protected].3'
2828
```
2929

3030
<!-- x-release-please-end -->
@@ -52,11 +52,11 @@ func main() {
5252
client := gitpod.NewClient(
5353
option.WithBearerToken("My Bearer Token"), // defaults to os.LookupEnv("GITPOD_API_KEY")
5454
)
55-
runner, err := client.Runners.New(context.TODO(), gitpod.RunnerNewParams{})
55+
response, err := client.Identity.GetAuthenticatedIdentity(context.TODO(), gitpod.IdentityGetAuthenticatedIdentityParams{})
5656
if err != nil {
5757
panic(err.Error())
5858
}
59-
fmt.Printf("%+v\n", runner.AccessToken)
59+
fmt.Printf("%+v\n", response.OrganizationID)
6060
}
6161

6262
```
@@ -145,7 +145,7 @@ client := gitpod.NewClient(
145145
option.WithHeader("X-Some-Header", "custom_header_info"),
146146
)
147147

148-
client.Runners.New(context.TODO(), ...,
148+
client.Identity.GetAuthenticatedIdentity(context.TODO(), ...,
149149
// Override the header
150150
option.WithHeader("X-Some-Header", "some_other_custom_header_info"),
151151
// Add an undocumented field to the request body, using sjson syntax
@@ -162,11 +162,11 @@ This library provides some conveniences for working with paginated list endpoint
162162
You can use `.ListAutoPaging()` methods to iterate through items across all pages:
163163

164164
```go
165-
iter := client.Environments.Automations.Services.ListAutoPaging(context.TODO(), gitpod.EnvironmentAutomationServiceListParams{})
165+
iter := client.Environments.ListAutoPaging(context.TODO(), gitpod.EnvironmentListParams{})
166166
// Automatically fetches more pages as needed.
167167
for iter.Next() {
168-
service := iter.Current()
169-
fmt.Printf("%+v\n", service)
168+
environment := iter.Current()
169+
fmt.Printf("%+v\n", environment)
170170
}
171171
if err := iter.Err(); err != nil {
172172
panic(err.Error())
@@ -177,10 +177,10 @@ Or you can use simple `.List()` methods to fetch a single page and receive a sta
177177
with additional helper methods like `.GetNextPage()`, e.g.:
178178

179179
```go
180-
page, err := client.Environments.Automations.Services.List(context.TODO(), gitpod.EnvironmentAutomationServiceListParams{})
180+
page, err := client.Environments.List(context.TODO(), gitpod.EnvironmentListParams{})
181181
for page != nil {
182-
for _, service := range page.Services {
183-
fmt.Printf("%+v\n", service)
182+
for _, environment := range page.Environments {
183+
fmt.Printf("%+v\n", environment)
184184
}
185185
page, err = page.GetNextPage()
186186
}
@@ -199,14 +199,14 @@ When the API returns a non-success status code, we return an error with type
199199
To handle errors, we recommend that you use the `errors.As` pattern:
200200

201201
```go
202-
_, err := client.Runners.New(context.TODO(), gitpod.RunnerNewParams{})
202+
_, err := client.Identity.GetAuthenticatedIdentity(context.TODO(), gitpod.IdentityGetAuthenticatedIdentityParams{})
203203
if err != nil {
204204
var apierr *gitpod.Error
205205
if errors.As(err, &apierr) {
206206
println(string(apierr.DumpRequest(true))) // Prints the serialized HTTP request
207207
println(string(apierr.DumpResponse(true))) // Prints the serialized HTTP response
208208
}
209-
panic(err.Error()) // GET "/gitpod.v1.RunnerService/CreateRunner": 400 Bad Request { ... }
209+
panic(err.Error()) // GET "/gitpod.v1.IdentityService/GetAuthenticatedIdentity": 400 Bad Request { ... }
210210
}
211211
```
212212

@@ -224,9 +224,9 @@ To set a per-retry timeout, use `option.WithRequestTimeout()`.
224224
// This sets the timeout for the request, including all the retries.
225225
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute)
226226
defer cancel()
227-
client.Runners.New(
227+
client.Identity.GetAuthenticatedIdentity(
228228
ctx,
229-
gitpod.RunnerNewParams{},
229+
gitpod.IdentityGetAuthenticatedIdentityParams{},
230230
// This sets the per-retry timeout
231231
option.WithRequestTimeout(20*time.Second),
232232
)
@@ -260,9 +260,9 @@ client := gitpod.NewClient(
260260
)
261261

262262
// Override per-request:
263-
client.Runners.New(
263+
client.Identity.GetAuthenticatedIdentity(
264264
context.TODO(),
265-
gitpod.RunnerNewParams{},
265+
gitpod.IdentityGetAuthenticatedIdentityParams{},
266266
option.WithMaxRetries(5),
267267
)
268268
```
@@ -275,15 +275,15 @@ you need to examine response headers, status codes, or other details.
275275
```go
276276
// Create a variable to store the HTTP response
277277
var response *http.Response
278-
runner, err := client.Runners.New(
278+
response, err := client.Identity.GetAuthenticatedIdentity(
279279
context.TODO(),
280-
gitpod.RunnerNewParams{},
280+
gitpod.IdentityGetAuthenticatedIdentityParams{},
281281
option.WithResponseInto(&response),
282282
)
283283
if err != nil {
284284
// handle error
285285
}
286-
fmt.Printf("%+v\n", runner)
286+
fmt.Printf("%+v\n", response)
287287

288288
fmt.Printf("Status Code: %d\n", response.StatusCode)
289289
fmt.Printf("Headers: %+#v\n", response.Header)

account.go

Lines changed: 31 additions & 31 deletions
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
}

account_test.go

Lines changed: 1 addition & 1 deletion
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 {

aliases.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ type Subject = shared.Subject
8888
// This is an alias to an internal type.
8989
type SubjectParam = shared.SubjectParam
9090

91+
// This is an alias to an internal type.
92+
type Task = shared.Task
93+
9194
// This is an alias to an internal type.
9295
type TaskExecution = shared.TaskExecution
9396

@@ -133,6 +136,18 @@ type TaskExecutionStatus = shared.TaskExecutionStatus
133136
// This is an alias to an internal type.
134137
type TaskExecutionStatusStep = shared.TaskExecutionStatusStep
135138

139+
// This is an alias to an internal type.
140+
type TaskMetadata = shared.TaskMetadata
141+
142+
// This is an alias to an internal type.
143+
type TaskMetadataParam = shared.TaskMetadataParam
144+
145+
// This is an alias to an internal type.
146+
type TaskSpec = shared.TaskSpec
147+
148+
// This is an alias to an internal type.
149+
type TaskSpecParam = shared.TaskSpecParam
150+
136151
// This is an alias to an internal type.
137152
type UserStatus = shared.UserStatus
138153

0 commit comments

Comments
 (0)