Skip to content

Commit

Permalink
release: 0.1.0-alpha.3 (#19)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
stainless-app[bot] authored Feb 13, 2025
1 parent 254b61a commit f49e593
Showing 37 changed files with 1,616 additions and 606 deletions.
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.1.0-alpha.2"
".": "0.1.0-alpha.3"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 106
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-da4c36c6b1d973f481abb8eefdeb085d88eaf37eeaba30d276cb3daa405b6f0c.yml
configured_endpoints: 111
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-988164042da1361feb3d28364c6f14fee775ceab496b9d79d048141c0fa6da19.yml
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# Changelog

## 0.1.0-alpha.3 (2025-02-13)

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)

### Features

* **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))
* **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))
* **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))
* **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))
* **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))
* **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))
* **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))
* **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))
* **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))

## 0.1.0-alpha.2 (2025-02-11)

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)
40 changes: 20 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
<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>

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

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

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

```sh
go get -u 'github.com/gitpod-io/gitpod-sdk-go@v0.1.0-alpha.2'
go get -u 'github.com/gitpod-io/gitpod-sdk-go@v0.1.0-alpha.3'
```

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

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

client.Runners.New(context.TODO(), ...,
client.Identity.GetAuthenticatedIdentity(context.TODO(), ...,
// Override the header
option.WithHeader("X-Some-Header", "some_other_custom_header_info"),
// 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
You can use `.ListAutoPaging()` methods to iterate through items across all pages:

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

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

```go
_, err := client.Runners.New(context.TODO(), gitpod.RunnerNewParams{})
_, err := client.Identity.GetAuthenticatedIdentity(context.TODO(), gitpod.IdentityGetAuthenticatedIdentityParams{})
if err != nil {
var apierr *gitpod.Error
if errors.As(err, &apierr) {
println(string(apierr.DumpRequest(true))) // Prints the serialized HTTP request
println(string(apierr.DumpResponse(true))) // Prints the serialized HTTP response
}
panic(err.Error()) // GET "/gitpod.v1.RunnerService/CreateRunner": 400 Bad Request { ... }
panic(err.Error()) // GET "/gitpod.v1.IdentityService/GetAuthenticatedIdentity": 400 Bad Request { ... }
}
```

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

// Override per-request:
client.Runners.New(
client.Identity.GetAuthenticatedIdentity(
context.TODO(),
gitpod.RunnerNewParams{},
gitpod.IdentityGetAuthenticatedIdentityParams{},
option.WithMaxRetries(5),
)
```
@@ -275,15 +275,15 @@ you need to examine response headers, status codes, or other details.
```go
// Create a variable to store the HTTP response
var response *http.Response
runner, err := client.Runners.New(
response, err := client.Identity.GetAuthenticatedIdentity(
context.TODO(),
gitpod.RunnerNewParams{},
gitpod.IdentityGetAuthenticatedIdentityParams{},
option.WithResponseInto(&response),
)
if err != nil {
// handle error
}
fmt.Printf("%+v\n", runner)
fmt.Printf("%+v\n", response)

fmt.Printf("Status Code: %d\n", response.StatusCode)
fmt.Printf("Headers: %+#v\n", response.Header)
62 changes: 31 additions & 31 deletions account.go
Original file line number Diff line number Diff line change
@@ -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,
@@ -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,
@@ -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
}
@@ -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:"-"`
}

@@ -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:"-"`
}

@@ -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:"-"`
}

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

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

@@ -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:"-"`
}

@@ -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) {
@@ -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"`
}
2 changes: 1 addition & 1 deletion account_test.go
Original file line number Diff line number Diff line change
@@ -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 {
15 changes: 15 additions & 0 deletions aliases.go
Original file line number Diff line number Diff line change
@@ -88,6 +88,9 @@ type Subject = shared.Subject
// This is an alias to an internal type.
type SubjectParam = shared.SubjectParam

// This is an alias to an internal type.
type Task = shared.Task

// This is an alias to an internal type.
type TaskExecution = shared.TaskExecution

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

// This is an alias to an internal type.
type TaskMetadata = shared.TaskMetadata

// This is an alias to an internal type.
type TaskMetadataParam = shared.TaskMetadataParam

// This is an alias to an internal type.
type TaskSpec = shared.TaskSpec

// This is an alias to an internal type.
type TaskSpecParam = shared.TaskSpecParam

// This is an alias to an internal type.
type UserStatus = shared.UserStatus

Loading

0 comments on commit f49e593

Please sign in to comment.