GetAccount
client.Accounts.Get(ctx, body) (*AccountGetResponse, error)
POST/gitpod.v1.AccountService/GetAccount
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.
{}
GetAccount
package main
import (
"context"
"fmt"
"github.com/gitpod-io/gitpod-sdk-go"
"github.com/gitpod-io/gitpod-sdk-go/option"
)
func main() {
client := gitpod.NewClient(
option.WithBearerToken("My Bearer Token"),
)
account, err := client.Accounts.Get(context.TODO(), gitpod.AccountGetParams{
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", account.Account)
}
{
"account": {
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"createdAt": "2019-12-27T18:11:19.117Z",
"email": "email",
"name": "name",
"updatedAt": "2019-12-27T18:11:19.117Z",
"avatarUrl": "avatarUrl",
"joinables": [
{
"organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"organizationName": "organizationName",
"organizationMemberCount": 0
}
],
"memberships": [
{
"organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"organizationName": "organizationName",
"userId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"userRole": "ORGANIZATION_ROLE_UNSPECIFIED",
"organizationMemberCount": 0,
"organizationTier": "ORGANIZATION_TIER_UNSPECIFIED"
}
],
"organizationId": "organizationId",
"publicEmailProvider": true
}
}Returns Examples
{
"account": {
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"createdAt": "2019-12-27T18:11:19.117Z",
"email": "email",
"name": "name",
"updatedAt": "2019-12-27T18:11:19.117Z",
"avatarUrl": "avatarUrl",
"joinables": [
{
"organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"organizationName": "organizationName",
"organizationMemberCount": 0
}
],
"memberships": [
{
"organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"organizationName": "organizationName",
"userId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"userRole": "ORGANIZATION_ROLE_UNSPECIFIED",
"organizationMemberCount": 0,
"organizationTier": "ORGANIZATION_TIER_UNSPECIFIED"
}
],
"organizationId": "organizationId",
"publicEmailProvider": true
}
}