# Organizations ## CreateOrganization `client.Organizations.New(ctx, body) (*OrganizationNewResponse, error)` **post** `/gitpod.v1.OrganizationService/CreateOrganization` Creates a new organization with the specified name and settings. Use this method to: - Create a new organization for team collaboration - Set up automatic domain-based invites for team members - Join the organization immediately upon creation ### Examples - Create a basic organization: Creates an organization with just a name. ```yaml name: "Acme Corp Engineering" joinOrganization: true ``` - Create with domain-based invites: Creates an organization that automatically invites users with matching email domains. ```yaml name: "Acme Corp" joinOrganization: true inviteAccountsWithMatchingDomain: true ``` ### Parameters - `body OrganizationNewParams` - `Name param.Field[string]` name is the organization name - `InviteAccountsWithMatchingDomain param.Field[bool]` Should other Accounts with the same domain be automatically invited to the organization? - `JoinOrganization param.Field[bool]` join_organization decides whether the Identity issuing this request joins the org on creation ### Returns - `type OrganizationNewResponse struct{…}` - `Organization Organization` organization is the created organization - `ID string` - `CreatedAt Time` 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, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the 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. - `Name string` - `Tier OrganizationTier` The tier of the organization - free, enterprise or core - `const OrganizationTierUnspecified OrganizationTier = "ORGANIZATION_TIER_UNSPECIFIED"` - `const OrganizationTierFree OrganizationTier = "ORGANIZATION_TIER_FREE"` - `const OrganizationTierEnterprise OrganizationTier = "ORGANIZATION_TIER_ENTERPRISE"` - `const OrganizationTierCore OrganizationTier = "ORGANIZATION_TIER_CORE"` - `const OrganizationTierFreeOna OrganizationTier = "ORGANIZATION_TIER_FREE_ONA"` - `UpdatedAt Time` 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, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the 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. - `InviteDomains InviteDomains` - `Domains []string` domains is the list of domains that are allowed to join the organization - `Member OrganizationMember` member is the member that joined the org on creation. Only set if specified "join_organization" is "true" in the request. - `Email string` - `FullName string` - `LoginProvider string` login_provider is the login provider the user uses to sign in - `MemberSince Time` 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, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the 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. - `Role OrganizationRole` - `const OrganizationRoleUnspecified OrganizationRole = "ORGANIZATION_ROLE_UNSPECIFIED"` - `const OrganizationRoleAdmin OrganizationRole = "ORGANIZATION_ROLE_ADMIN"` - `const OrganizationRoleMember OrganizationRole = "ORGANIZATION_ROLE_MEMBER"` - `Status UserStatus` - `const UserStatusUnspecified UserStatus = "USER_STATUS_UNSPECIFIED"` - `const UserStatusActive UserStatus = "USER_STATUS_ACTIVE"` - `const UserStatusSuspended UserStatus = "USER_STATUS_SUSPENDED"` - `const UserStatusLeft UserStatus = "USER_STATUS_LEFT"` - `UserID string` - `AvatarURL string` ### Example ```go 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"), ) organization, err := client.Organizations.New(context.TODO(), gitpod.OrganizationNewParams{ Name: gitpod.F("Acme Corp Engineering"), JoinOrganization: gitpod.F(true), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", organization.Organization) } ``` #### Response ```json { "organization": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "createdAt": "2019-12-27T18:11:19.117Z", "name": "name", "tier": "ORGANIZATION_TIER_UNSPECIFIED", "updatedAt": "2019-12-27T18:11:19.117Z", "inviteDomains": { "domains": [ "sfN2.l.iJR-BU.u9JV9.a.m.o2D-4b-Jd.0Z-kX.L.n.S.f.UKbxB" ] } }, "member": { "email": "email", "fullName": "fullName", "loginProvider": "loginProvider", "memberSince": "2019-12-27T18:11:19.117Z", "role": "ORGANIZATION_ROLE_UNSPECIFIED", "status": "USER_STATUS_UNSPECIFIED", "userId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "avatarUrl": "avatarUrl" } } ``` ## DeleteOrganization `client.Organizations.Delete(ctx, body) (*OrganizationDeleteResponse, error)` **post** `/gitpod.v1.OrganizationService/DeleteOrganization` Permanently deletes an organization. Use this method to: - Remove unused organizations - Clean up test organizations - Complete organization migration ### Examples - Delete organization: Permanently removes an organization and all its data. ```yaml organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" ``` ### Parameters - `body OrganizationDeleteParams` - `OrganizationID param.Field[string]` organization_id is the ID of the organization to delete ### Returns - `type OrganizationDeleteResponse interface{…}` ### Example ```go 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"), ) organization, err := client.Organizations.Delete(context.TODO(), gitpod.OrganizationDeleteParams{ OrganizationID: gitpod.F("b0e12f6c-4c67-429d-a4a6-d9838b5da047"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", organization) } ``` #### Response ```json {} ``` ## JoinOrganization `client.Organizations.Join(ctx, body) (*OrganizationJoinResponse, error)` **post** `/gitpod.v1.OrganizationService/JoinOrganization` Allows users to join an organization through direct ID, invite link, or domain-based auto-join. Use this method to: - Join an organization via direct ID or invite - Join automatically based on email domain - Accept organization invitations ### Examples - Join via organization ID: Joins an organization directly when you have the ID. ```yaml organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" ``` - Join via invite: Accepts an organization invitation link. ```yaml inviteId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" ``` ### Parameters - `body OrganizationJoinParams` - `InviteID param.Field[string]` invite_id is the unique identifier of the invite to join the organization. - `OrganizationID param.Field[string]` organization_id is the unique identifier of the Organization to join. ### Returns - `type OrganizationJoinResponse struct{…}` - `Member OrganizationMember` member is the member that was created by joining the organization. - `Email string` - `FullName string` - `LoginProvider string` login_provider is the login provider the user uses to sign in - `MemberSince Time` 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, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the 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. - `Role OrganizationRole` - `const OrganizationRoleUnspecified OrganizationRole = "ORGANIZATION_ROLE_UNSPECIFIED"` - `const OrganizationRoleAdmin OrganizationRole = "ORGANIZATION_ROLE_ADMIN"` - `const OrganizationRoleMember OrganizationRole = "ORGANIZATION_ROLE_MEMBER"` - `Status UserStatus` - `const UserStatusUnspecified UserStatus = "USER_STATUS_UNSPECIFIED"` - `const UserStatusActive UserStatus = "USER_STATUS_ACTIVE"` - `const UserStatusSuspended UserStatus = "USER_STATUS_SUSPENDED"` - `const UserStatusLeft UserStatus = "USER_STATUS_LEFT"` - `UserID string` - `AvatarURL string` ### Example ```go 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"), ) response, err := client.Organizations.Join(context.TODO(), gitpod.OrganizationJoinParams{ InviteID: gitpod.F("d2c94c27-3b76-4a42-b88c-95a85e392c68"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response.Member) } ``` #### Response ```json { "member": { "email": "email", "fullName": "fullName", "loginProvider": "loginProvider", "memberSince": "2019-12-27T18:11:19.117Z", "role": "ORGANIZATION_ROLE_UNSPECIFIED", "status": "USER_STATUS_UNSPECIFIED", "userId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "avatarUrl": "avatarUrl" } } ``` ## LeaveOrganization `client.Organizations.Leave(ctx, body) (*OrganizationLeaveResponse, error)` **post** `/gitpod.v1.OrganizationService/LeaveOrganization` Removes a user from an organization while preserving organization data. Use this method to: - Remove yourself from an organization - Clean up inactive memberships - Transfer project ownership before leaving - Manage team transitions ### Examples - Leave organization: Removes user from organization membership. ```yaml userId: "f53d2330-3795-4c5d-a1f3-453121af9c60" ``` Note: Ensure all projects and resources are transferred before leaving. ### Parameters - `body OrganizationLeaveParams` - `UserID param.Field[string]` ### Returns - `type OrganizationLeaveResponse interface{…}` ### Example ```go 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"), ) response, err := client.Organizations.Leave(context.TODO(), gitpod.OrganizationLeaveParams{ UserID: gitpod.F("f53d2330-3795-4c5d-a1f3-453121af9c60"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response) } ``` #### Response ```json {} ``` ## ListMembers `client.Organizations.ListMembers(ctx, params) (*MembersPage[OrganizationMember], error)` **post** `/gitpod.v1.OrganizationService/ListMembers` Lists and filters organization members with optional pagination. Use this method to: - View all organization members - Monitor member activity - Manage team membership ### Examples - List active members: Retrieves active members with pagination. ```yaml organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" pagination: pageSize: 20 ``` - List with pagination: Retrieves next page of members. ```yaml organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" pagination: pageSize: 50 token: "next-page-token-from-previous-response" ``` ### Parameters - `params OrganizationListMembersParams` - `OrganizationID param.Field[string]` Body param: organization_id is the ID of the organization to list members for - `Token param.Field[string]` Query param - `PageSize param.Field[int64]` Query param - `Filter param.Field[OrganizationListMembersParamsFilter]` Body param - `ExcludeGroupIDs []string` exclude_group_ids excludes members who are already in any of the specified groups - `ExcludeMembersInAnyTeam bool` exclude_members_in_any_team excludes members who belong to any team in the organization - `Roles []OrganizationRole` roles filters members by their organization role - `const OrganizationRoleUnspecified OrganizationRole = "ORGANIZATION_ROLE_UNSPECIFIED"` - `const OrganizationRoleAdmin OrganizationRole = "ORGANIZATION_ROLE_ADMIN"` - `const OrganizationRoleMember OrganizationRole = "ORGANIZATION_ROLE_MEMBER"` - `Search string` search performs case-insensitive search across member name and email - `Statuses []UserStatus` status filters members by their user status - `const UserStatusUnspecified UserStatus = "USER_STATUS_UNSPECIFIED"` - `const UserStatusActive UserStatus = "USER_STATUS_ACTIVE"` - `const UserStatusSuspended UserStatus = "USER_STATUS_SUSPENDED"` - `const UserStatusLeft UserStatus = "USER_STATUS_LEFT"` - `UserIDs []string` user_ids filters the response to only members with the specified user IDs - `Pagination param.Field[OrganizationListMembersParamsPagination]` Body param: pagination contains the pagination options for listing members - `Token string` Token for the next set of results that was returned as next_token of a PaginationResponse - `PageSize int64` Page size is the maximum number of results to retrieve per page. Defaults to 25. Maximum 100. - `Sort param.Field[OrganizationListMembersParamsSort]` Body param: sort specifies the order of results. When unspecified, the authenticated user is returned first, followed by other members sorted by name ascending. When an explicit sort is specified, results are sorted purely by the requested field without any special handling for the authenticated user. - `Field OrganizationListMembersParamsSortField` - `const OrganizationListMembersParamsSortFieldSortFieldUnspecified OrganizationListMembersParamsSortField = "SORT_FIELD_UNSPECIFIED"` - `const OrganizationListMembersParamsSortFieldSortFieldName OrganizationListMembersParamsSortField = "SORT_FIELD_NAME"` - `const OrganizationListMembersParamsSortFieldSortFieldDateJoined OrganizationListMembersParamsSortField = "SORT_FIELD_DATE_JOINED"` - `Order SortOrder` - `const SortOrderUnspecified SortOrder = "SORT_ORDER_UNSPECIFIED"` - `const SortOrderAsc SortOrder = "SORT_ORDER_ASC"` - `const SortOrderDesc SortOrder = "SORT_ORDER_DESC"` ### Returns - `type OrganizationMember struct{…}` - `Email string` - `FullName string` - `LoginProvider string` login_provider is the login provider the user uses to sign in - `MemberSince Time` 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, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the 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. - `Role OrganizationRole` - `const OrganizationRoleUnspecified OrganizationRole = "ORGANIZATION_ROLE_UNSPECIFIED"` - `const OrganizationRoleAdmin OrganizationRole = "ORGANIZATION_ROLE_ADMIN"` - `const OrganizationRoleMember OrganizationRole = "ORGANIZATION_ROLE_MEMBER"` - `Status UserStatus` - `const UserStatusUnspecified UserStatus = "USER_STATUS_UNSPECIFIED"` - `const UserStatusActive UserStatus = "USER_STATUS_ACTIVE"` - `const UserStatusSuspended UserStatus = "USER_STATUS_SUSPENDED"` - `const UserStatusLeft UserStatus = "USER_STATUS_LEFT"` - `UserID string` - `AvatarURL string` ### Example ```go 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"), ) page, err := client.Organizations.ListMembers(context.TODO(), gitpod.OrganizationListMembersParams{ OrganizationID: gitpod.F("b0e12f6c-4c67-429d-a4a6-d9838b5da047"), Pagination: gitpod.F(gitpod.OrganizationListMembersParamsPagination{ PageSize: gitpod.F(int64(20)), }), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", page) } ``` #### Response ```json { "members": [ { "email": "email", "fullName": "fullName", "loginProvider": "loginProvider", "memberSince": "2019-12-27T18:11:19.117Z", "role": "ORGANIZATION_ROLE_UNSPECIFIED", "status": "USER_STATUS_UNSPECIFIED", "userId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "avatarUrl": "avatarUrl" } ], "pagination": { "nextToken": "nextToken" }, "count": { "relation": "COUNT_RESPONSE_RELATION_UNSPECIFIED", "value": 0 } } ``` ## GetOrganization `client.Organizations.Get(ctx, body) (*OrganizationGetResponse, error)` **post** `/gitpod.v1.OrganizationService/GetOrganization` Gets details about a specific organization. Use this method to: - Retrieve organization settings and configuration - Check organization membership status - View domain verification settings ### Examples - Get organization details: Retrieves information about a specific organization. ```yaml organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" ``` ### Parameters - `body OrganizationGetParams` - `OrganizationID param.Field[string]` organization_id is the unique identifier of the Organization to retreive. ### Returns - `type OrganizationGetResponse struct{…}` - `Organization Organization` organization is the requested organization - `ID string` - `CreatedAt Time` 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, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the 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. - `Name string` - `Tier OrganizationTier` The tier of the organization - free, enterprise or core - `const OrganizationTierUnspecified OrganizationTier = "ORGANIZATION_TIER_UNSPECIFIED"` - `const OrganizationTierFree OrganizationTier = "ORGANIZATION_TIER_FREE"` - `const OrganizationTierEnterprise OrganizationTier = "ORGANIZATION_TIER_ENTERPRISE"` - `const OrganizationTierCore OrganizationTier = "ORGANIZATION_TIER_CORE"` - `const OrganizationTierFreeOna OrganizationTier = "ORGANIZATION_TIER_FREE_ONA"` - `UpdatedAt Time` 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, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the 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. - `InviteDomains InviteDomains` - `Domains []string` domains is the list of domains that are allowed to join the organization ### Example ```go 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"), ) organization, err := client.Organizations.Get(context.TODO(), gitpod.OrganizationGetParams{ OrganizationID: gitpod.F("b0e12f6c-4c67-429d-a4a6-d9838b5da047"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", organization.Organization) } ``` #### Response ```json { "organization": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "createdAt": "2019-12-27T18:11:19.117Z", "name": "name", "tier": "ORGANIZATION_TIER_UNSPECIFIED", "updatedAt": "2019-12-27T18:11:19.117Z", "inviteDomains": { "domains": [ "sfN2.l.iJR-BU.u9JV9.a.m.o2D-4b-Jd.0Z-kX.L.n.S.f.UKbxB" ] } } } ``` ## SetRole `client.Organizations.SetRole(ctx, body) (*OrganizationSetRoleResponse, error)` **post** `/gitpod.v1.OrganizationService/SetRole` Manages organization membership and roles by setting a user's role within the organization. Use this method to: - Promote members to admin role - Change member permissions - Demote admins to regular members ### Examples - Promote to admin: Makes a user an organization administrator. ```yaml organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" userId: "f53d2330-3795-4c5d-a1f3-453121af9c60" role: ORGANIZATION_ROLE_ADMIN ``` - Change to member: Changes a user's role to regular member. ```yaml organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" userId: "f53d2330-3795-4c5d-a1f3-453121af9c60" role: ORGANIZATION_ROLE_MEMBER ``` ### Parameters - `body OrganizationSetRoleParams` - `OrganizationID param.Field[string]` - `UserID param.Field[string]` - `Role param.Field[OrganizationRole]` ### Returns - `type OrganizationSetRoleResponse interface{…}` ### Example ```go package main import ( "context" "fmt" "github.com/gitpod-io/gitpod-sdk-go" "github.com/gitpod-io/gitpod-sdk-go/option" "github.com/gitpod-io/gitpod-sdk-go/shared" ) func main() { client := gitpod.NewClient( option.WithBearerToken("My Bearer Token"), ) response, err := client.Organizations.SetRole(context.TODO(), gitpod.OrganizationSetRoleParams{ OrganizationID: gitpod.F("b0e12f6c-4c67-429d-a4a6-d9838b5da047"), UserID: gitpod.F("f53d2330-3795-4c5d-a1f3-453121af9c60"), Role: gitpod.F(shared.OrganizationRoleMember), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response) } ``` #### Response ```json {} ``` ## UpdateOrganization `client.Organizations.Update(ctx, body) (*OrganizationUpdateResponse, error)` **post** `/gitpod.v1.OrganizationService/UpdateOrganization` Updates an organization's settings including name, invite domains, and member policies. Use this method to: - Modify organization display name - Configure email domain restrictions - Update organization-wide settings - Manage member access policies ### Examples - Update basic settings: Changes organization name and invite domains. ```yaml organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" name: "New Company Name" inviteDomains: domains: - "company.com" - "subsidiary.com" ``` - Remove domain restrictions: Clears all domain-based invite restrictions. ```yaml organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" inviteDomains: domains: [] ``` ### Parameters - `body OrganizationUpdateParams` - `OrganizationID param.Field[string]` organization_id is the ID of the organization to update the settings for. - `InviteDomains param.Field[InviteDomains]` invite_domains is the domain allowlist of the organization - `Name param.Field[string]` name is the new name of the organization ### Returns - `type OrganizationUpdateResponse struct{…}` - `Organization Organization` organization is the updated organization - `ID string` - `CreatedAt Time` 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, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the 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. - `Name string` - `Tier OrganizationTier` The tier of the organization - free, enterprise or core - `const OrganizationTierUnspecified OrganizationTier = "ORGANIZATION_TIER_UNSPECIFIED"` - `const OrganizationTierFree OrganizationTier = "ORGANIZATION_TIER_FREE"` - `const OrganizationTierEnterprise OrganizationTier = "ORGANIZATION_TIER_ENTERPRISE"` - `const OrganizationTierCore OrganizationTier = "ORGANIZATION_TIER_CORE"` - `const OrganizationTierFreeOna OrganizationTier = "ORGANIZATION_TIER_FREE_ONA"` - `UpdatedAt Time` 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, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the 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. - `InviteDomains InviteDomains` - `Domains []string` domains is the list of domains that are allowed to join the organization ### Example ```go 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"), ) organization, err := client.Organizations.Update(context.TODO(), gitpod.OrganizationUpdateParams{ OrganizationID: gitpod.F("b0e12f6c-4c67-429d-a4a6-d9838b5da047"), InviteDomains: gitpod.F(gitpod.InviteDomainsParam{ Domains: gitpod.F([]string{}), }), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", organization.Organization) } ``` #### Response ```json { "organization": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "createdAt": "2019-12-27T18:11:19.117Z", "name": "name", "tier": "ORGANIZATION_TIER_UNSPECIFIED", "updatedAt": "2019-12-27T18:11:19.117Z", "inviteDomains": { "domains": [ "sfN2.l.iJR-BU.u9JV9.a.m.o2D-4b-Jd.0Z-kX.L.n.S.f.UKbxB" ] } } } ``` ## Domain Types ### Invite Domains - `type InviteDomains struct{…}` - `Domains []string` domains is the list of domains that are allowed to join the organization ### Organization - `type Organization struct{…}` - `ID string` - `CreatedAt Time` 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, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the 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. - `Name string` - `Tier OrganizationTier` The tier of the organization - free, enterprise or core - `const OrganizationTierUnspecified OrganizationTier = "ORGANIZATION_TIER_UNSPECIFIED"` - `const OrganizationTierFree OrganizationTier = "ORGANIZATION_TIER_FREE"` - `const OrganizationTierEnterprise OrganizationTier = "ORGANIZATION_TIER_ENTERPRISE"` - `const OrganizationTierCore OrganizationTier = "ORGANIZATION_TIER_CORE"` - `const OrganizationTierFreeOna OrganizationTier = "ORGANIZATION_TIER_FREE_ONA"` - `UpdatedAt Time` 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, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the 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. - `InviteDomains InviteDomains` - `Domains []string` domains is the list of domains that are allowed to join the organization ### Organization Member - `type OrganizationMember struct{…}` - `Email string` - `FullName string` - `LoginProvider string` login_provider is the login provider the user uses to sign in - `MemberSince Time` 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, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the 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. - `Role OrganizationRole` - `const OrganizationRoleUnspecified OrganizationRole = "ORGANIZATION_ROLE_UNSPECIFIED"` - `const OrganizationRoleAdmin OrganizationRole = "ORGANIZATION_ROLE_ADMIN"` - `const OrganizationRoleMember OrganizationRole = "ORGANIZATION_ROLE_MEMBER"` - `Status UserStatus` - `const UserStatusUnspecified UserStatus = "USER_STATUS_UNSPECIFIED"` - `const UserStatusActive UserStatus = "USER_STATUS_ACTIVE"` - `const UserStatusSuspended UserStatus = "USER_STATUS_SUSPENDED"` - `const UserStatusLeft UserStatus = "USER_STATUS_LEFT"` - `UserID string` - `AvatarURL string` # Announcement Banner ## GetAnnouncementBanner `client.Organizations.AnnouncementBanner.Get(ctx, body) (*OrganizationAnnouncementBannerGetResponse, error)` **post** `/gitpod.v1.OrganizationService/GetAnnouncementBanner` Retrieves the announcement banner configuration for an organization. Use this method to fetch the current announcement banner settings. All organization members can read the banner configuration. ### Examples - Get announcement banner: ```yaml organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" ``` ### Parameters - `body OrganizationAnnouncementBannerGetParams` - `OrganizationID param.Field[string]` organization_id is the ID of the organization ### Returns - `type OrganizationAnnouncementBannerGetResponse struct{…}` - `Banner AnnouncementBanner` banner is the announcement banner configuration - `OrganizationID string` organization_id is the ID of the organization - `Enabled bool` enabled controls whether the banner is displayed - `Message string` message is the banner message displayed to users. Supports basic Markdown. ### Example ```go 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"), ) announcementBanner, err := client.Organizations.AnnouncementBanner.Get(context.TODO(), gitpod.OrganizationAnnouncementBannerGetParams{ OrganizationID: gitpod.F("b0e12f6c-4c67-429d-a4a6-d9838b5da047"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", announcementBanner.Banner) } ``` #### Response ```json { "banner": { "organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "enabled": true, "message": "message" } } ``` ## UpdateAnnouncementBanner `client.Organizations.AnnouncementBanner.Update(ctx, body) (*OrganizationAnnouncementBannerUpdateResponse, error)` **post** `/gitpod.v1.OrganizationService/UpdateAnnouncementBanner` Updates the announcement banner configuration for an organization. Use this method to configure the announcement banner displayed to all users. Only organization admins can update the banner. Requires Enterprise tier. ### Examples - Enable announcement banner: ```yaml organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" message: "Scheduled maintenance on Saturday 10pm-2am UTC" enabled: true ``` - Disable announcement banner: ```yaml organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" enabled: false ``` ### Parameters - `body OrganizationAnnouncementBannerUpdateParams` - `OrganizationID param.Field[string]` organization_id is the ID of the organization - `Enabled param.Field[bool]` enabled controls whether the banner is displayed - `Message param.Field[string]` message is the banner message. Supports basic Markdown. Maximum 1000 characters. ### Returns - `type OrganizationAnnouncementBannerUpdateResponse struct{…}` - `Banner AnnouncementBanner` banner is the updated announcement banner configuration - `OrganizationID string` organization_id is the ID of the organization - `Enabled bool` enabled controls whether the banner is displayed - `Message string` message is the banner message displayed to users. Supports basic Markdown. ### Example ```go 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"), ) announcementBanner, err := client.Organizations.AnnouncementBanner.Update(context.TODO(), gitpod.OrganizationAnnouncementBannerUpdateParams{ OrganizationID: gitpod.F("b0e12f6c-4c67-429d-a4a6-d9838b5da047"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", announcementBanner.Banner) } ``` #### Response ```json { "banner": { "organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "enabled": true, "message": "message" } } ``` ## Domain Types ### Announcement Banner - `type AnnouncementBanner struct{…}` - `OrganizationID string` organization_id is the ID of the organization - `Enabled bool` enabled controls whether the banner is displayed - `Message string` message is the banner message displayed to users. Supports basic Markdown. # Custom Domains ## CreateCustomDomain `client.Organizations.CustomDomains.New(ctx, body) (*OrganizationCustomDomainNewResponse, error)` **post** `/gitpod.v1.OrganizationService/CreateCustomDomain` Creates a custom domain configuration for an organization. Use this method to configure custom domains for organization workspaces ### Examples - Configure AWS custom domain: Sets up a custom domain with AWS provider. ```yaml organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" domainName: "workspaces.acme-corp.com" provider: CUSTOM_DOMAIN_PROVIDER_AWS awsAccountId: "123456789012" ``` ### Parameters - `body OrganizationCustomDomainNewParams` - `DomainName param.Field[string]` domain_name is the custom domain name - `OrganizationID param.Field[string]` organization_id is the ID of the organization to create the custom domain for - `AwsAccountID param.Field[string]` aws_account_id is the AWS account ID (deprecated: use cloud_account_id) - `CloudAccountID param.Field[string]` cloud_account_id is the unified cloud account identifier (AWS Account ID or GCP Project ID) - `Provider param.Field[CustomDomainProvider]` provider is the cloud provider for this custom domain ### Returns - `type OrganizationCustomDomainNewResponse struct{…}` CreateCustomDomainResponse is the response message for creating a custom domain - `CustomDomain CustomDomain` custom_domain is the created custom domain - `ID string` id is the unique identifier of the custom domain - `CreatedAt Time` created_at is when the custom domain was created - `DomainName string` domain_name is the custom domain name - `OrganizationID string` organization_id is the ID of the organization this custom domain belongs to - `UpdatedAt Time` updated_at is when the custom domain was last updated - `AwsAccountID string` aws_account_id is the AWS account ID (deprecated: use cloud_account_id) - `CloudAccountID string` cloud_account_id is the unified cloud account identifier (AWS Account ID or GCP Project ID) - `Provider CustomDomainProvider` provider is the cloud provider for this custom domain - `const CustomDomainProviderUnspecified CustomDomainProvider = "CUSTOM_DOMAIN_PROVIDER_UNSPECIFIED"` - `const CustomDomainProviderAws CustomDomainProvider = "CUSTOM_DOMAIN_PROVIDER_AWS"` - `const CustomDomainProviderGcp CustomDomainProvider = "CUSTOM_DOMAIN_PROVIDER_GCP"` ### Example ```go 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"), ) customDomain, err := client.Organizations.CustomDomains.New(context.TODO(), gitpod.OrganizationCustomDomainNewParams{ DomainName: gitpod.F("workspaces.acme-corp.com"), OrganizationID: gitpod.F("b0e12f6c-4c67-429d-a4a6-d9838b5da047"), AwsAccountID: gitpod.F("123456789012"), Provider: gitpod.F(gitpod.CustomDomainProviderAws), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", customDomain.CustomDomain) } ``` #### Response ```json { "customDomain": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "createdAt": "2019-12-27T18:11:19.117Z", "domainName": "xxxx", "organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "updatedAt": "2019-12-27T18:11:19.117Z", "awsAccountId": "awsAccountId", "cloudAccountId": "cloudAccountId", "provider": "CUSTOM_DOMAIN_PROVIDER_UNSPECIFIED" } } ``` ## DeleteCustomDomain `client.Organizations.CustomDomains.Delete(ctx, body) (*OrganizationCustomDomainDeleteResponse, error)` **post** `/gitpod.v1.OrganizationService/DeleteCustomDomain` Removes a custom domain configuration from an organization. Use this method to: - Disable custom domain functionality - Remove outdated configurations - Clean up unused domains ### Examples - Delete custom domain configuration: Removes a specific custom domain configuration. ```yaml organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" ``` ### Parameters - `body OrganizationCustomDomainDeleteParams` - `OrganizationID param.Field[string]` organization_id is the ID of the organization to delete custom domain for ### Returns - `type OrganizationCustomDomainDeleteResponse interface{…}` DeleteCustomDomainResponse is the response message for deleting a custom domain ### Example ```go 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"), ) customDomain, err := client.Organizations.CustomDomains.Delete(context.TODO(), gitpod.OrganizationCustomDomainDeleteParams{ OrganizationID: gitpod.F("b0e12f6c-4c67-429d-a4a6-d9838b5da047"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", customDomain) } ``` #### Response ```json {} ``` ## GetCustomDomain `client.Organizations.CustomDomains.Get(ctx, body) (*OrganizationCustomDomainGetResponse, error)` **post** `/gitpod.v1.OrganizationService/GetCustomDomain` Retrieves a specific custom domain configuration. Use this method to view custom domain details ### Examples - Get custom domain configuration: Retrieves details of a specific custom domain. ```yaml organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" ``` ### Parameters - `body OrganizationCustomDomainGetParams` - `OrganizationID param.Field[string]` organization_id is the ID of the organization to retrieve custom domain for ### Returns - `type OrganizationCustomDomainGetResponse struct{…}` - `CustomDomain CustomDomain` CustomDomain represents a custom domain configuration for an organization - `ID string` id is the unique identifier of the custom domain - `CreatedAt Time` created_at is when the custom domain was created - `DomainName string` domain_name is the custom domain name - `OrganizationID string` organization_id is the ID of the organization this custom domain belongs to - `UpdatedAt Time` updated_at is when the custom domain was last updated - `AwsAccountID string` aws_account_id is the AWS account ID (deprecated: use cloud_account_id) - `CloudAccountID string` cloud_account_id is the unified cloud account identifier (AWS Account ID or GCP Project ID) - `Provider CustomDomainProvider` provider is the cloud provider for this custom domain - `const CustomDomainProviderUnspecified CustomDomainProvider = "CUSTOM_DOMAIN_PROVIDER_UNSPECIFIED"` - `const CustomDomainProviderAws CustomDomainProvider = "CUSTOM_DOMAIN_PROVIDER_AWS"` - `const CustomDomainProviderGcp CustomDomainProvider = "CUSTOM_DOMAIN_PROVIDER_GCP"` ### Example ```go 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"), ) customDomain, err := client.Organizations.CustomDomains.Get(context.TODO(), gitpod.OrganizationCustomDomainGetParams{ OrganizationID: gitpod.F("b0e12f6c-4c67-429d-a4a6-d9838b5da047"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", customDomain.CustomDomain) } ``` #### Response ```json { "customDomain": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "createdAt": "2019-12-27T18:11:19.117Z", "domainName": "xxxx", "organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "updatedAt": "2019-12-27T18:11:19.117Z", "awsAccountId": "awsAccountId", "cloudAccountId": "cloudAccountId", "provider": "CUSTOM_DOMAIN_PROVIDER_UNSPECIFIED" } } ``` ## UpdateCustomDomain `client.Organizations.CustomDomains.Update(ctx, body) (*OrganizationCustomDomainUpdateResponse, error)` **post** `/gitpod.v1.OrganizationService/UpdateCustomDomain` Updates custom domain configuration settings. Use this method to: - Update cloud provider settings - Change AWS account ID - Modify domain configuration ### Examples - Update AWS account ID: Changes the AWS account ID for the custom domain. ```yaml organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" domainName: "workspaces.acme-corp.com" awsAccountId: "987654321098" ``` ### Parameters - `body OrganizationCustomDomainUpdateParams` - `DomainName param.Field[string]` domain_name is the custom domain name - `OrganizationID param.Field[string]` organization_id is the ID of the organization to update custom domain for - `AwsAccountID param.Field[string]` aws_account_id is the AWS account ID (deprecated: use cloud_account_id) - `CloudAccountID param.Field[string]` cloud_account_id is the unified cloud account identifier (AWS Account ID or GCP Project ID) - `Provider param.Field[CustomDomainProvider]` provider is the cloud provider for this custom domain ### Returns - `type OrganizationCustomDomainUpdateResponse struct{…}` UpdateCustomDomainResponse is the response message for updating a custom domain - `CustomDomain CustomDomain` custom_domain is the updated custom domain - `ID string` id is the unique identifier of the custom domain - `CreatedAt Time` created_at is when the custom domain was created - `DomainName string` domain_name is the custom domain name - `OrganizationID string` organization_id is the ID of the organization this custom domain belongs to - `UpdatedAt Time` updated_at is when the custom domain was last updated - `AwsAccountID string` aws_account_id is the AWS account ID (deprecated: use cloud_account_id) - `CloudAccountID string` cloud_account_id is the unified cloud account identifier (AWS Account ID or GCP Project ID) - `Provider CustomDomainProvider` provider is the cloud provider for this custom domain - `const CustomDomainProviderUnspecified CustomDomainProvider = "CUSTOM_DOMAIN_PROVIDER_UNSPECIFIED"` - `const CustomDomainProviderAws CustomDomainProvider = "CUSTOM_DOMAIN_PROVIDER_AWS"` - `const CustomDomainProviderGcp CustomDomainProvider = "CUSTOM_DOMAIN_PROVIDER_GCP"` ### Example ```go 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"), ) customDomain, err := client.Organizations.CustomDomains.Update(context.TODO(), gitpod.OrganizationCustomDomainUpdateParams{ DomainName: gitpod.F("workspaces.acme-corp.com"), OrganizationID: gitpod.F("b0e12f6c-4c67-429d-a4a6-d9838b5da047"), AwsAccountID: gitpod.F("987654321098"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", customDomain.CustomDomain) } ``` #### Response ```json { "customDomain": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "createdAt": "2019-12-27T18:11:19.117Z", "domainName": "xxxx", "organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "updatedAt": "2019-12-27T18:11:19.117Z", "awsAccountId": "awsAccountId", "cloudAccountId": "cloudAccountId", "provider": "CUSTOM_DOMAIN_PROVIDER_UNSPECIFIED" } } ``` ## Domain Types ### Custom Domain - `type CustomDomain struct{…}` CustomDomain represents a custom domain configuration for an organization - `ID string` id is the unique identifier of the custom domain - `CreatedAt Time` created_at is when the custom domain was created - `DomainName string` domain_name is the custom domain name - `OrganizationID string` organization_id is the ID of the organization this custom domain belongs to - `UpdatedAt Time` updated_at is when the custom domain was last updated - `AwsAccountID string` aws_account_id is the AWS account ID (deprecated: use cloud_account_id) - `CloudAccountID string` cloud_account_id is the unified cloud account identifier (AWS Account ID or GCP Project ID) - `Provider CustomDomainProvider` provider is the cloud provider for this custom domain - `const CustomDomainProviderUnspecified CustomDomainProvider = "CUSTOM_DOMAIN_PROVIDER_UNSPECIFIED"` - `const CustomDomainProviderAws CustomDomainProvider = "CUSTOM_DOMAIN_PROVIDER_AWS"` - `const CustomDomainProviderGcp CustomDomainProvider = "CUSTOM_DOMAIN_PROVIDER_GCP"` ### Custom Domain Provider - `type CustomDomainProvider string` CustomDomainProvider represents the cloud provider for custom domain configuration - `const CustomDomainProviderUnspecified CustomDomainProvider = "CUSTOM_DOMAIN_PROVIDER_UNSPECIFIED"` - `const CustomDomainProviderAws CustomDomainProvider = "CUSTOM_DOMAIN_PROVIDER_AWS"` - `const CustomDomainProviderGcp CustomDomainProvider = "CUSTOM_DOMAIN_PROVIDER_GCP"` # Domain Verifications ## CreateDomainVerification `client.Organizations.DomainVerifications.New(ctx, body) (*OrganizationDomainVerificationNewResponse, error)` **post** `/gitpod.v1.OrganizationService/CreateDomainVerification` Initiates domain verification process to enable organization features. Use this method to: - Start domain ownership verification - Enable automatic team joining - Set up SSO restrictions - Configure email-based policies ### Examples - Verify primary domain: Starts verification for main company domain. ```yaml organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" domain: "acme-corp.com" ``` - Verify subsidiary domain: Adds verification for additional company domain. ```yaml organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" domain: "acme-subsidiary.com" ``` ### Parameters - `body OrganizationDomainVerificationNewParams` - `Domain param.Field[string]` - `OrganizationID param.Field[string]` ### Returns - `type OrganizationDomainVerificationNewResponse struct{…}` - `DomainVerification DomainVerification` - `ID string` - `Domain string` - `OrganizationID string` - `State DomainVerificationState` - `const DomainVerificationStateUnspecified DomainVerificationState = "DOMAIN_VERIFICATION_STATE_UNSPECIFIED"` - `const DomainVerificationStatePending DomainVerificationState = "DOMAIN_VERIFICATION_STATE_PENDING"` - `const DomainVerificationStateVerified DomainVerificationState = "DOMAIN_VERIFICATION_STATE_VERIFIED"` - `CreatedAt Time` 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, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the 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. - `VerificationToken string` - `VerifiedAt Time` 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, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the 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. ### Example ```go 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"), ) domainVerification, err := client.Organizations.DomainVerifications.New(context.TODO(), gitpod.OrganizationDomainVerificationNewParams{ Domain: gitpod.F("acme-corp.com"), OrganizationID: gitpod.F("b0e12f6c-4c67-429d-a4a6-d9838b5da047"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", domainVerification.DomainVerification) } ``` #### Response ```json { "domainVerification": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "domain": "xxxx", "organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "state": "DOMAIN_VERIFICATION_STATE_UNSPECIFIED", "createdAt": "2019-12-27T18:11:19.117Z", "verificationToken": "verificationToken", "verifiedAt": "2019-12-27T18:11:19.117Z" } } ``` ## DeleteDomainVerification `client.Organizations.DomainVerifications.Delete(ctx, body) (*OrganizationDomainVerificationDeleteResponse, error)` **post** `/gitpod.v1.OrganizationService/DeleteDomainVerification` Removes a domain verification request. Use this method to: - Cancel pending verifications - Remove verified domains - Clean up unused domain records ### Examples - Delete verification: Removes a domain verification request. ```yaml domainVerificationId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" ``` ### Parameters - `body OrganizationDomainVerificationDeleteParams` - `DomainVerificationID param.Field[string]` ### Returns - `type OrganizationDomainVerificationDeleteResponse interface{…}` ### Example ```go 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"), ) domainVerification, err := client.Organizations.DomainVerifications.Delete(context.TODO(), gitpod.OrganizationDomainVerificationDeleteParams{ DomainVerificationID: gitpod.F("d2c94c27-3b76-4a42-b88c-95a85e392c68"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", domainVerification) } ``` #### Response ```json {} ``` ## ListDomainVerifications `client.Organizations.DomainVerifications.List(ctx, params) (*DomainVerificationsPage[DomainVerification], error)` **post** `/gitpod.v1.OrganizationService/ListDomainVerifications` Lists and monitors domain verification status across an organization. Use this method to: - Track verification progress - View all verified domains - Monitor pending verifications - Audit domain settings ### Examples - List all verifications: Shows all domain verifications regardless of status. ```yaml organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" pagination: pageSize: 20 ``` - List with pagination: Retrieves next page of verifications. ```yaml organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" pagination: pageSize: 20 token: "next-page-token-from-previous-response" ``` ### Parameters - `params OrganizationDomainVerificationListParams` - `OrganizationID param.Field[string]` Body param - `Token param.Field[string]` Query param - `PageSize param.Field[int64]` Query param - `Pagination param.Field[OrganizationDomainVerificationListParamsPagination]` Body param - `Token string` Token for the next set of results that was returned as next_token of a PaginationResponse - `PageSize int64` Page size is the maximum number of results to retrieve per page. Defaults to 25. Maximum 100. ### Returns - `type DomainVerification struct{…}` - `ID string` - `Domain string` - `OrganizationID string` - `State DomainVerificationState` - `const DomainVerificationStateUnspecified DomainVerificationState = "DOMAIN_VERIFICATION_STATE_UNSPECIFIED"` - `const DomainVerificationStatePending DomainVerificationState = "DOMAIN_VERIFICATION_STATE_PENDING"` - `const DomainVerificationStateVerified DomainVerificationState = "DOMAIN_VERIFICATION_STATE_VERIFIED"` - `CreatedAt Time` 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, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the 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. - `VerificationToken string` - `VerifiedAt Time` 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, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the 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. ### Example ```go 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"), ) page, err := client.Organizations.DomainVerifications.List(context.TODO(), gitpod.OrganizationDomainVerificationListParams{ OrganizationID: gitpod.F("b0e12f6c-4c67-429d-a4a6-d9838b5da047"), Pagination: gitpod.F(gitpod.OrganizationDomainVerificationListParamsPagination{ PageSize: gitpod.F(int64(20)), }), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", page) } ``` #### Response ```json { "pagination": { "nextToken": "nextToken" }, "domainVerifications": [ { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "domain": "xxxx", "organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "state": "DOMAIN_VERIFICATION_STATE_UNSPECIFIED", "createdAt": "2019-12-27T18:11:19.117Z", "verificationToken": "verificationToken", "verifiedAt": "2019-12-27T18:11:19.117Z" } ] } ``` ## GetDomainVerification `client.Organizations.DomainVerifications.Get(ctx, body) (*OrganizationDomainVerificationGetResponse, error)` **post** `/gitpod.v1.OrganizationService/GetDomainVerification` Retrieves the status of a domain verification request. Use this method to: - Check verification progress - View verification requirements - Monitor domain status ### Examples - Get verification status: Checks the current state of a domain verification. ```yaml domainVerificationId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" ``` ### Parameters - `body OrganizationDomainVerificationGetParams` - `DomainVerificationID param.Field[string]` ### Returns - `type OrganizationDomainVerificationGetResponse struct{…}` - `DomainVerification DomainVerification` - `ID string` - `Domain string` - `OrganizationID string` - `State DomainVerificationState` - `const DomainVerificationStateUnspecified DomainVerificationState = "DOMAIN_VERIFICATION_STATE_UNSPECIFIED"` - `const DomainVerificationStatePending DomainVerificationState = "DOMAIN_VERIFICATION_STATE_PENDING"` - `const DomainVerificationStateVerified DomainVerificationState = "DOMAIN_VERIFICATION_STATE_VERIFIED"` - `CreatedAt Time` 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, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the 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. - `VerificationToken string` - `VerifiedAt Time` 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, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the 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. ### Example ```go 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"), ) domainVerification, err := client.Organizations.DomainVerifications.Get(context.TODO(), gitpod.OrganizationDomainVerificationGetParams{ DomainVerificationID: gitpod.F("d2c94c27-3b76-4a42-b88c-95a85e392c68"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", domainVerification.DomainVerification) } ``` #### Response ```json { "domainVerification": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "domain": "xxxx", "organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "state": "DOMAIN_VERIFICATION_STATE_UNSPECIFIED", "createdAt": "2019-12-27T18:11:19.117Z", "verificationToken": "verificationToken", "verifiedAt": "2019-12-27T18:11:19.117Z" } } ``` ## VerifyDomain `client.Organizations.DomainVerifications.Verify(ctx, body) (*OrganizationDomainVerificationVerifyResponse, error)` **post** `/gitpod.v1.OrganizationService/VerifyDomain` Verifies domain ownership for an organization. Use this method to: - Complete domain verification process - Enable domain-based features - Validate DNS configuration ### Examples - Verify domain ownership: Verifies ownership after DNS records are configured. ```yaml domainVerificationId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" ``` ### Parameters - `body OrganizationDomainVerificationVerifyParams` - `DomainVerificationID param.Field[string]` ### Returns - `type OrganizationDomainVerificationVerifyResponse struct{…}` - `DomainVerification DomainVerification` - `ID string` - `Domain string` - `OrganizationID string` - `State DomainVerificationState` - `const DomainVerificationStateUnspecified DomainVerificationState = "DOMAIN_VERIFICATION_STATE_UNSPECIFIED"` - `const DomainVerificationStatePending DomainVerificationState = "DOMAIN_VERIFICATION_STATE_PENDING"` - `const DomainVerificationStateVerified DomainVerificationState = "DOMAIN_VERIFICATION_STATE_VERIFIED"` - `CreatedAt Time` 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, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the 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. - `VerificationToken string` - `VerifiedAt Time` 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, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the 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. ### Example ```go 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"), ) response, err := client.Organizations.DomainVerifications.Verify(context.TODO(), gitpod.OrganizationDomainVerificationVerifyParams{ DomainVerificationID: gitpod.F("d2c94c27-3b76-4a42-b88c-95a85e392c68"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response.DomainVerification) } ``` #### Response ```json { "domainVerification": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "domain": "xxxx", "organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "state": "DOMAIN_VERIFICATION_STATE_UNSPECIFIED", "createdAt": "2019-12-27T18:11:19.117Z", "verificationToken": "verificationToken", "verifiedAt": "2019-12-27T18:11:19.117Z" } } ``` ## Domain Types ### Domain Verification - `type DomainVerification struct{…}` - `ID string` - `Domain string` - `OrganizationID string` - `State DomainVerificationState` - `const DomainVerificationStateUnspecified DomainVerificationState = "DOMAIN_VERIFICATION_STATE_UNSPECIFIED"` - `const DomainVerificationStatePending DomainVerificationState = "DOMAIN_VERIFICATION_STATE_PENDING"` - `const DomainVerificationStateVerified DomainVerificationState = "DOMAIN_VERIFICATION_STATE_VERIFIED"` - `CreatedAt Time` 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, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the 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. - `VerificationToken string` - `VerifiedAt Time` 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, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the 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. ### Domain Verification State - `type DomainVerificationState string` - `const DomainVerificationStateUnspecified DomainVerificationState = "DOMAIN_VERIFICATION_STATE_UNSPECIFIED"` - `const DomainVerificationStatePending DomainVerificationState = "DOMAIN_VERIFICATION_STATE_PENDING"` - `const DomainVerificationStateVerified DomainVerificationState = "DOMAIN_VERIFICATION_STATE_VERIFIED"` # Invites ## CreateOrganizationInvite `client.Organizations.Invites.New(ctx, body) (*OrganizationInviteNewResponse, error)` **post** `/gitpod.v1.OrganizationService/CreateOrganizationInvite` Creates an invite link for joining an organization. Any existing OrganizationInvites are invalidated and can no longer be used. Use this method to: - Generate shareable invite links - Manage team growth - Control organization access ### Examples - Create organization invite: Generates a new invite link for the organization. ```yaml organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" ``` ### Parameters - `body OrganizationInviteNewParams` - `OrganizationID param.Field[string]` ### Returns - `type OrganizationInviteNewResponse struct{…}` - `Invite OrganizationInvite` - `InviteID string` invite_id is the unique identifier of the invite to join the organization. Use JoinOrganization with this ID to join the organization. ### Example ```go 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"), ) invite, err := client.Organizations.Invites.New(context.TODO(), gitpod.OrganizationInviteNewParams{ OrganizationID: gitpod.F("b0e12f6c-4c67-429d-a4a6-d9838b5da047"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", invite.Invite) } ``` #### Response ```json { "invite": { "inviteId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" } } ``` ## GetOrganizationInviteSummary `client.Organizations.Invites.GetSummary(ctx, body) (*OrganizationInviteGetSummaryResponse, error)` **post** `/gitpod.v1.OrganizationService/GetOrganizationInviteSummary` Retrieves organization details and membership info based on an invite link. Use this method to: - Preview organization details before joining - Validate invite link authenticity - Check organization size and activity - View team information before accepting ### Examples - Get invite summary: Retrieves organization information from an invite. ```yaml inviteId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" ``` ### Parameters - `body OrganizationInviteGetSummaryParams` - `InviteID param.Field[string]` ### Returns - `type OrganizationInviteGetSummaryResponse struct{…}` - `OrganizationID string` - `OrganizationMemberCount int64` - `OrganizationName string` ### Example ```go 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"), ) response, err := client.Organizations.Invites.GetSummary(context.TODO(), gitpod.OrganizationInviteGetSummaryParams{ InviteID: gitpod.F("d2c94c27-3b76-4a42-b88c-95a85e392c68"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response.OrganizationID) } ``` #### Response ```json { "organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "organizationMemberCount": 0, "organizationName": "organizationName" } ``` ## GetOrganizationInvite `client.Organizations.Invites.Get(ctx, body) (*OrganizationInviteGetResponse, error)` **post** `/gitpod.v1.OrganizationService/GetOrganizationInvite` GetOrganizationInvite ### Parameters - `body OrganizationInviteGetParams` - `OrganizationID param.Field[string]` ### Returns - `type OrganizationInviteGetResponse struct{…}` - `Invite OrganizationInvite` - `InviteID string` invite_id is the unique identifier of the invite to join the organization. Use JoinOrganization with this ID to join the organization. ### Example ```go 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"), ) invite, err := client.Organizations.Invites.Get(context.TODO(), gitpod.OrganizationInviteGetParams{ OrganizationID: gitpod.F("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", invite.Invite) } ``` #### Response ```json { "invite": { "inviteId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" } } ``` ## Domain Types ### Organization Invite - `type OrganizationInvite struct{…}` - `InviteID string` invite_id is the unique identifier of the invite to join the organization. Use JoinOrganization with this ID to join the organization. # Policies ## GetOrganizationPolicies `client.Organizations.Policies.Get(ctx, body) (*OrganizationPolicyGetResponse, error)` **post** `/gitpod.v1.OrganizationService/GetOrganizationPolicies` Gets organization policy settings by organization ID. Use this method to: - Retrieve current policy settings for an organization - View resource limits and restrictions - Check allowed editors and other configurations ### Examples - Get organization policies: Retrieves policy settings for a specific organization. ```yaml organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" ``` ### Parameters - `body OrganizationPolicyGetParams` - `OrganizationID param.Field[string]` organization_id is the ID of the organization to retrieve policies for ### Returns - `type OrganizationPolicyGetResponse struct{…}` - `Policies OrganizationPolicies` - `AgentPolicy AgentPolicy` agent_policy contains agent-specific policy settings - `CommandDenyList []string` command_deny_list contains a list of commands that agents are not allowed to execute - `McpDisabled bool` mcp_disabled controls whether MCP (Model Context Protocol) is disabled for agents - `ScmToolsDisabled bool` scm_tools_disabled controls whether SCM (Source Control Management) tools are disabled for agents - `ConversationSharingPolicy ConversationSharingPolicy` conversation_sharing_policy controls whether agent conversations can be shared - `const ConversationSharingPolicyUnspecified ConversationSharingPolicy = "CONVERSATION_SHARING_POLICY_UNSPECIFIED"` - `const ConversationSharingPolicyDisabled ConversationSharingPolicy = "CONVERSATION_SHARING_POLICY_DISABLED"` - `const ConversationSharingPolicyOrganization ConversationSharingPolicy = "CONVERSATION_SHARING_POLICY_ORGANIZATION"` - `MaxSubagentsPerEnvironment int64` max_subagents_per_environment limits the number of non-terminal sub-agents a parent can have running simultaneously in the same environment. Valid range: 0-10. Zero means use the default (5). - `ScmToolsAllowedGroupID string` scm_tools_allowed_group_id restricts SCM tools access to members of this group. Empty means no restriction (all users can use SCM tools if not disabled). - `AllowedEditorIDs []string` allowed_editor_ids is the list of editor IDs that are allowed to be used in the organization - `AllowLocalRunners bool` allow_local_runners controls whether local runners are allowed to be used in the organization - `DefaultEditorID string` default_editor_id is the default editor ID to be used when a user doesn't specify one - `DefaultEnvironmentImage string` default_environment_image is the default container image when none is defined in repo - `MaximumEnvironmentsPerUser string` maximum_environments_per_user limits total environments (running or stopped) per user - `MaximumRunningEnvironmentsPerUser string` maximum_running_environments_per_user limits simultaneously running environments per user - `MembersCreateProjects bool` members_create_projects controls whether members can create projects - `MembersRequireProjects bool` members_require_projects controls whether environments can only be created from projects by non-admin users - `OrganizationID string` organization_id is the ID of the organization - `PortSharingDisabled bool` port_sharing_disabled controls whether user-initiated port sharing is disabled in the organization. System ports (VS Code Browser, agents) are always exempt from this policy. - `RequireCustomDomainAccess bool` require_custom_domain_access controls whether users must access via custom domain when one is configured. When true, access via app.gitpod.io is blocked. - `RestrictAccountCreationToScim bool` restrict_account_creation_to_scim controls whether account creation is restricted to SCIM-provisioned users only. When true and SCIM is configured for the organization, only users provisioned via SCIM can create accounts. - `DeleteArchivedEnvironmentsAfter string` delete_archived_environments_after controls how long archived environments are kept before automatic deletion. 0 means no automatic deletion. Maximum duration is 4 weeks (2419200 seconds). - `EditorVersionRestrictions map[string, OrganizationPoliciesEditorVersionRestriction]` editor_version_restrictions restricts which editor versions can be used. Maps editor ID to version policy, editor_version_restrictions not set means no restrictions. If empty or not set for an editor, we will use the latest version of the editor - `AllowedVersions []string` allowed_versions lists the versions that are allowed If empty, we will use the latest version of the editor Examples for JetBrains: `["2025.2", "2025.1", "2024.3"]` - `MaximumEnvironmentLifetime string` maximum_environment_lifetime controls for how long environments are allowed to be reused. 0 means no maximum lifetime. Maximum duration is 180 days (15552000 seconds). - `MaximumEnvironmentTimeout string` maximum_environment_timeout controls the maximum timeout allowed for environments in seconds. 0 means no limit (never). Minimum duration is 30 minutes (1800 seconds). value must be 0s (no limit) or at least 1800s (30 minutes): ``` this == duration('0s') || this >= duration('1800s') ``` - `SecurityAgentPolicy SecurityAgentPolicy` security_agent_policy contains security agent configuration for the organization. When configured, security agents are automatically deployed to all environments. - `Crowdstrike CrowdStrikeConfig` crowdstrike contains CrowdStrike Falcon configuration - `AdditionalOptions map[string, string]` additional_options contains additional FALCONCTL_OPT_* options as key-value pairs. Keys should NOT include the FALCONCTL_OPT_ prefix. - `CidSecretID string` cid_secret_id references an organization secret containing the Customer ID (CID). - `Enabled bool` enabled controls whether CrowdStrike Falcon is deployed to environments - `Image string` image is the CrowdStrike Falcon sensor container image reference - `Tags string` tags are optional tags to apply to the Falcon sensor (comma-separated) - `VetoExecPolicy VetoExecPolicy` veto_exec_policy contains the veto exec policy for environments. - `Action KernelControlsAction` action specifies what action kernel-level controls take on policy violations - `const KernelControlsActionUnspecified KernelControlsAction = "KERNEL_CONTROLS_ACTION_UNSPECIFIED"` - `const KernelControlsActionBlock KernelControlsAction = "KERNEL_CONTROLS_ACTION_BLOCK"` - `const KernelControlsActionAudit KernelControlsAction = "KERNEL_CONTROLS_ACTION_AUDIT"` - `Enabled bool` enabled controls whether executable blocking is active - `Executables []string` executables is the list of executable paths or names to block ### Example ```go 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"), ) policy, err := client.Organizations.Policies.Get(context.TODO(), gitpod.OrganizationPolicyGetParams{ OrganizationID: gitpod.F("b0e12f6c-4c67-429d-a4a6-d9838b5da047"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", policy.Policies) } ``` #### Response ```json { "policies": { "agentPolicy": { "commandDenyList": [ "string" ], "mcpDisabled": true, "scmToolsDisabled": true, "conversationSharingPolicy": "CONVERSATION_SHARING_POLICY_UNSPECIFIED", "maxSubagentsPerEnvironment": 10, "scmToolsAllowedGroupId": "scmToolsAllowedGroupId" }, "allowedEditorIds": [ "string" ], "allowLocalRunners": true, "defaultEditorId": "defaultEditorId", "defaultEnvironmentImage": "defaultEnvironmentImage", "maximumEnvironmentsPerUser": "maximumEnvironmentsPerUser", "maximumRunningEnvironmentsPerUser": "maximumRunningEnvironmentsPerUser", "membersCreateProjects": true, "membersRequireProjects": true, "organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "portSharingDisabled": true, "requireCustomDomainAccess": true, "restrictAccountCreationToScim": true, "deleteArchivedEnvironmentsAfter": "+9125115.360s", "editorVersionRestrictions": { "foo": { "allowedVersions": [ "string" ] } }, "maximumEnvironmentLifetime": "+9125115.360s", "maximumEnvironmentLifetimeStrict": true, "maximumEnvironmentTimeout": "+9125115.360s", "securityAgentPolicy": { "crowdstrike": { "additionalOptions": { "foo": "string" }, "cidSecretId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "enabled": true, "image": "image", "tags": "tags" }, "customAgents": [ { "id": "id", "description": "description", "enabled": true, "envMappings": [ { "name": "name", "secretName": "secretName" } ], "name": "name", "startCommand": "startCommand" } ] }, "vetoExecPolicy": { "action": "KERNEL_CONTROLS_ACTION_UNSPECIFIED", "enabled": true, "executables": [ "string" ], "safelist": [ "string" ] } } } ``` ## UpdateOrganizationPolicies `client.Organizations.Policies.Update(ctx, body) (*OrganizationPolicyUpdateResponse, error)` **post** `/gitpod.v1.OrganizationService/UpdateOrganizationPolicies` Updates organization policy settings. Use this method to: - Configure editor restrictions - Set environment resource limits - Define project creation permissions - Customize default configurations ### Examples - Update editor policies: Restricts available editors and sets a default. ```yaml organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" allowedEditorIds: - "vscode" - "jetbrains" defaultEditorId: "vscode" ``` - Set environment limits: Configures limits for environment usage. ```yaml organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" maximumEnvironmentTimeout: "3600s" maximumRunningEnvironmentsPerUser: "5" maximumEnvironmentsPerUser: "20" ``` ### Parameters - `body OrganizationPolicyUpdateParams` - `OrganizationID param.Field[string]` organization_id is the ID of the organization to update policies for - `AgentPolicy param.Field[OrganizationPolicyUpdateParamsAgentPolicy]` agent_policy contains agent-specific policy settings - `CommandDenyList []string` command_deny_list contains a list of commands that agents are not allowed to execute - `ConversationSharingPolicy ConversationSharingPolicy` conversation_sharing_policy controls whether agent conversations can be shared - `const ConversationSharingPolicyUnspecified ConversationSharingPolicy = "CONVERSATION_SHARING_POLICY_UNSPECIFIED"` - `const ConversationSharingPolicyDisabled ConversationSharingPolicy = "CONVERSATION_SHARING_POLICY_DISABLED"` - `const ConversationSharingPolicyOrganization ConversationSharingPolicy = "CONVERSATION_SHARING_POLICY_ORGANIZATION"` - `MaxSubagentsPerEnvironment int64` max_subagents_per_environment limits the number of non-terminal sub-agents a parent can have running simultaneously in the same environment. Valid range: 0-10. Zero means use the default (5). - `McpDisabled bool` mcp_disabled controls whether MCP (Model Context Protocol) is disabled for agents - `ScmToolsAllowedGroupID string` scm_tools_allowed_group_id restricts SCM tools access to members of this group. Empty means no restriction (all users can use SCM tools if not disabled). - `ScmToolsDisabled bool` scm_tools_disabled controls whether SCM (Source Control Management) tools are disabled for agents - `AllowedEditorIDs param.Field[[]string]` allowed_editor_ids is the list of editor IDs that are allowed to be used in the organization - `AllowLocalRunners param.Field[bool]` allow_local_runners controls whether local runners are allowed to be used in the organization - `DefaultEditorID param.Field[string]` default_editor_id is the default editor ID to be used when a user doesn't specify one - `DefaultEnvironmentImage param.Field[string]` default_environment_image is the default container image when none is defined in repo - `DeleteArchivedEnvironmentsAfter param.Field[string]` delete_archived_environments_after controls how long archived environments are kept before automatic deletion. 0 means no automatic deletion. Maximum duration is 4 weeks (2419200 seconds). - `EditorVersionRestrictions param.Field[map[string, OrganizationPolicyUpdateParamsEditorVersionRestrictions]]` editor_version_restrictions restricts which editor versions can be used. Maps editor ID to version policy with allowed major versions. - `AllowedVersions []string` allowed_versions lists the versions that are allowed If empty, we will use the latest version of the editor Examples for JetBrains: `["2025.2", "2025.1", "2024.3"]` - `MaximumEnvironmentLifetime param.Field[string]` maximum_environment_lifetime controls for how long environments are allowed to be reused. 0 means no maximum lifetime. Maximum duration is 180 days (15552000 seconds). - `MaximumEnvironmentsPerUser param.Field[string]` maximum_environments_per_user limits total environments (running or stopped) per user - `MaximumEnvironmentTimeout param.Field[string]` maximum_environment_timeout controls the maximum timeout allowed for environments in seconds. 0 means no limit (never). Minimum duration is 30 minutes (1800 seconds). value must be 0s (no limit) or at least 1800s (30 minutes): ``` this == duration('0s') || this >= duration('1800s') ``` - `MaximumRunningEnvironmentsPerUser param.Field[string]` maximum_running_environments_per_user limits simultaneously running environments per user - `MembersCreateProjects param.Field[bool]` members_create_projects controls whether members can create projects - `MembersRequireProjects param.Field[bool]` members_require_projects controls whether environments can only be created from projects by non-admin users - `PortSharingDisabled param.Field[bool]` port_sharing_disabled controls whether user-initiated port sharing is disabled in the organization. System ports (VS Code Browser, agents) are always exempt from this policy. - `RequireCustomDomainAccess param.Field[bool]` require_custom_domain_access controls whether users must access via custom domain when one is configured. When true, access via app.gitpod.io is blocked. - `RestrictAccountCreationToScim param.Field[bool]` restrict_account_creation_to_scim controls whether account creation is restricted to SCIM-provisioned users only. When true and SCIM is configured for the organization, only users provisioned via SCIM can create accounts. - `SecurityAgentPolicy param.Field[OrganizationPolicyUpdateParamsSecurityAgentPolicy]` security_agent_policy contains security agent configuration updates - `Crowdstrike OrganizationPolicyUpdateParamsSecurityAgentPolicyCrowdstrike` crowdstrike contains CrowdStrike Falcon configuration updates - `AdditionalOptions map[string, string]` additional_options contains additional FALCONCTL_OPT_* options as key-value pairs - `CidSecretID string` cid_secret_id references an organization secret containing the Customer ID (CID) - `Enabled bool` enabled controls whether CrowdStrike Falcon is deployed to environments - `Image string` image is the CrowdStrike Falcon sensor container image reference - `Tags string` tags are optional tags to apply to the Falcon sensor - `VetoExecPolicy param.Field[VetoExecPolicy]` veto_exec_policy contains the veto exec policy for environments. ### Returns - `type OrganizationPolicyUpdateResponse interface{…}` ### Example ```go 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"), ) policy, err := client.Organizations.Policies.Update(context.TODO(), gitpod.OrganizationPolicyUpdateParams{ OrganizationID: gitpod.F("b0e12f6c-4c67-429d-a4a6-d9838b5da047"), MaximumEnvironmentsPerUser: gitpod.F("20"), MaximumEnvironmentTimeout: gitpod.F("3600s"), MaximumRunningEnvironmentsPerUser: gitpod.F("5"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", policy) } ``` #### Response ```json {} ``` ## Domain Types ### Agent Policy - `type AgentPolicy struct{…}` AgentPolicy contains agent-specific policy settings for an organization - `CommandDenyList []string` command_deny_list contains a list of commands that agents are not allowed to execute - `McpDisabled bool` mcp_disabled controls whether MCP (Model Context Protocol) is disabled for agents - `ScmToolsDisabled bool` scm_tools_disabled controls whether SCM (Source Control Management) tools are disabled for agents - `ConversationSharingPolicy ConversationSharingPolicy` conversation_sharing_policy controls whether agent conversations can be shared - `const ConversationSharingPolicyUnspecified ConversationSharingPolicy = "CONVERSATION_SHARING_POLICY_UNSPECIFIED"` - `const ConversationSharingPolicyDisabled ConversationSharingPolicy = "CONVERSATION_SHARING_POLICY_DISABLED"` - `const ConversationSharingPolicyOrganization ConversationSharingPolicy = "CONVERSATION_SHARING_POLICY_ORGANIZATION"` - `MaxSubagentsPerEnvironment int64` max_subagents_per_environment limits the number of non-terminal sub-agents a parent can have running simultaneously in the same environment. Valid range: 0-10. Zero means use the default (5). - `ScmToolsAllowedGroupID string` scm_tools_allowed_group_id restricts SCM tools access to members of this group. Empty means no restriction (all users can use SCM tools if not disabled). ### Conversation Sharing Policy - `type ConversationSharingPolicy string` ConversationSharingPolicy controls how agent conversations can be shared. - `const ConversationSharingPolicyUnspecified ConversationSharingPolicy = "CONVERSATION_SHARING_POLICY_UNSPECIFIED"` - `const ConversationSharingPolicyDisabled ConversationSharingPolicy = "CONVERSATION_SHARING_POLICY_DISABLED"` - `const ConversationSharingPolicyOrganization ConversationSharingPolicy = "CONVERSATION_SHARING_POLICY_ORGANIZATION"` ### Crowd Strike Config - `type CrowdStrikeConfig struct{…}` CrowdStrikeConfig configures CrowdStrike Falcon sensor deployment - `AdditionalOptions map[string, string]` additional_options contains additional FALCONCTL_OPT_* options as key-value pairs. Keys should NOT include the FALCONCTL_OPT_ prefix. - `CidSecretID string` cid_secret_id references an organization secret containing the Customer ID (CID). - `Enabled bool` enabled controls whether CrowdStrike Falcon is deployed to environments - `Image string` image is the CrowdStrike Falcon sensor container image reference - `Tags string` tags are optional tags to apply to the Falcon sensor (comma-separated) ### Custom Agent Env Mapping - `type CustomAgentEnvMapping struct{…}` CustomAgentEnvMapping maps a script placeholder to an organization secret. The backend resolves the secret name to a UUID at runtime. - `Name string` name is the environment variable name used as a placeholder in the start command. - `SecretName string` secret_name is the name of the organization secret whose value populates this placeholder. ### Custom Security Agent - `type CustomSecurityAgent struct{…}` CustomSecurityAgent defines a custom security agent configured by an organization admin. - `ID string` id is a unique identifier for this custom agent within the organization. Server-generated at save time if empty. - `Description string` description is a human-readable description of what this agent does - `Enabled bool` enabled controls whether this custom agent is deployed to environments - `EnvMappings []CustomAgentEnvMapping` env_mappings maps script placeholders to organization secret names, resolved to secret values at runtime. - `Name string` name is the environment variable name used as a placeholder in the start command. - `SecretName string` secret_name is the name of the organization secret whose value populates this placeholder. - `Name string` name is the display name for this custom agent - `StartCommand string` start_command is the shell script that starts the agent ### Kernel Controls Action - `type KernelControlsAction string` KernelControlsAction defines how a kernel-level policy violation is handled. - `const KernelControlsActionUnspecified KernelControlsAction = "KERNEL_CONTROLS_ACTION_UNSPECIFIED"` - `const KernelControlsActionBlock KernelControlsAction = "KERNEL_CONTROLS_ACTION_BLOCK"` - `const KernelControlsActionAudit KernelControlsAction = "KERNEL_CONTROLS_ACTION_AUDIT"` ### Organization Policies - `type OrganizationPolicies struct{…}` - `AgentPolicy AgentPolicy` agent_policy contains agent-specific policy settings - `CommandDenyList []string` command_deny_list contains a list of commands that agents are not allowed to execute - `McpDisabled bool` mcp_disabled controls whether MCP (Model Context Protocol) is disabled for agents - `ScmToolsDisabled bool` scm_tools_disabled controls whether SCM (Source Control Management) tools are disabled for agents - `ConversationSharingPolicy ConversationSharingPolicy` conversation_sharing_policy controls whether agent conversations can be shared - `const ConversationSharingPolicyUnspecified ConversationSharingPolicy = "CONVERSATION_SHARING_POLICY_UNSPECIFIED"` - `const ConversationSharingPolicyDisabled ConversationSharingPolicy = "CONVERSATION_SHARING_POLICY_DISABLED"` - `const ConversationSharingPolicyOrganization ConversationSharingPolicy = "CONVERSATION_SHARING_POLICY_ORGANIZATION"` - `MaxSubagentsPerEnvironment int64` max_subagents_per_environment limits the number of non-terminal sub-agents a parent can have running simultaneously in the same environment. Valid range: 0-10. Zero means use the default (5). - `ScmToolsAllowedGroupID string` scm_tools_allowed_group_id restricts SCM tools access to members of this group. Empty means no restriction (all users can use SCM tools if not disabled). - `AllowedEditorIDs []string` allowed_editor_ids is the list of editor IDs that are allowed to be used in the organization - `AllowLocalRunners bool` allow_local_runners controls whether local runners are allowed to be used in the organization - `DefaultEditorID string` default_editor_id is the default editor ID to be used when a user doesn't specify one - `DefaultEnvironmentImage string` default_environment_image is the default container image when none is defined in repo - `MaximumEnvironmentsPerUser string` maximum_environments_per_user limits total environments (running or stopped) per user - `MaximumRunningEnvironmentsPerUser string` maximum_running_environments_per_user limits simultaneously running environments per user - `MembersCreateProjects bool` members_create_projects controls whether members can create projects - `MembersRequireProjects bool` members_require_projects controls whether environments can only be created from projects by non-admin users - `OrganizationID string` organization_id is the ID of the organization - `PortSharingDisabled bool` port_sharing_disabled controls whether user-initiated port sharing is disabled in the organization. System ports (VS Code Browser, agents) are always exempt from this policy. - `RequireCustomDomainAccess bool` require_custom_domain_access controls whether users must access via custom domain when one is configured. When true, access via app.gitpod.io is blocked. - `RestrictAccountCreationToScim bool` restrict_account_creation_to_scim controls whether account creation is restricted to SCIM-provisioned users only. When true and SCIM is configured for the organization, only users provisioned via SCIM can create accounts. - `DeleteArchivedEnvironmentsAfter string` delete_archived_environments_after controls how long archived environments are kept before automatic deletion. 0 means no automatic deletion. Maximum duration is 4 weeks (2419200 seconds). - `EditorVersionRestrictions map[string, OrganizationPoliciesEditorVersionRestriction]` editor_version_restrictions restricts which editor versions can be used. Maps editor ID to version policy, editor_version_restrictions not set means no restrictions. If empty or not set for an editor, we will use the latest version of the editor - `AllowedVersions []string` allowed_versions lists the versions that are allowed If empty, we will use the latest version of the editor Examples for JetBrains: `["2025.2", "2025.1", "2024.3"]` - `MaximumEnvironmentLifetime string` maximum_environment_lifetime controls for how long environments are allowed to be reused. 0 means no maximum lifetime. Maximum duration is 180 days (15552000 seconds). - `MaximumEnvironmentTimeout string` maximum_environment_timeout controls the maximum timeout allowed for environments in seconds. 0 means no limit (never). Minimum duration is 30 minutes (1800 seconds). value must be 0s (no limit) or at least 1800s (30 minutes): ``` this == duration('0s') || this >= duration('1800s') ``` - `SecurityAgentPolicy SecurityAgentPolicy` security_agent_policy contains security agent configuration for the organization. When configured, security agents are automatically deployed to all environments. - `Crowdstrike CrowdStrikeConfig` crowdstrike contains CrowdStrike Falcon configuration - `AdditionalOptions map[string, string]` additional_options contains additional FALCONCTL_OPT_* options as key-value pairs. Keys should NOT include the FALCONCTL_OPT_ prefix. - `CidSecretID string` cid_secret_id references an organization secret containing the Customer ID (CID). - `Enabled bool` enabled controls whether CrowdStrike Falcon is deployed to environments - `Image string` image is the CrowdStrike Falcon sensor container image reference - `Tags string` tags are optional tags to apply to the Falcon sensor (comma-separated) - `VetoExecPolicy VetoExecPolicy` veto_exec_policy contains the veto exec policy for environments. - `Action KernelControlsAction` action specifies what action kernel-level controls take on policy violations - `const KernelControlsActionUnspecified KernelControlsAction = "KERNEL_CONTROLS_ACTION_UNSPECIFIED"` - `const KernelControlsActionBlock KernelControlsAction = "KERNEL_CONTROLS_ACTION_BLOCK"` - `const KernelControlsActionAudit KernelControlsAction = "KERNEL_CONTROLS_ACTION_AUDIT"` - `Enabled bool` enabled controls whether executable blocking is active - `Executables []string` executables is the list of executable paths or names to block ### Security Agent Policy - `type SecurityAgentPolicy struct{…}` SecurityAgentPolicy contains security agent configuration for an organization. When enabled, security agents are automatically deployed to all environments. - `Crowdstrike CrowdStrikeConfig` crowdstrike contains CrowdStrike Falcon configuration - `AdditionalOptions map[string, string]` additional_options contains additional FALCONCTL_OPT_* options as key-value pairs. Keys should NOT include the FALCONCTL_OPT_ prefix. - `CidSecretID string` cid_secret_id references an organization secret containing the Customer ID (CID). - `Enabled bool` enabled controls whether CrowdStrike Falcon is deployed to environments - `Image string` image is the CrowdStrike Falcon sensor container image reference - `Tags string` tags are optional tags to apply to the Falcon sensor (comma-separated) ### Veto Exec Policy - `type VetoExecPolicy struct{…}` VetoExecPolicy defines the policy for blocking or auditing executable execution in environments. - `Action KernelControlsAction` action specifies what action kernel-level controls take on policy violations - `const KernelControlsActionUnspecified KernelControlsAction = "KERNEL_CONTROLS_ACTION_UNSPECIFIED"` - `const KernelControlsActionBlock KernelControlsAction = "KERNEL_CONTROLS_ACTION_BLOCK"` - `const KernelControlsActionAudit KernelControlsAction = "KERNEL_CONTROLS_ACTION_AUDIT"` - `Enabled bool` enabled controls whether executable blocking is active - `Executables []string` executables is the list of executable paths or names to block # Scim Configurations ## CreateSCIMConfiguration `client.Organizations.ScimConfigurations.New(ctx, body) (*OrganizationScimConfigurationNewResponse, error)` **post** `/gitpod.v1.OrganizationService/CreateSCIMConfiguration` Creates a new SCIM configuration for automated user provisioning. Use this method to: - Set up SCIM 2.0 provisioning from an identity provider - Generate a bearer token for SCIM API authentication - Link SCIM provisioning to an existing SSO configuration ### Examples - Create basic SCIM configuration: Creates a SCIM configuration linked to an SSO provider with default 1 year token expiration. ```yaml organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" ssoConfigurationId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" ``` - Create SCIM configuration with custom token expiration: Creates a SCIM configuration with a 90-day token expiration. ```yaml organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" ssoConfigurationId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" tokenExpiresIn: "7776000s" ``` ### Parameters - `body OrganizationScimConfigurationNewParams` - `OrganizationID param.Field[string]` organization_id is the ID of the organization to create the SCIM configuration for - `SSOConfigurationID param.Field[string]` sso_configuration_id is the SSO configuration to link (required for user provisioning) - `Name param.Field[string]` name is a human-readable name for the SCIM configuration - `TokenExpiresIn param.Field[string]` token_expires_in is the duration until the token expires. Defaults to 1 year. Minimum 1 day, maximum 2 years. ### Returns - `type OrganizationScimConfigurationNewResponse struct{…}` - `Token string` token is the bearer token for SCIM API authentication. This is only returned once during creation - store it securely. - `ScimConfiguration ScimConfiguration` scim_configuration is the created SCIM configuration - `ID string` id is the unique identifier of the SCIM configuration - `CreatedAt Time` created_at is when the SCIM configuration was created - `OrganizationID string` organization_id is the ID of the organization this SCIM configuration belongs to - `TokenExpiresAt Time` token_expires_at is when the current SCIM token expires - `UpdatedAt Time` updated_at is when the SCIM configuration was last updated - `Enabled bool` enabled indicates if SCIM provisioning is active - `Name string` name is a human-readable name for the SCIM configuration - `SSOConfigurationID string` sso_configuration_id is the linked SSO configuration (optional) - `TokenExpiresAt Time` token_expires_at is when the token will expire ### Example ```go 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"), ) scimConfiguration, err := client.Organizations.ScimConfigurations.New(context.TODO(), gitpod.OrganizationScimConfigurationNewParams{ OrganizationID: gitpod.F("b0e12f6c-4c67-429d-a4a6-d9838b5da047"), SSOConfigurationID: gitpod.F("d2c94c27-3b76-4a42-b88c-95a85e392c68"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", scimConfiguration.Token) } ``` #### Response ```json { "token": "token", "scimConfiguration": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "createdAt": "2019-12-27T18:11:19.117Z", "organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "tokenExpiresAt": "2019-12-27T18:11:19.117Z", "updatedAt": "2019-12-27T18:11:19.117Z", "enabled": true, "name": "name", "ssoConfigurationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" }, "tokenExpiresAt": "2019-12-27T18:11:19.117Z" } ``` ## DeleteSCIMConfiguration `client.Organizations.ScimConfigurations.Delete(ctx, body) (*OrganizationScimConfigurationDeleteResponse, error)` **post** `/gitpod.v1.OrganizationService/DeleteSCIMConfiguration` Removes a SCIM configuration from an organization. Use this method to: - Disable SCIM provisioning completely - Remove unused configurations - Clean up after migration ### Examples - Delete SCIM configuration: Removes a specific SCIM configuration. ```yaml scimConfigurationId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" ``` ### Parameters - `body OrganizationScimConfigurationDeleteParams` - `ScimConfigurationID param.Field[string]` scim_configuration_id is the ID of the SCIM configuration to delete ### Returns - `type OrganizationScimConfigurationDeleteResponse interface{…}` ### Example ```go 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"), ) scimConfiguration, err := client.Organizations.ScimConfigurations.Delete(context.TODO(), gitpod.OrganizationScimConfigurationDeleteParams{ ScimConfigurationID: gitpod.F("d2c94c27-3b76-4a42-b88c-95a85e392c68"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", scimConfiguration) } ``` #### Response ```json {} ``` ## ListSCIMConfigurations `client.Organizations.ScimConfigurations.List(ctx, params) (*ScimConfigurationsPage[ScimConfiguration], error)` **post** `/gitpod.v1.OrganizationService/ListSCIMConfigurations` Lists SCIM configurations for an organization. Use this method to: - View all SCIM configurations - Monitor provisioning status - Audit SCIM settings ### Examples - List SCIM configurations: Shows all SCIM configurations for an organization. ```yaml pagination: pageSize: 20 ``` ### Parameters - `params OrganizationScimConfigurationListParams` - `Token param.Field[string]` Query param - `PageSize param.Field[int64]` Query param - `Pagination param.Field[OrganizationScimConfigurationListParamsPagination]` Body param - `Token string` Token for the next set of results that was returned as next_token of a PaginationResponse - `PageSize int64` Page size is the maximum number of results to retrieve per page. Defaults to 25. Maximum 100. ### Returns - `type ScimConfiguration struct{…}` SCIMConfiguration represents a SCIM 2.0 provisioning configuration - `ID string` id is the unique identifier of the SCIM configuration - `CreatedAt Time` created_at is when the SCIM configuration was created - `OrganizationID string` organization_id is the ID of the organization this SCIM configuration belongs to - `TokenExpiresAt Time` token_expires_at is when the current SCIM token expires - `UpdatedAt Time` updated_at is when the SCIM configuration was last updated - `Enabled bool` enabled indicates if SCIM provisioning is active - `Name string` name is a human-readable name for the SCIM configuration - `SSOConfigurationID string` sso_configuration_id is the linked SSO configuration (optional) ### Example ```go 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"), ) page, err := client.Organizations.ScimConfigurations.List(context.TODO(), gitpod.OrganizationScimConfigurationListParams{ Pagination: gitpod.F(gitpod.OrganizationScimConfigurationListParamsPagination{ PageSize: gitpod.F(int64(20)), }), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", page) } ``` #### Response ```json { "pagination": { "nextToken": "nextToken" }, "scimConfigurations": [ { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "createdAt": "2019-12-27T18:11:19.117Z", "organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "tokenExpiresAt": "2019-12-27T18:11:19.117Z", "updatedAt": "2019-12-27T18:11:19.117Z", "enabled": true, "name": "name", "ssoConfigurationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" } ] } ``` ## RegenerateSCIMToken `client.Organizations.ScimConfigurations.RegenerateToken(ctx, body) (*OrganizationScimConfigurationRegenerateTokenResponse, error)` **post** `/gitpod.v1.OrganizationService/RegenerateSCIMToken` Regenerates the bearer token for a SCIM configuration. Use this method to: - Rotate SCIM credentials - Recover from token compromise - Update IdP configuration ### Examples - Regenerate token: Creates a new bearer token with the same expiration duration as the previous token. ```yaml scimConfigurationId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" ``` - Regenerate token with new expiration: Creates a new bearer token with a custom 180-day expiration. ```yaml scimConfigurationId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" tokenExpiresIn: "15552000s" ``` ### Parameters - `body OrganizationScimConfigurationRegenerateTokenParams` - `ScimConfigurationID param.Field[string]` scim_configuration_id is the ID of the SCIM configuration to regenerate token for - `TokenExpiresIn param.Field[string]` token_expires_in is the duration until the new token expires. If not specified, uses the same duration as the previous token. ### Returns - `type OrganizationScimConfigurationRegenerateTokenResponse struct{…}` - `Token string` token is the new bearer token for SCIM API authentication. This invalidates the previous token - store it securely. - `TokenExpiresAt Time` token_expires_at is when the new token will expire ### Example ```go 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"), ) response, err := client.Organizations.ScimConfigurations.RegenerateToken(context.TODO(), gitpod.OrganizationScimConfigurationRegenerateTokenParams{ ScimConfigurationID: gitpod.F("d2c94c27-3b76-4a42-b88c-95a85e392c68"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response.Token) } ``` #### Response ```json { "token": "token", "tokenExpiresAt": "2019-12-27T18:11:19.117Z" } ``` ## GetSCIMConfiguration `client.Organizations.ScimConfigurations.Get(ctx, body) (*OrganizationScimConfigurationGetResponse, error)` **post** `/gitpod.v1.OrganizationService/GetSCIMConfiguration` Retrieves a specific SCIM configuration. Use this method to: - View SCIM configuration details - Check if SCIM is enabled - Verify SSO linkage ### Examples - Get SCIM configuration: Retrieves details of a specific SCIM configuration. ```yaml scimConfigurationId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" ``` ### Parameters - `body OrganizationScimConfigurationGetParams` - `ScimConfigurationID param.Field[string]` scim_configuration_id is the ID of the SCIM configuration to get ### Returns - `type OrganizationScimConfigurationGetResponse struct{…}` - `ScimConfiguration ScimConfiguration` scim_configuration is the SCIM configuration identified by the ID - `ID string` id is the unique identifier of the SCIM configuration - `CreatedAt Time` created_at is when the SCIM configuration was created - `OrganizationID string` organization_id is the ID of the organization this SCIM configuration belongs to - `TokenExpiresAt Time` token_expires_at is when the current SCIM token expires - `UpdatedAt Time` updated_at is when the SCIM configuration was last updated - `Enabled bool` enabled indicates if SCIM provisioning is active - `Name string` name is a human-readable name for the SCIM configuration - `SSOConfigurationID string` sso_configuration_id is the linked SSO configuration (optional) ### Example ```go 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"), ) scimConfiguration, err := client.Organizations.ScimConfigurations.Get(context.TODO(), gitpod.OrganizationScimConfigurationGetParams{ ScimConfigurationID: gitpod.F("d2c94c27-3b76-4a42-b88c-95a85e392c68"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", scimConfiguration.ScimConfiguration) } ``` #### Response ```json { "scimConfiguration": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "createdAt": "2019-12-27T18:11:19.117Z", "organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "tokenExpiresAt": "2019-12-27T18:11:19.117Z", "updatedAt": "2019-12-27T18:11:19.117Z", "enabled": true, "name": "name", "ssoConfigurationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" } } ``` ## UpdateSCIMConfiguration `client.Organizations.ScimConfigurations.Update(ctx, body) (*OrganizationScimConfigurationUpdateResponse, error)` **post** `/gitpod.v1.OrganizationService/UpdateSCIMConfiguration` Updates a SCIM configuration. Use this method to: - Enable or disable SCIM provisioning - Link or unlink SSO configuration - Update configuration name ### Examples - Disable SCIM: Disables SCIM provisioning. ```yaml scimConfigurationId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" enabled: false ``` - Link to SSO: Links SCIM configuration to an SSO provider. ```yaml scimConfigurationId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" ssoConfigurationId: "f53d2330-3795-4c5d-a1f3-453121af9c60" ``` ### Parameters - `body OrganizationScimConfigurationUpdateParams` - `ScimConfigurationID param.Field[string]` scim_configuration_id is the ID of the SCIM configuration to update - `Enabled param.Field[bool]` enabled controls whether SCIM provisioning is active - `Name param.Field[string]` name is a human-readable name for the SCIM configuration - `SSOConfigurationID param.Field[string]` sso_configuration_id is the SSO configuration to link ### Returns - `type OrganizationScimConfigurationUpdateResponse struct{…}` - `ScimConfiguration ScimConfiguration` scim_configuration is the updated SCIM configuration - `ID string` id is the unique identifier of the SCIM configuration - `CreatedAt Time` created_at is when the SCIM configuration was created - `OrganizationID string` organization_id is the ID of the organization this SCIM configuration belongs to - `TokenExpiresAt Time` token_expires_at is when the current SCIM token expires - `UpdatedAt Time` updated_at is when the SCIM configuration was last updated - `Enabled bool` enabled indicates if SCIM provisioning is active - `Name string` name is a human-readable name for the SCIM configuration - `SSOConfigurationID string` sso_configuration_id is the linked SSO configuration (optional) ### Example ```go 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"), ) scimConfiguration, err := client.Organizations.ScimConfigurations.Update(context.TODO(), gitpod.OrganizationScimConfigurationUpdateParams{ ScimConfigurationID: gitpod.F("d2c94c27-3b76-4a42-b88c-95a85e392c68"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", scimConfiguration.ScimConfiguration) } ``` #### Response ```json { "scimConfiguration": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "createdAt": "2019-12-27T18:11:19.117Z", "organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "tokenExpiresAt": "2019-12-27T18:11:19.117Z", "updatedAt": "2019-12-27T18:11:19.117Z", "enabled": true, "name": "name", "ssoConfigurationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" } } ``` ## Domain Types ### Scim Configuration - `type ScimConfiguration struct{…}` SCIMConfiguration represents a SCIM 2.0 provisioning configuration - `ID string` id is the unique identifier of the SCIM configuration - `CreatedAt Time` created_at is when the SCIM configuration was created - `OrganizationID string` organization_id is the ID of the organization this SCIM configuration belongs to - `TokenExpiresAt Time` token_expires_at is when the current SCIM token expires - `UpdatedAt Time` updated_at is when the SCIM configuration was last updated - `Enabled bool` enabled indicates if SCIM provisioning is active - `Name string` name is a human-readable name for the SCIM configuration - `SSOConfigurationID string` sso_configuration_id is the linked SSO configuration (optional) # SSO Configurations ## CreateSSOConfiguration `client.Organizations.SSOConfigurations.New(ctx, body) (*OrganizationSSOConfigurationNewResponse, error)` **post** `/gitpod.v1.OrganizationService/CreateSSOConfiguration` Creates or updates SSO configuration for organizational authentication. Use this method to: - Configure OIDC-based SSO providers - Set up built-in providers (Google, GitHub, etc.) - Define custom identity providers - Manage authentication policies ### Examples - Configure built-in Google SSO: Sets up SSO using Google Workspace. ```yaml organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" clientId: "012345678-abcdefghijklmnopqrstuvwxyz.apps.googleusercontent.com" clientSecret: "GOCSPX-abcdefghijklmnopqrstuvwxyz123456" issuerUrl: "https://accounts.google.com" emailDomain: "acme-corp.com" ``` - Configure custom OIDC provider: Sets up SSO with a custom identity provider. ```yaml organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" clientId: "acme-corp-gitpod" clientSecret: "secret-token-value" issuerUrl: "https://sso.acme-corp.com" emailDomain: "acme-corp.com" ``` ### Parameters - `body OrganizationSSOConfigurationNewParams` - `ClientID param.Field[string]` client_id is the client ID of the OIDC application set on the IdP - `ClientSecret param.Field[string]` client_secret is the client secret of the OIDC application set on the IdP - `IssuerURL param.Field[string]` issuer_url is the URL of the IdP issuer - `OrganizationID param.Field[string]` - `AdditionalScopes param.Field[[]string]` additional_scopes are extra OIDC scopes to request from the identity provider during sign-in. These are appended to the default scopes (openid, email, profile). - `ClaimsExpression param.Field[string]` claims_expression is an optional CEL expression evaluated against OIDC token claims during login. When set, the expression must evaluate to true for the login to succeed. Example: `claims.email_verified && claims.email.endsWith("@example.com")` - `DisplayName param.Field[string]` - `EmailDomain param.Field[string]` email_domain is the domain that is allowed to sign in to the organization - `EmailDomains param.Field[[]string]` ### Returns - `type OrganizationSSOConfigurationNewResponse struct{…}` - `SSOConfiguration SSOConfiguration` sso_configuration is the created SSO configuration - `ID string` id is the unique identifier of the SSO configuration - `IssuerURL string` issuer_url is the URL of the IdP issuer - `OrganizationID string` - `ProviderType ProviderType` provider_type defines the type of the SSO configuration - `const ProviderTypeUnspecified ProviderType = "PROVIDER_TYPE_UNSPECIFIED"` - `const ProviderTypeBuiltin ProviderType = "PROVIDER_TYPE_BUILTIN"` - `const ProviderTypeCustom ProviderType = "PROVIDER_TYPE_CUSTOM"` - `State SSOConfigurationState` state is the state of the SSO configuration - `const SSOConfigurationStateUnspecified SSOConfigurationState = "SSO_CONFIGURATION_STATE_UNSPECIFIED"` - `const SSOConfigurationStateInactive SSOConfigurationState = "SSO_CONFIGURATION_STATE_INACTIVE"` - `const SSOConfigurationStateActive SSOConfigurationState = "SSO_CONFIGURATION_STATE_ACTIVE"` - `AdditionalScopes []string` additional_scopes are extra OIDC scopes requested from the identity provider during sign-in. - `Claims map[string, string]` claims are key/value pairs that defines a mapping of claims issued by the IdP. - `ClaimsExpression string` claims_expression is a CEL (Common Expression Language) expression evaluated against the OIDC token claims during login. When set, the expression must evaluate to true for the login to succeed. The expression has access to a `claims` variable containing all token claims as a map. Example: `claims.email_verified && claims.email.endsWith("@example.com")` - `ClientID string` client_id is the client ID of the OIDC application set on the IdP - `DisplayName string` - `EmailDomain string` - `EmailDomains []string` ### Example ```go 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"), ) ssoConfiguration, err := client.Organizations.SSOConfigurations.New(context.TODO(), gitpod.OrganizationSSOConfigurationNewParams{ ClientID: gitpod.F("012345678-abcdefghijklmnopqrstuvwxyz.apps.googleusercontent.com"), ClientSecret: gitpod.F("GOCSPX-abcdefghijklmnopqrstuvwxyz123456"), IssuerURL: gitpod.F("https://accounts.google.com"), OrganizationID: gitpod.F("b0e12f6c-4c67-429d-a4a6-d9838b5da047"), EmailDomain: gitpod.F("acme-corp.com"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", ssoConfiguration.SSOConfiguration) } ``` #### Response ```json { "ssoConfiguration": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "issuerUrl": "issuerUrl", "organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "providerType": "PROVIDER_TYPE_UNSPECIFIED", "state": "SSO_CONFIGURATION_STATE_UNSPECIFIED", "additionalScopes": [ "string" ], "claims": { "foo": "string" }, "claimsExpression": "claimsExpression", "clientId": "clientId", "displayName": "displayName", "emailDomain": "emailDomain", "emailDomains": [ "sfN2.l.iJR-BU.u9JV9.a.m.o2D-4b-Jd.0Z-kX.L.n.S.f.UKbxB" ] } } ``` ## DeleteSSOConfiguration `client.Organizations.SSOConfigurations.Delete(ctx, body) (*OrganizationSSOConfigurationDeleteResponse, error)` **post** `/gitpod.v1.OrganizationService/DeleteSSOConfiguration` Removes an SSO configuration from an organization. Use this method to: - Disable SSO authentication - Remove outdated providers - Clean up unused configurations ### Examples - Delete SSO configuration: Removes a specific SSO configuration. ```yaml ssoConfigurationId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" ``` ### Parameters - `body OrganizationSSOConfigurationDeleteParams` - `SSOConfigurationID param.Field[string]` ### Returns - `type OrganizationSSOConfigurationDeleteResponse interface{…}` ### Example ```go 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"), ) ssoConfiguration, err := client.Organizations.SSOConfigurations.Delete(context.TODO(), gitpod.OrganizationSSOConfigurationDeleteParams{ SSOConfigurationID: gitpod.F("d2c94c27-3b76-4a42-b88c-95a85e392c68"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", ssoConfiguration) } ``` #### Response ```json {} ``` ## ListSSOConfigurations `client.Organizations.SSOConfigurations.List(ctx, params) (*SSOConfigurationsPage[SSOConfiguration], error)` **post** `/gitpod.v1.OrganizationService/ListSSOConfigurations` Lists and filters SSO configurations for an organization. Use this method to: - View all SSO providers - Monitor authentication status - Audit security settings - Manage provider configurations ### Examples - List active configurations: Shows all active SSO providers. ```yaml organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" pagination: pageSize: 20 ``` - List by provider type: Shows custom SSO configurations. ```yaml organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" pagination: pageSize: 20 token: "next-page-token-from-previous-response" ``` ### Parameters - `params OrganizationSSOConfigurationListParams` - `OrganizationID param.Field[string]` Body param: organization_id is the ID of the organization to list SSO configurations for. - `Token param.Field[string]` Query param - `PageSize param.Field[int64]` Query param - `Pagination param.Field[OrganizationSSOConfigurationListParamsPagination]` Body param - `Token string` Token for the next set of results that was returned as next_token of a PaginationResponse - `PageSize int64` Page size is the maximum number of results to retrieve per page. Defaults to 25. Maximum 100. ### Returns - `type SSOConfiguration struct{…}` - `ID string` id is the unique identifier of the SSO configuration - `IssuerURL string` issuer_url is the URL of the IdP issuer - `OrganizationID string` - `ProviderType ProviderType` provider_type defines the type of the SSO configuration - `const ProviderTypeUnspecified ProviderType = "PROVIDER_TYPE_UNSPECIFIED"` - `const ProviderTypeBuiltin ProviderType = "PROVIDER_TYPE_BUILTIN"` - `const ProviderTypeCustom ProviderType = "PROVIDER_TYPE_CUSTOM"` - `State SSOConfigurationState` state is the state of the SSO configuration - `const SSOConfigurationStateUnspecified SSOConfigurationState = "SSO_CONFIGURATION_STATE_UNSPECIFIED"` - `const SSOConfigurationStateInactive SSOConfigurationState = "SSO_CONFIGURATION_STATE_INACTIVE"` - `const SSOConfigurationStateActive SSOConfigurationState = "SSO_CONFIGURATION_STATE_ACTIVE"` - `AdditionalScopes []string` additional_scopes are extra OIDC scopes requested from the identity provider during sign-in. - `Claims map[string, string]` claims are key/value pairs that defines a mapping of claims issued by the IdP. - `ClaimsExpression string` claims_expression is a CEL (Common Expression Language) expression evaluated against the OIDC token claims during login. When set, the expression must evaluate to true for the login to succeed. The expression has access to a `claims` variable containing all token claims as a map. Example: `claims.email_verified && claims.email.endsWith("@example.com")` - `ClientID string` client_id is the client ID of the OIDC application set on the IdP - `DisplayName string` - `EmailDomain string` - `EmailDomains []string` ### Example ```go 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"), ) page, err := client.Organizations.SSOConfigurations.List(context.TODO(), gitpod.OrganizationSSOConfigurationListParams{ OrganizationID: gitpod.F("b0e12f6c-4c67-429d-a4a6-d9838b5da047"), Pagination: gitpod.F(gitpod.OrganizationSSOConfigurationListParamsPagination{ PageSize: gitpod.F(int64(20)), }), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", page) } ``` #### Response ```json { "pagination": { "nextToken": "nextToken" }, "ssoConfigurations": [ { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "issuerUrl": "issuerUrl", "organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "providerType": "PROVIDER_TYPE_UNSPECIFIED", "state": "SSO_CONFIGURATION_STATE_UNSPECIFIED", "additionalScopes": [ "string" ], "claims": { "foo": "string" }, "claimsExpression": "claimsExpression", "clientId": "clientId", "displayName": "displayName", "emailDomain": "emailDomain", "emailDomains": [ "sfN2.l.iJR-BU.u9JV9.a.m.o2D-4b-Jd.0Z-kX.L.n.S.f.UKbxB" ] } ] } ``` ## GetSSOConfiguration `client.Organizations.SSOConfigurations.Get(ctx, body) (*OrganizationSSOConfigurationGetResponse, error)` **post** `/gitpod.v1.OrganizationService/GetSSOConfiguration` Retrieves a specific SSO configuration. Use this method to: - View SSO provider details - Check configuration status - Verify SSO settings ### Examples - Get SSO configuration: Retrieves details of a specific SSO configuration. ```yaml ssoConfigurationId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" ``` ### Parameters - `body OrganizationSSOConfigurationGetParams` - `SSOConfigurationID param.Field[string]` sso_configuration_id is the ID of the SSO configuration to get ### Returns - `type OrganizationSSOConfigurationGetResponse struct{…}` - `SSOConfiguration SSOConfiguration` sso_configuration is the SSO configuration identified by the ID - `ID string` id is the unique identifier of the SSO configuration - `IssuerURL string` issuer_url is the URL of the IdP issuer - `OrganizationID string` - `ProviderType ProviderType` provider_type defines the type of the SSO configuration - `const ProviderTypeUnspecified ProviderType = "PROVIDER_TYPE_UNSPECIFIED"` - `const ProviderTypeBuiltin ProviderType = "PROVIDER_TYPE_BUILTIN"` - `const ProviderTypeCustom ProviderType = "PROVIDER_TYPE_CUSTOM"` - `State SSOConfigurationState` state is the state of the SSO configuration - `const SSOConfigurationStateUnspecified SSOConfigurationState = "SSO_CONFIGURATION_STATE_UNSPECIFIED"` - `const SSOConfigurationStateInactive SSOConfigurationState = "SSO_CONFIGURATION_STATE_INACTIVE"` - `const SSOConfigurationStateActive SSOConfigurationState = "SSO_CONFIGURATION_STATE_ACTIVE"` - `AdditionalScopes []string` additional_scopes are extra OIDC scopes requested from the identity provider during sign-in. - `Claims map[string, string]` claims are key/value pairs that defines a mapping of claims issued by the IdP. - `ClaimsExpression string` claims_expression is a CEL (Common Expression Language) expression evaluated against the OIDC token claims during login. When set, the expression must evaluate to true for the login to succeed. The expression has access to a `claims` variable containing all token claims as a map. Example: `claims.email_verified && claims.email.endsWith("@example.com")` - `ClientID string` client_id is the client ID of the OIDC application set on the IdP - `DisplayName string` - `EmailDomain string` - `EmailDomains []string` ### Example ```go 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"), ) ssoConfiguration, err := client.Organizations.SSOConfigurations.Get(context.TODO(), gitpod.OrganizationSSOConfigurationGetParams{ SSOConfigurationID: gitpod.F("d2c94c27-3b76-4a42-b88c-95a85e392c68"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", ssoConfiguration.SSOConfiguration) } ``` #### Response ```json { "ssoConfiguration": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "issuerUrl": "issuerUrl", "organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "providerType": "PROVIDER_TYPE_UNSPECIFIED", "state": "SSO_CONFIGURATION_STATE_UNSPECIFIED", "additionalScopes": [ "string" ], "claims": { "foo": "string" }, "claimsExpression": "claimsExpression", "clientId": "clientId", "displayName": "displayName", "emailDomain": "emailDomain", "emailDomains": [ "sfN2.l.iJR-BU.u9JV9.a.m.o2D-4b-Jd.0Z-kX.L.n.S.f.UKbxB" ] } } ``` ## UpdateSSOConfiguration `client.Organizations.SSOConfigurations.Update(ctx, body) (*OrganizationSSOConfigurationUpdateResponse, error)` **post** `/gitpod.v1.OrganizationService/UpdateSSOConfiguration` Updates SSO provider settings and authentication rules. Use this method to: - Rotate client credentials - Update provider endpoints - Modify claim mappings - Change authentication policies - Toggle SSO enforcement ### Examples - Update credentials: Rotates client ID and secret. ```yaml ssoConfigurationId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" clientId: "new-client-id" clientSecret: "new-client-secret" ``` - Update provider status: Activates or deactivates SSO provider. ```yaml ssoConfigurationId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" state: SSO_CONFIGURATION_STATE_ACTIVE ``` ### Parameters - `body OrganizationSSOConfigurationUpdateParams` - `SSOConfigurationID param.Field[string]` sso_configuration_id is the ID of the SSO configuration to update - `AdditionalScopes param.Field[AdditionalScopesUpdate]` additional_scopes replaces the configured OIDC scopes when present. When absent (nil), scopes are left unchanged. When present with an empty scopes list, all additional scopes are cleared. - `Claims param.Field[map[string, string]]` claims are key/value pairs that defines a mapping of claims issued by the IdP. - `ClaimsExpression param.Field[string]` claims_expression is a CEL expression evaluated against OIDC token claims during login. When set, the expression must evaluate to true for the login to succeed. When present with an empty string, the expression is cleared. - `ClientID param.Field[string]` client_id is the client ID of the SSO provider - `ClientSecret param.Field[string]` client_secret is the client secret of the SSO provider - `DisplayName param.Field[string]` - `EmailDomain param.Field[string]` - `EmailDomains param.Field[[]string]` - `IssuerURL param.Field[string]` issuer_url is the URL of the IdP issuer - `State param.Field[SSOConfigurationState]` state is the state of the SSO configuration ### Returns - `type OrganizationSSOConfigurationUpdateResponse interface{…}` ### Example ```go 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"), ) ssoConfiguration, err := client.Organizations.SSOConfigurations.Update(context.TODO(), gitpod.OrganizationSSOConfigurationUpdateParams{ SSOConfigurationID: gitpod.F("d2c94c27-3b76-4a42-b88c-95a85e392c68"), ClientID: gitpod.F("new-client-id"), ClientSecret: gitpod.F("new-client-secret"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", ssoConfiguration) } ``` #### Response ```json {} ``` ## Domain Types ### Additional Scopes Update - `type AdditionalScopesUpdate struct{…}` AdditionalScopesUpdate wraps a list of OIDC scopes so that the update request can distinguish "not changing scopes" (field absent) from "clearing all scopes" (field present, empty list). - `Scopes []string` ### Provider Type - `type ProviderType string` - `const ProviderTypeUnspecified ProviderType = "PROVIDER_TYPE_UNSPECIFIED"` - `const ProviderTypeBuiltin ProviderType = "PROVIDER_TYPE_BUILTIN"` - `const ProviderTypeCustom ProviderType = "PROVIDER_TYPE_CUSTOM"` ### SSO Configuration - `type SSOConfiguration struct{…}` - `ID string` id is the unique identifier of the SSO configuration - `IssuerURL string` issuer_url is the URL of the IdP issuer - `OrganizationID string` - `ProviderType ProviderType` provider_type defines the type of the SSO configuration - `const ProviderTypeUnspecified ProviderType = "PROVIDER_TYPE_UNSPECIFIED"` - `const ProviderTypeBuiltin ProviderType = "PROVIDER_TYPE_BUILTIN"` - `const ProviderTypeCustom ProviderType = "PROVIDER_TYPE_CUSTOM"` - `State SSOConfigurationState` state is the state of the SSO configuration - `const SSOConfigurationStateUnspecified SSOConfigurationState = "SSO_CONFIGURATION_STATE_UNSPECIFIED"` - `const SSOConfigurationStateInactive SSOConfigurationState = "SSO_CONFIGURATION_STATE_INACTIVE"` - `const SSOConfigurationStateActive SSOConfigurationState = "SSO_CONFIGURATION_STATE_ACTIVE"` - `AdditionalScopes []string` additional_scopes are extra OIDC scopes requested from the identity provider during sign-in. - `Claims map[string, string]` claims are key/value pairs that defines a mapping of claims issued by the IdP. - `ClaimsExpression string` claims_expression is a CEL (Common Expression Language) expression evaluated against the OIDC token claims during login. When set, the expression must evaluate to true for the login to succeed. The expression has access to a `claims` variable containing all token claims as a map. Example: `claims.email_verified && claims.email.endsWith("@example.com")` - `ClientID string` client_id is the client ID of the OIDC application set on the IdP - `DisplayName string` - `EmailDomain string` - `EmailDomains []string` ### SSO Configuration State - `type SSOConfigurationState string` - `const SSOConfigurationStateUnspecified SSOConfigurationState = "SSO_CONFIGURATION_STATE_UNSPECIFIED"` - `const SSOConfigurationStateInactive SSOConfigurationState = "SSO_CONFIGURATION_STATE_INACTIVE"` - `const SSOConfigurationStateActive SSOConfigurationState = "SSO_CONFIGURATION_STATE_ACTIVE"`