Skip to content

Commit

Permalink
release: 0.2.0 (#32)
Browse files Browse the repository at this point in the history
* feat(api): Organizations Open API docs (#31)

* feat(api): manual updates (#33)

* fix(client): don't truncate manually specified filenames (#34)

* feat(api): manual updates (#36)

* release: 0.2.0

---------

Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com>
  • Loading branch information
stainless-app[bot] authored Feb 18, 2025
1 parent 364fd42 commit dde5301
Showing 40 changed files with 1,926 additions and 198 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.1"
".": "0.2.0"
}
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-27f7bd641de1e4657ad8ce84a456fe0c5e8f1e14779bf1f567a4bc8667eba4da.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-f6598ab5d6827f66b642201769e92590ea32af84ebbf24b18cc32b33dee5107e.yml
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Changelog

## 0.2.0 (2025-02-18)

Full Changelog: [v0.1.1...v0.2.0](https://github.com/gitpod-io/gitpod-sdk-go/compare/v0.1.1...v0.2.0)

### Features

* **api:** manual updates ([#33](https://github.com/gitpod-io/gitpod-sdk-go/issues/33)) ([8b18e3a](https://github.com/gitpod-io/gitpod-sdk-go/commit/8b18e3af0ace255d515d1f53e9d8573a57ba8617))
* **api:** manual updates ([#36](https://github.com/gitpod-io/gitpod-sdk-go/issues/36)) ([9612bdb](https://github.com/gitpod-io/gitpod-sdk-go/commit/9612bdbb4a43b3fdc23e72b446b0ac0b295fb326))
* **api:** Organizations Open API docs ([#31](https://github.com/gitpod-io/gitpod-sdk-go/issues/31)) ([8c99874](https://github.com/gitpod-io/gitpod-sdk-go/commit/8c99874c9c17e63becdbd0fb30a45d77c51bdf2f))


### Bug Fixes

* **client:** don't truncate manually specified filenames ([#34](https://github.com/gitpod-io/gitpod-sdk-go/issues/34)) ([bb87acd](https://github.com/gitpod-io/gitpod-sdk-go/commit/bb87acddf4cf002b37c63e8a74bb2f044deac221))

## 0.1.1 (2025-02-14)

Full Changelog: [v0.1.0-alpha.3...v0.1.1](https://github.com/gitpod-io/gitpod-sdk-go/compare/v0.1.0-alpha.3...v0.1.1)
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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.1'
go get -u 'github.com/gitpod-io/gitpod-sdk-go@v0.2.0'
```

<!-- x-release-please-end -->
129 changes: 121 additions & 8 deletions account.go
Original file line number Diff line number Diff line change
@@ -36,33 +36,119 @@ func NewAccountService(opts ...option.RequestOption) (r *AccountService) {
return
}

// GetAccount retrieves a single Account.
// Gets information about the currently authenticated account.
//
// Use this method to:
//
// - Retrieve account profile information
// - Check organization memberships
// - View account settings
// - Get joinable organizations
//
// ### Examples
//
// - Get account details:
//
// Retrieves information about the authenticated account.
//
// ```yaml
// {}
// ```
func (r *AccountService) Get(ctx context.Context, body AccountGetParams, opts ...option.RequestOption) (res *AccountGetResponse, err error) {
opts = append(r.Options[:], opts...)
path := "gitpod.v1.AccountService/GetAccount"
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &res, opts...)
return
}

// DeleteAccount deletes an Account. To Delete an Account, the Account must not be
// an active member of any Organization.
// Deletes an account permanently.
//
// Use this method to:
//
// - Remove unused accounts
// - Clean up test accounts
// - Complete account deletion requests
//
// The account must not be an active member of any organization.
//
// ### Examples
//
// - Delete account:
//
// Permanently removes an account.
//
// ```yaml
// accountId: "f53d2330-3795-4c5d-a1f3-453121af9c60"
// ```
func (r *AccountService) Delete(ctx context.Context, body AccountDeleteParams, opts ...option.RequestOption) (res *AccountDeleteResponse, err error) {
opts = append(r.Options[:], opts...)
path := "gitpod.v1.AccountService/DeleteAccount"
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &res, opts...)
return
}

// GetSSOLoginURL returns the URL to redirect the user to for SSO login.
// Gets the SSO login URL for a specific email domain.
//
// Use this method to:
//
// - Initiate SSO authentication
// - Get organization-specific login URLs
// - Handle SSO redirects
//
// ### Examples
//
// - Get login URL:
//
// Retrieves SSO URL for email domain.
//
// ```yaml
// email: "user@company.com"
// ```
//
// - Get URL with return path:
//
// Gets SSO URL with specific return location.
//
// ```yaml
// email: "user@company.com"
// returnTo: "https://gitpod.io/workspaces"
// ```
func (r *AccountService) GetSSOLoginURL(ctx context.Context, body AccountGetSSOLoginURLParams, opts ...option.RequestOption) (res *AccountGetSSOLoginURLResponse, err error) {
opts = append(r.Options[:], opts...)
path := "gitpod.v1.AccountService/GetSSOLoginURL"
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &res, opts...)
return
}

// ListLoginProviders returns the list of login providers matching the provided
// filters.
// Lists available login providers with optional filtering.
//
// Use this method to:
//
// - View supported authentication methods
// - Get provider-specific login URLs
// - Filter providers by invite
//
// ### Examples
//
// - List all providers:
//
// Shows all available login providers.
//
// ```yaml
// pagination:
// pageSize: 20
// ```
//
// - List for specific invite:
//
// Shows providers available for an invite.
//
// ```yaml
// filter:
// inviteId: "d2c94c27-3b76-4a42-b88c-95a85e392c68"
// pagination:
// pageSize: 20
// ```
func (r *AccountService) ListLoginProviders(ctx context.Context, params AccountListLoginProvidersParams, opts ...option.RequestOption) (res *pagination.LoginProvidersPage[LoginProvider], err error) {
var raw *http.Response
opts = append(r.Options[:], opts...)
@@ -80,8 +166,35 @@ func (r *AccountService) ListLoginProviders(ctx context.Context, params AccountL
return res, nil
}

// ListLoginProviders returns the list of login providers matching the provided
// filters.
// Lists available login providers with optional filtering.
//
// Use this method to:
//
// - View supported authentication methods
// - Get provider-specific login URLs
// - Filter providers by invite
//
// ### Examples
//
// - List all providers:
//
// Shows all available login providers.
//
// ```yaml
// pagination:
// pageSize: 20
// ```
//
// - List for specific invite:
//
// Shows providers available for an invite.
//
// ```yaml
// filter:
// inviteId: "d2c94c27-3b76-4a42-b88c-95a85e392c68"
// pagination:
// pageSize: 20
// ```
func (r *AccountService) ListLoginProvidersAutoPaging(ctx context.Context, params AccountListLoginProvidersParams, opts ...option.RequestOption) *pagination.LoginProvidersPageAutoPager[LoginProvider] {
return pagination.NewLoginProvidersPageAutoPager(r.ListLoginProviders(ctx, params, opts...))
}
6 changes: 3 additions & 3 deletions account_test.go
Original file line number Diff line number Diff line change
@@ -52,7 +52,7 @@ func TestAccountDelete(t *testing.T) {
option.WithBearerToken("My Bearer Token"),
)
_, err := client.Accounts.Delete(context.TODO(), gitpod.AccountDeleteParams{
AccountID: gitpod.F("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"),
AccountID: gitpod.F("f53d2330-3795-4c5d-a1f3-453121af9c60"),
})
if err != nil {
var apierr *gitpod.Error
@@ -77,7 +77,7 @@ func TestAccountGetSSOLoginURLWithOptionalParams(t *testing.T) {
option.WithBearerToken("My Bearer Token"),
)
_, err := client.Accounts.GetSSOLoginURL(context.TODO(), gitpod.AccountGetSSOLoginURLParams{
Email: gitpod.F("dev@stainlessapi.com"),
Email: gitpod.F("user@company.com"),
ReturnTo: gitpod.F("https://example.com"),
})
if err != nil {
@@ -110,7 +110,7 @@ func TestAccountListLoginProvidersWithOptionalParams(t *testing.T) {
}),
Pagination: gitpod.F(gitpod.AccountListLoginProvidersParamsPagination{
Token: gitpod.F("token"),
PageSize: gitpod.F(int64(100)),
PageSize: gitpod.F(int64(20)),
}),
})
if err != nil {
24 changes: 24 additions & 0 deletions aliases.go
Original file line number Diff line number Diff line change
@@ -8,6 +8,30 @@ import (
)

type Error = apierror.Error
type ErrorCode = apierror.ErrorCode

const ErrorCodeCanceled = apierror.ErrorCodeCanceled
const ErrorCodeUnknown = apierror.ErrorCodeUnknown
const ErrorCodeInvalidArgument = apierror.ErrorCodeInvalidArgument
const ErrorCodeDeadlineExceeded = apierror.ErrorCodeDeadlineExceeded
const ErrorCodeNotFound = apierror.ErrorCodeNotFound
const ErrorCodeAlreadyExists = apierror.ErrorCodeAlreadyExists
const ErrorCodePermissionDenied = apierror.ErrorCodePermissionDenied
const ErrorCodeResourceExhausted = apierror.ErrorCodeResourceExhausted
const ErrorCodeFailedPrecondition = apierror.ErrorCodeFailedPrecondition
const ErrorCodeAborted = apierror.ErrorCodeAborted
const ErrorCodeOutOfRange = apierror.ErrorCodeOutOfRange
const ErrorCodeUnimplemented = apierror.ErrorCodeUnimplemented
const ErrorCodeInternal = apierror.ErrorCodeInternal
const ErrorCodeUnavailable = apierror.ErrorCodeUnavailable
const ErrorCodeDataLoss = apierror.ErrorCodeDataLoss
const ErrorCodeUnauthenticated = apierror.ErrorCodeUnauthenticated

type ArbitraryData = apierror.ArbitraryData
type ArbitraryDataDebug = apierror.ArbitraryDataDebug
type ArbitraryDataType = apierror.ArbitraryDataType
type ArbitraryDataValue = apierror.ArbitraryDataValue
type ArbitraryData = apierror.ArbitraryData

// An AutomationTrigger represents a trigger for an automation action. The
// `post_environment_start` field indicates that the automation should be triggered
78 changes: 74 additions & 4 deletions editor.go
Original file line number Diff line number Diff line change
@@ -34,15 +34,48 @@ func NewEditorService(opts ...option.RequestOption) (r *EditorService) {
return
}

// GetEditor returns the editor with the given ID
// Gets details about a specific editor.
//
// Use this method to:
//
// - View editor information
// - Get editor configuration
//
// ### Examples
//
// - Get editor details:
//
// Retrieves information about a specific editor.
//
// ```yaml
// id: "d2c94c27-3b76-4a42-b88c-95a85e392c68"
// ```
func (r *EditorService) Get(ctx context.Context, body EditorGetParams, opts ...option.RequestOption) (res *EditorGetResponse, err error) {
opts = append(r.Options[:], opts...)
path := "gitpod.v1.EditorService/GetEditor"
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &res, opts...)
return
}

// ListEditors lists all editors available to the caller
// Lists all available code editors.
//
// Use this method to:
//
// - View supported editors
// - Get editor capabilities
// - Browse editor options
// - Check editor availability
//
// ### Examples
//
// - List editors:
//
// Shows all available editors with pagination.
//
// ```yaml
// pagination:
// pageSize: 20
// ```
func (r *EditorService) List(ctx context.Context, params EditorListParams, opts ...option.RequestOption) (res *pagination.EditorsPage[Editor], err error) {
var raw *http.Response
opts = append(r.Options[:], opts...)
@@ -60,12 +93,49 @@ func (r *EditorService) List(ctx context.Context, params EditorListParams, opts
return res, nil
}

// ListEditors lists all editors available to the caller
// Lists all available code editors.
//
// Use this method to:
//
// - View supported editors
// - Get editor capabilities
// - Browse editor options
// - Check editor availability
//
// ### Examples
//
// - List editors:
//
// Shows all available editors with pagination.
//
// ```yaml
// pagination:
// pageSize: 20
// ```
func (r *EditorService) ListAutoPaging(ctx context.Context, params EditorListParams, opts ...option.RequestOption) *pagination.EditorsPageAutoPager[Editor] {
return pagination.NewEditorsPageAutoPager(r.List(ctx, params, opts...))
}

// ResolveEditorURL resolves the editor's URL for an environment
// Resolves the URL for accessing an editor in a specific environment.
//
// Use this method to:
//
// - Get editor access URLs
// - Launch editors for environments
// - Set up editor connections
// - Configure editor access
//
// ### Examples
//
// - Resolve editor URL:
//
// Gets the URL for accessing an editor in an environment.
//
// ```yaml
// editorId: "d2c94c27-3b76-4a42-b88c-95a85e392c68"
// environmentId: "07e03a28-65a5-4d98-b532-8ea67b188048"
// organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047"
// ```
func (r *EditorService) ResolveURL(ctx context.Context, body EditorResolveURLParams, opts ...option.RequestOption) (res *EditorResolveURLResponse, err error) {
opts = append(r.Options[:], opts...)
path := "gitpod.v1.EditorService/ResolveEditorURL"
10 changes: 5 additions & 5 deletions editor_test.go
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@ func TestEditorGet(t *testing.T) {
option.WithBearerToken("My Bearer Token"),
)
_, err := client.Editors.Get(context.TODO(), gitpod.EditorGetParams{
ID: gitpod.F("id"),
ID: gitpod.F("d2c94c27-3b76-4a42-b88c-95a85e392c68"),
})
if err != nil {
var apierr *gitpod.Error
@@ -56,7 +56,7 @@ func TestEditorListWithOptionalParams(t *testing.T) {
PageSize: gitpod.F(int64(0)),
Pagination: gitpod.F(gitpod.EditorListParamsPagination{
Token: gitpod.F("token"),
PageSize: gitpod.F(int64(100)),
PageSize: gitpod.F(int64(20)),
}),
})
if err != nil {
@@ -82,9 +82,9 @@ func TestEditorResolveURL(t *testing.T) {
option.WithBearerToken("My Bearer Token"),
)
_, err := client.Editors.ResolveURL(context.TODO(), gitpod.EditorResolveURLParams{
EditorID: gitpod.F("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"),
EnvironmentID: gitpod.F("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"),
OrganizationID: gitpod.F("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"),
EditorID: gitpod.F("d2c94c27-3b76-4a42-b88c-95a85e392c68"),
EnvironmentID: gitpod.F("07e03a28-65a5-4d98-b532-8ea67b188048"),
OrganizationID: gitpod.F("b0e12f6c-4c67-429d-a4a6-d9838b5da047"),
})
if err != nil {
var apierr *gitpod.Error
Loading
Oops, something went wrong.

0 comments on commit dde5301

Please sign in to comment.