# Groups ## CreateGroup `client.groups.create(GroupCreateParamsbody, RequestOptionsoptions?): GroupCreateResponse` **post** `/gitpod.v1.GroupService/CreateGroup` Creates a new group within an organization. Use this method to: - Create teams for access control - Organize users by department or function - Set up role-based access groups ### Examples - Create a basic group: Creates a group with name and description. ```yaml organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" name: "Backend Team" description: "Backend engineering team" ``` ### Authorization Requires `org:admin` role on the organization. ### Parameters - `body: GroupCreateParams` - `description?: string` - `name?: string` - `organizationId?: string` ### Returns - `GroupCreateResponse` - `group?: Group` - `id?: string` - `createdAt?: string` 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. - `description?: string` - `directShare?: boolean` direct_share indicates that this group is used for direct user sharing on resources. These groups are hidden from regular group listings. - `memberCount?: number` member_count is the total number of members in this group - `name?: string` - `organizationId?: string` - `systemManaged?: boolean` system_managed indicates that this group is created by the system automatically - `updatedAt?: string` 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 ```typescript import Gitpod from '@gitpod/sdk'; const client = new Gitpod({ bearerToken: process.env['GITPOD_API_KEY'], // This is the default and can be omitted }); const group = await client.groups.create({ description: 'Backend engineering team', name: 'Backend Team', organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', }); console.log(group.group); ``` #### Response ```json { "group": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "createdAt": "2019-12-27T18:11:19.117Z", "description": "description", "directShare": true, "memberCount": 0, "name": "xxx", "organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "systemManaged": true, "updatedAt": "2019-12-27T18:11:19.117Z" } } ``` ## DeleteGroup `client.groups.delete(GroupDeleteParamsbody, RequestOptionsoptions?): GroupDeleteResponse` **post** `/gitpod.v1.GroupService/DeleteGroup` Deletes a group and removes all its resource assignments. When a group is deleted, all resource assignments revert to org-level scope. Use this method to: - Remove unused groups - Clean up after team reorganization ### Examples - Delete a group: Permanently removes a group. ```yaml groupId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" ``` ### Authorization Requires `org:admin` role on the organization. ### Parameters - `body: GroupDeleteParams` - `groupId?: string` ### Returns - `GroupDeleteResponse = unknown` Empty response ### Example ```typescript import Gitpod from '@gitpod/sdk'; const client = new Gitpod({ bearerToken: process.env['GITPOD_API_KEY'], // This is the default and can be omitted }); const group = await client.groups.delete({ groupId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68' }); console.log(group); ``` #### Response ```json {} ``` ## ListGroups `client.groups.list(GroupListParamsparams, RequestOptionsoptions?): GroupsPage` **post** `/gitpod.v1.GroupService/ListGroups` Lists groups with optional pagination. Use this method to: - View all groups in an organization - Check group memberships - Monitor group configurations - Audit group access ### Examples - List all groups: Shows all groups with pagination. ```yaml pagination: pageSize: 20 ``` - List with custom page size: Shows groups with specified page size. ```yaml pagination: pageSize: 50 token: "next-page-token-from-previous-response" ``` ### Authorization All organization members can list groups (transparency model). ### Parameters - `params: GroupListParams` - `token?: string` Query param - `pageSize?: number` Query param - `filter?: Filter` Body param: filter contains options for filtering the list of groups. - `directShare?: boolean | null` direct_share filters groups by their direct_share flag. When set, only groups matching this value are returned. - `groupIds?: Array` group_ids filters the response to only groups with the specified IDs - `search?: string` search performs case-insensitive search across group name, description, and ID - `systemManaged?: boolean | null` system_managed filters groups by their system_managed flag. When set, only groups matching this value are returned. - `pagination?: Pagination` Body param: pagination contains the pagination options for listing groups - `token?: string` Token for the next set of results that was returned as next_token of a PaginationResponse - `pageSize?: number` Page size is the maximum number of results to retrieve per page. Defaults to 25. Maximum 100. ### Returns - `Group` - `id?: string` - `createdAt?: string` 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. - `description?: string` - `directShare?: boolean` direct_share indicates that this group is used for direct user sharing on resources. These groups are hidden from regular group listings. - `memberCount?: number` member_count is the total number of members in this group - `name?: string` - `organizationId?: string` - `systemManaged?: boolean` system_managed indicates that this group is created by the system automatically - `updatedAt?: string` 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 ```typescript import Gitpod from '@gitpod/sdk'; const client = new Gitpod({ bearerToken: process.env['GITPOD_API_KEY'], // This is the default and can be omitted }); // Automatically fetches more pages as needed. for await (const group of client.groups.list({ pagination: { pageSize: 20 } })) { console.log(group.id); } ``` #### Response ```json { "groups": [ { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "createdAt": "2019-12-27T18:11:19.117Z", "description": "description", "directShare": true, "memberCount": 0, "name": "xxx", "organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "systemManaged": true, "updatedAt": "2019-12-27T18:11:19.117Z" } ], "pagination": { "nextToken": "nextToken" } } ``` ## GetGroup `client.groups.retrieve(GroupRetrieveParamsbody, RequestOptionsoptions?): GroupRetrieveResponse` **post** `/gitpod.v1.GroupService/GetGroup` Gets information about a specific group by ID or name. Use this method to: - Retrieve group details and metadata - Check group configuration - View member count ### Examples - Get group by ID: Retrieves information about a specific group by its unique ID. ```yaml id: "d2c94c27-3b76-4a42-b88c-95a85e392c68" ``` ### Authorization All organization members can view group information (transparency model). ### Parameters - `body: GroupRetrieveParams` - `id?: string` id looks up the group by its unique ID. - `groupId?: string` Deprecated: use the group oneof instead. - `name?: string` name looks up the group by its name within the caller's organization. ### Returns - `GroupRetrieveResponse` - `group?: Group` - `id?: string` - `createdAt?: string` 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. - `description?: string` - `directShare?: boolean` direct_share indicates that this group is used for direct user sharing on resources. These groups are hidden from regular group listings. - `memberCount?: number` member_count is the total number of members in this group - `name?: string` - `organizationId?: string` - `systemManaged?: boolean` system_managed indicates that this group is created by the system automatically - `updatedAt?: string` 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 ```typescript import Gitpod from '@gitpod/sdk'; const client = new Gitpod({ bearerToken: process.env['GITPOD_API_KEY'], // This is the default and can be omitted }); const group = await client.groups.retrieve({ id: 'd2c94c27-3b76-4a42-b88c-95a85e392c68' }); console.log(group.group); ``` #### Response ```json { "group": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "createdAt": "2019-12-27T18:11:19.117Z", "description": "description", "directShare": true, "memberCount": 0, "name": "xxx", "organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "systemManaged": true, "updatedAt": "2019-12-27T18:11:19.117Z" } } ``` ## UpdateGroup `client.groups.update(GroupUpdateParamsbody, RequestOptionsoptions?): GroupUpdateResponse` **post** `/gitpod.v1.GroupService/UpdateGroup` Updates group information. Use this method to: - Rename a group - Update group description ### Examples - Update group name: Changes the name of an existing group. ```yaml groupId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" name: "Platform Team" description: "Platform engineering team" ``` ### Authorization Requires `org:admin` permission on the organization or `group:admin` permission on the specific group. ### Parameters - `body: GroupUpdateParams` - `description?: string` - `groupId?: string` - `name?: string` ### Returns - `GroupUpdateResponse` - `group?: Group` - `id?: string` - `createdAt?: string` 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. - `description?: string` - `directShare?: boolean` direct_share indicates that this group is used for direct user sharing on resources. These groups are hidden from regular group listings. - `memberCount?: number` member_count is the total number of members in this group - `name?: string` - `organizationId?: string` - `systemManaged?: boolean` system_managed indicates that this group is created by the system automatically - `updatedAt?: string` 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 ```typescript import Gitpod from '@gitpod/sdk'; const client = new Gitpod({ bearerToken: process.env['GITPOD_API_KEY'], // This is the default and can be omitted }); const group = await client.groups.update({ description: 'Platform engineering team', groupId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', name: 'Platform Team', }); console.log(group.group); ``` #### Response ```json { "group": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "createdAt": "2019-12-27T18:11:19.117Z", "description": "description", "directShare": true, "memberCount": 0, "name": "xxx", "organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "systemManaged": true, "updatedAt": "2019-12-27T18:11:19.117Z" } } ``` ## Domain Types ### Group - `Group` - `id?: string` - `createdAt?: string` 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. - `description?: string` - `directShare?: boolean` direct_share indicates that this group is used for direct user sharing on resources. These groups are hidden from regular group listings. - `memberCount?: number` member_count is the total number of members in this group - `name?: string` - `organizationId?: string` - `systemManaged?: boolean` system_managed indicates that this group is created by the system automatically - `updatedAt?: string` 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. ### Group Create Response - `GroupCreateResponse` - `group?: Group` - `id?: string` - `createdAt?: string` 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. - `description?: string` - `directShare?: boolean` direct_share indicates that this group is used for direct user sharing on resources. These groups are hidden from regular group listings. - `memberCount?: number` member_count is the total number of members in this group - `name?: string` - `organizationId?: string` - `systemManaged?: boolean` system_managed indicates that this group is created by the system automatically - `updatedAt?: string` 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. ### Group Delete Response - `GroupDeleteResponse = unknown` Empty response ### Group Retrieve Response - `GroupRetrieveResponse` - `group?: Group` - `id?: string` - `createdAt?: string` 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. - `description?: string` - `directShare?: boolean` direct_share indicates that this group is used for direct user sharing on resources. These groups are hidden from regular group listings. - `memberCount?: number` member_count is the total number of members in this group - `name?: string` - `organizationId?: string` - `systemManaged?: boolean` system_managed indicates that this group is created by the system automatically - `updatedAt?: string` 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. ### Group Update Response - `GroupUpdateResponse` - `group?: Group` - `id?: string` - `createdAt?: string` 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. - `description?: string` - `directShare?: boolean` direct_share indicates that this group is used for direct user sharing on resources. These groups are hidden from regular group listings. - `memberCount?: number` member_count is the total number of members in this group - `name?: string` - `organizationId?: string` - `systemManaged?: boolean` system_managed indicates that this group is created by the system automatically - `updatedAt?: string` 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. # Memberships ## CreateMembership `client.groups.memberships.create(MembershipCreateParamsbody, RequestOptionsoptions?): MembershipCreateResponse` **post** `/gitpod.v1.GroupService/CreateMembership` Creates a membership for a user in a group. Use this method to: - Add users to groups - Grant group-based permissions to users ### Examples - Add a user to a group: Creates a membership for a user in a group. ```yaml groupId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" subject: id: "f53d2330-3795-4c5d-a1f3-453121af9c60" principal: PRINCIPAL_USER ``` ### Authorization Requires `org:admin` permission on the organization or `group:admin` permission on the specific group. ### Parameters - `body: MembershipCreateParams` - `groupId?: string` - `subject?: Subject` Subject to add to the group - `id?: string` id is the UUID of the subject - `principal?: Principal` Principal is the principal of the subject - `"PRINCIPAL_UNSPECIFIED"` - `"PRINCIPAL_ACCOUNT"` - `"PRINCIPAL_USER"` - `"PRINCIPAL_RUNNER"` - `"PRINCIPAL_ENVIRONMENT"` - `"PRINCIPAL_SERVICE_ACCOUNT"` - `"PRINCIPAL_RUNNER_MANAGER"` ### Returns - `MembershipCreateResponse` - `member?: GroupMembership` GroupMembership represents a subject's membership in a group - `id?: string` Unique identifier for the group membership - `avatarUrl?: string` Subject's avatar URL - `groupId?: string` Group identifier - `name?: string` Subject's display name - `subject?: Subject` Subject (user, runner, environment, service account, etc.) - `id?: string` id is the UUID of the subject - `principal?: Principal` Principal is the principal of the subject - `"PRINCIPAL_UNSPECIFIED"` - `"PRINCIPAL_ACCOUNT"` - `"PRINCIPAL_USER"` - `"PRINCIPAL_RUNNER"` - `"PRINCIPAL_ENVIRONMENT"` - `"PRINCIPAL_SERVICE_ACCOUNT"` - `"PRINCIPAL_RUNNER_MANAGER"` ### Example ```typescript import Gitpod from '@gitpod/sdk'; const client = new Gitpod({ bearerToken: process.env['GITPOD_API_KEY'], // This is the default and can be omitted }); const membership = await client.groups.memberships.create({ groupId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', subject: { id: 'f53d2330-3795-4c5d-a1f3-453121af9c60', principal: 'PRINCIPAL_USER' }, }); console.log(membership.member); ``` #### Response ```json { "member": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "avatarUrl": "avatarUrl", "groupId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "name": "name", "subject": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "principal": "PRINCIPAL_UNSPECIFIED" } } } ``` ## DeleteMembership `client.groups.memberships.delete(MembershipDeleteParamsbody, RequestOptionsoptions?): MembershipDeleteResponse` **post** `/gitpod.v1.GroupService/DeleteMembership` Deletes a membership for a user in a group. Use this method to: - Remove users from groups - Revoke group-based permissions ### Examples - Remove a user from a group: Deletes a membership by its ID. ```yaml membershipId: "a1b2c3d4-5678-90ab-cdef-1234567890ab" ``` ### Authorization Requires `org:admin` permission on the organization or `group:admin` permission on the specific group. ### Parameters - `body: MembershipDeleteParams` - `membershipId?: string` The membership to delete ### Returns - `MembershipDeleteResponse = unknown` Empty response ### Example ```typescript import Gitpod from '@gitpod/sdk'; const client = new Gitpod({ bearerToken: process.env['GITPOD_API_KEY'], // This is the default and can be omitted }); const membership = await client.groups.memberships.delete({ membershipId: 'a1b2c3d4-5678-90ab-cdef-1234567890ab', }); console.log(membership); ``` #### Response ```json {} ``` ## ListMemberships `client.groups.memberships.list(MembershipListParamsparams, RequestOptionsoptions?): MembersPage` **post** `/gitpod.v1.GroupService/ListMemberships` Lists all memberships of a group. Use this method to: - View all members of a group - Audit group membership ### Examples - List group members: Shows all members of a specific group. ```yaml groupId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" pagination: pageSize: 20 ``` ### Authorization All organization members can view group membership (transparency model). ### Parameters - `params: MembershipListParams` - `token?: string` Query param - `pageSize?: number` Query param - `filter?: Filter` Body param: filter contains options for filtering the list of memberships. - `search?: string` search performs case-insensitive search across member name, email, ID, and service account name and description - `groupId?: string` Body param - `pagination?: Pagination` Body param: pagination contains the pagination options for listing memberships - `token?: string` Token for the next set of results that was returned as next_token of a PaginationResponse - `pageSize?: number` Page size is the maximum number of results to retrieve per page. Defaults to 25. Maximum 100. ### Returns - `GroupMembership` GroupMembership represents a subject's membership in a group - `id?: string` Unique identifier for the group membership - `avatarUrl?: string` Subject's avatar URL - `groupId?: string` Group identifier - `name?: string` Subject's display name - `subject?: Subject` Subject (user, runner, environment, service account, etc.) - `id?: string` id is the UUID of the subject - `principal?: Principal` Principal is the principal of the subject - `"PRINCIPAL_UNSPECIFIED"` - `"PRINCIPAL_ACCOUNT"` - `"PRINCIPAL_USER"` - `"PRINCIPAL_RUNNER"` - `"PRINCIPAL_ENVIRONMENT"` - `"PRINCIPAL_SERVICE_ACCOUNT"` - `"PRINCIPAL_RUNNER_MANAGER"` ### Example ```typescript import Gitpod from '@gitpod/sdk'; const client = new Gitpod({ bearerToken: process.env['GITPOD_API_KEY'], // This is the default and can be omitted }); // Automatically fetches more pages as needed. for await (const groupMembership of client.groups.memberships.list({ groupId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', pagination: { pageSize: 20 }, })) { console.log(groupMembership.id); } ``` #### Response ```json { "members": [ { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "avatarUrl": "avatarUrl", "groupId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "name": "name", "subject": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "principal": "PRINCIPAL_UNSPECIFIED" } } ], "pagination": { "nextToken": "nextToken" } } ``` ## GetMembership `client.groups.memberships.retrieve(MembershipRetrieveParamsbody, RequestOptionsoptions?): MembershipRetrieveResponse` **post** `/gitpod.v1.GroupService/GetMembership` Gets a specific membership by group ID and subject. Use this method to: - Check if a user or service account is a member of a group - Verify group membership for access control ### Examples - Check user membership: Checks if a user is a member of a specific group. ```yaml groupId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" subject: id: "f53d2330-3795-4c5d-a1f3-453121af9c60" principal: PRINCIPAL_USER ``` ### Authorization All organization members can check group membership (transparency model). ### Parameters - `body: MembershipRetrieveParams` - `subject: Subject` Subject to check membership for - `id?: string` id is the UUID of the subject - `principal?: Principal` Principal is the principal of the subject - `"PRINCIPAL_UNSPECIFIED"` - `"PRINCIPAL_ACCOUNT"` - `"PRINCIPAL_USER"` - `"PRINCIPAL_RUNNER"` - `"PRINCIPAL_ENVIRONMENT"` - `"PRINCIPAL_SERVICE_ACCOUNT"` - `"PRINCIPAL_RUNNER_MANAGER"` - `groupId?: string` ### Returns - `MembershipRetrieveResponse` - `member?: GroupMembership` The membership if found, nil if subject is not a member - `id?: string` Unique identifier for the group membership - `avatarUrl?: string` Subject's avatar URL - `groupId?: string` Group identifier - `name?: string` Subject's display name - `subject?: Subject` Subject (user, runner, environment, service account, etc.) - `id?: string` id is the UUID of the subject - `principal?: Principal` Principal is the principal of the subject - `"PRINCIPAL_UNSPECIFIED"` - `"PRINCIPAL_ACCOUNT"` - `"PRINCIPAL_USER"` - `"PRINCIPAL_RUNNER"` - `"PRINCIPAL_ENVIRONMENT"` - `"PRINCIPAL_SERVICE_ACCOUNT"` - `"PRINCIPAL_RUNNER_MANAGER"` ### Example ```typescript import Gitpod from '@gitpod/sdk'; const client = new Gitpod({ bearerToken: process.env['GITPOD_API_KEY'], // This is the default and can be omitted }); const membership = await client.groups.memberships.retrieve({ subject: { id: 'f53d2330-3795-4c5d-a1f3-453121af9c60', principal: 'PRINCIPAL_USER' }, groupId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', }); console.log(membership.member); ``` #### Response ```json { "member": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "avatarUrl": "avatarUrl", "groupId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "name": "name", "subject": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "principal": "PRINCIPAL_UNSPECIFIED" } } } ``` ## Domain Types ### Group Membership - `GroupMembership` GroupMembership represents a subject's membership in a group - `id?: string` Unique identifier for the group membership - `avatarUrl?: string` Subject's avatar URL - `groupId?: string` Group identifier - `name?: string` Subject's display name - `subject?: Subject` Subject (user, runner, environment, service account, etc.) - `id?: string` id is the UUID of the subject - `principal?: Principal` Principal is the principal of the subject - `"PRINCIPAL_UNSPECIFIED"` - `"PRINCIPAL_ACCOUNT"` - `"PRINCIPAL_USER"` - `"PRINCIPAL_RUNNER"` - `"PRINCIPAL_ENVIRONMENT"` - `"PRINCIPAL_SERVICE_ACCOUNT"` - `"PRINCIPAL_RUNNER_MANAGER"` ### Membership Create Response - `MembershipCreateResponse` - `member?: GroupMembership` GroupMembership represents a subject's membership in a group - `id?: string` Unique identifier for the group membership - `avatarUrl?: string` Subject's avatar URL - `groupId?: string` Group identifier - `name?: string` Subject's display name - `subject?: Subject` Subject (user, runner, environment, service account, etc.) - `id?: string` id is the UUID of the subject - `principal?: Principal` Principal is the principal of the subject - `"PRINCIPAL_UNSPECIFIED"` - `"PRINCIPAL_ACCOUNT"` - `"PRINCIPAL_USER"` - `"PRINCIPAL_RUNNER"` - `"PRINCIPAL_ENVIRONMENT"` - `"PRINCIPAL_SERVICE_ACCOUNT"` - `"PRINCIPAL_RUNNER_MANAGER"` ### Membership Delete Response - `MembershipDeleteResponse = unknown` Empty response ### Membership Retrieve Response - `MembershipRetrieveResponse` - `member?: GroupMembership` The membership if found, nil if subject is not a member - `id?: string` Unique identifier for the group membership - `avatarUrl?: string` Subject's avatar URL - `groupId?: string` Group identifier - `name?: string` Subject's display name - `subject?: Subject` Subject (user, runner, environment, service account, etc.) - `id?: string` id is the UUID of the subject - `principal?: Principal` Principal is the principal of the subject - `"PRINCIPAL_UNSPECIFIED"` - `"PRINCIPAL_ACCOUNT"` - `"PRINCIPAL_USER"` - `"PRINCIPAL_RUNNER"` - `"PRINCIPAL_ENVIRONMENT"` - `"PRINCIPAL_SERVICE_ACCOUNT"` - `"PRINCIPAL_RUNNER_MANAGER"` # Role Assignments ## CreateRoleAssignment `client.groups.roleAssignments.create(RoleAssignmentCreateParamsbody, RequestOptionsoptions?): RoleAssignmentCreateResponse` **post** `/gitpod.v1.GroupService/CreateRoleAssignment` Creates a role assignment for a group on a resource. Use this method to: - Assign specific roles to groups on runners, projects, or environments - Grant group-based access to resources ### Examples - Assign admin role on a runner: Grants the group admin access to a runner. ```yaml groupId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" resourceType: RESOURCE_TYPE_RUNNER resourceId: "f53d2330-3795-4c5d-a1f3-453121af9c60" resourceRole: RESOURCE_ROLE_RUNNER_ADMIN ``` - Assign user role on a project: Grants the group user access to a project. ```yaml groupId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" resourceType: RESOURCE_TYPE_PROJECT resourceId: "a1b2c3d4-5678-90ab-cdef-1234567890ab" resourceRole: RESOURCE_ROLE_PROJECT_USER ``` ### Authorization Requires admin role on the specific resource. ### Parameters - `body: RoleAssignmentCreateParams` - `groupId?: string` - `resourceId?: string` - `resourceRole?: ResourceRole` ResourceRole represents roles that can be assigned to groups on resources These map directly to the roles defined in backend/db/rule/rbac/role/role.go - `"RESOURCE_ROLE_UNSPECIFIED"` - `"RESOURCE_ROLE_ORG_ADMIN"` - `"RESOURCE_ROLE_ORG_MEMBER"` - `"RESOURCE_ROLE_ORG_RUNNERS_ADMIN"` - `"RESOURCE_ROLE_ORG_PROJECTS_ADMIN"` - `"RESOURCE_ROLE_ORG_AUTOMATIONS_ADMIN"` - `"RESOURCE_ROLE_ORG_GROUPS_ADMIN"` - `"RESOURCE_ROLE_ORG_AUDIT_LOG_READER"` - `"RESOURCE_ROLE_GROUP_ADMIN"` - `"RESOURCE_ROLE_GROUP_VIEWER"` - `"RESOURCE_ROLE_USER_IDENTITY"` - `"RESOURCE_ROLE_USER_VIEWER"` - `"RESOURCE_ROLE_USER_ADMIN"` - `"RESOURCE_ROLE_ENVIRONMENT_IDENTITY"` - `"RESOURCE_ROLE_ENVIRONMENT_ADMIN"` - `"RESOURCE_ROLE_ENVIRONMENT_USER"` - `"RESOURCE_ROLE_ENVIRONMENT_VIEWER"` - `"RESOURCE_ROLE_ENVIRONMENT_RUNNER"` - `"RESOURCE_ROLE_RUNNER_IDENTITY"` - `"RESOURCE_ROLE_RUNNER_ADMIN"` - `"RESOURCE_ROLE_RUNNER_LOCAL_ADMIN"` - `"RESOURCE_ROLE_RUNNER_MANAGED_ADMIN"` - `"RESOURCE_ROLE_RUNNER_USER"` - `"RESOURCE_ROLE_RUNNER_CONFIGURATION_READER"` - `"RESOURCE_ROLE_HOST_AUTHENTICATION_TOKEN_ADMIN"` - `"RESOURCE_ROLE_HOST_AUTHENTICATION_TOKEN_UPDATER"` - `"RESOURCE_ROLE_PROJECT_ADMIN"` - `"RESOURCE_ROLE_PROJECT_USER"` - `"RESOURCE_ROLE_PROJECT_EDITOR"` - `"RESOURCE_ROLE_ENVIRONMENT_SERVICE_ADMIN"` - `"RESOURCE_ROLE_ENVIRONMENT_SERVICE_VIEWER"` - `"RESOURCE_ROLE_ENVIRONMENT_SERVICE_USER"` - `"RESOURCE_ROLE_ENVIRONMENT_SERVICE_ENV"` - `"RESOURCE_ROLE_ENVIRONMENT_TASK_ADMIN"` - `"RESOURCE_ROLE_ENVIRONMENT_TASK_VIEWER"` - `"RESOURCE_ROLE_ENVIRONMENT_TASK_USER"` - `"RESOURCE_ROLE_ENVIRONMENT_TASK_ENV"` - `"RESOURCE_ROLE_SERVICE_ACCOUNT_IDENTITY"` - `"RESOURCE_ROLE_SERVICE_ACCOUNT_ADMIN"` - `"RESOURCE_ROLE_AGENT_EXECUTION_USER"` - `"RESOURCE_ROLE_AGENT_EXECUTION_ADMIN"` - `"RESOURCE_ROLE_AGENT_EXECUTION_RUNNER"` - `"RESOURCE_ROLE_AGENT_EXECUTION_OUTPUTS_REPORTER"` - `"RESOURCE_ROLE_AGENT_EXECUTION_VIEWER"` - `"RESOURCE_ROLE_AGENT_ADMIN"` - `"RESOURCE_ROLE_AGENT_VIEWER"` - `"RESOURCE_ROLE_AGENT_EXECUTOR"` - `"RESOURCE_ROLE_WORKFLOW_ADMIN"` - `"RESOURCE_ROLE_WORKFLOW_USER"` - `"RESOURCE_ROLE_WORKFLOW_VIEWER"` - `"RESOURCE_ROLE_WORKFLOW_EXECUTOR"` - `"RESOURCE_ROLE_SNAPSHOT_ADMIN"` - `"RESOURCE_ROLE_SNAPSHOT_RUNNER"` - `"RESOURCE_ROLE_WEBHOOK_ADMIN"` - `"RESOURCE_ROLE_WEBHOOK_VIEWER"` - `"RESOURCE_ROLE_WARMPOOL_RUNNER"` - `"RESOURCE_ROLE_WARMPOOL_ADMIN"` - `"RESOURCE_ROLE_WARMPOOL_VIEWER"` - `"RESOURCE_ROLE_SESSION_ADMIN"` - `"RESOURCE_ROLE_SESSION_USER"` - `"RESOURCE_ROLE_TEAM_ADMIN"` - `"RESOURCE_ROLE_TEAM_VIEWER"` - `resourceType?: ResourceType` - `"RESOURCE_TYPE_UNSPECIFIED"` - `"RESOURCE_TYPE_ENVIRONMENT"` - `"RESOURCE_TYPE_RUNNER"` - `"RESOURCE_TYPE_PROJECT"` - `"RESOURCE_TYPE_TASK"` - `"RESOURCE_TYPE_TASK_EXECUTION"` - `"RESOURCE_TYPE_SERVICE"` - `"RESOURCE_TYPE_ORGANIZATION"` - `"RESOURCE_TYPE_USER"` - `"RESOURCE_TYPE_ENVIRONMENT_CLASS"` - `"RESOURCE_TYPE_RUNNER_SCM_INTEGRATION"` - `"RESOURCE_TYPE_HOST_AUTHENTICATION_TOKEN"` - `"RESOURCE_TYPE_GROUP"` - `"RESOURCE_TYPE_PERSONAL_ACCESS_TOKEN"` - `"RESOURCE_TYPE_USER_PREFERENCE"` - `"RESOURCE_TYPE_SERVICE_ACCOUNT"` - `"RESOURCE_TYPE_SECRET"` - `"RESOURCE_TYPE_SSO_CONFIG"` - `"RESOURCE_TYPE_DOMAIN_VERIFICATION"` - `"RESOURCE_TYPE_AGENT_EXECUTION"` - `"RESOURCE_TYPE_RUNNER_LLM_INTEGRATION"` - `"RESOURCE_TYPE_AGENT"` - `"RESOURCE_TYPE_ENVIRONMENT_SESSION"` - `"RESOURCE_TYPE_USER_SECRET"` - `"RESOURCE_TYPE_ORGANIZATION_POLICY"` - `"RESOURCE_TYPE_ORGANIZATION_SECRET"` - `"RESOURCE_TYPE_PROJECT_ENVIRONMENT_CLASS"` - `"RESOURCE_TYPE_BILLING"` - `"RESOURCE_TYPE_PROMPT"` - `"RESOURCE_TYPE_COUPON"` - `"RESOURCE_TYPE_COUPON_REDEMPTION"` - `"RESOURCE_TYPE_ACCOUNT"` - `"RESOURCE_TYPE_INTEGRATION"` - `"RESOURCE_TYPE_WORKFLOW"` - `"RESOURCE_TYPE_WORKFLOW_EXECUTION"` - `"RESOURCE_TYPE_WORKFLOW_EXECUTION_ACTION"` - `"RESOURCE_TYPE_SNAPSHOT"` - `"RESOURCE_TYPE_PREBUILD"` - `"RESOURCE_TYPE_ORGANIZATION_LLM_INTEGRATION"` - `"RESOURCE_TYPE_CUSTOM_DOMAIN"` - `"RESOURCE_TYPE_ROLE_ASSIGNMENT_CHANGED"` - `"RESOURCE_TYPE_GROUP_MEMBERSHIP_CHANGED"` - `"RESOURCE_TYPE_WEBHOOK"` - `"RESOURCE_TYPE_SCIM_CONFIGURATION"` - `"RESOURCE_TYPE_SERVICE_ACCOUNT_SECRET"` - `"RESOURCE_TYPE_ANNOUNCEMENT_BANNER"` - `"RESOURCE_TYPE_SERVICE_ACCOUNT_TOKEN"` - `"RESOURCE_TYPE_ROLE_ASSIGNMENT"` - `"RESOURCE_TYPE_WARM_POOL"` - `"RESOURCE_TYPE_NOTIFICATION"` ### Returns - `RoleAssignmentCreateResponse` - `assignment?: RoleAssignment` RoleAssignment represents a role assigned to a group on a specific resource - `id?: string` Unique identifier for the role assignment - `derivedFromOrgRole?: ResourceRole | null` The org-level role that created this assignment, if any. RESOURCE_ROLE_UNSPECIFIED means this is a direct share (manually created). Non-zero (e.g., ORG_PROJECTS_ADMIN, ORG_RUNNERS_ADMIN) means this assignment was derived from an org-level role. - `"RESOURCE_ROLE_UNSPECIFIED"` - `"RESOURCE_ROLE_ORG_ADMIN"` - `"RESOURCE_ROLE_ORG_MEMBER"` - `"RESOURCE_ROLE_ORG_RUNNERS_ADMIN"` - `"RESOURCE_ROLE_ORG_PROJECTS_ADMIN"` - `"RESOURCE_ROLE_ORG_AUTOMATIONS_ADMIN"` - `"RESOURCE_ROLE_ORG_GROUPS_ADMIN"` - `"RESOURCE_ROLE_ORG_AUDIT_LOG_READER"` - `"RESOURCE_ROLE_GROUP_ADMIN"` - `"RESOURCE_ROLE_GROUP_VIEWER"` - `"RESOURCE_ROLE_USER_IDENTITY"` - `"RESOURCE_ROLE_USER_VIEWER"` - `"RESOURCE_ROLE_USER_ADMIN"` - `"RESOURCE_ROLE_ENVIRONMENT_IDENTITY"` - `"RESOURCE_ROLE_ENVIRONMENT_ADMIN"` - `"RESOURCE_ROLE_ENVIRONMENT_USER"` - `"RESOURCE_ROLE_ENVIRONMENT_VIEWER"` - `"RESOURCE_ROLE_ENVIRONMENT_RUNNER"` - `"RESOURCE_ROLE_RUNNER_IDENTITY"` - `"RESOURCE_ROLE_RUNNER_ADMIN"` - `"RESOURCE_ROLE_RUNNER_LOCAL_ADMIN"` - `"RESOURCE_ROLE_RUNNER_MANAGED_ADMIN"` - `"RESOURCE_ROLE_RUNNER_USER"` - `"RESOURCE_ROLE_RUNNER_CONFIGURATION_READER"` - `"RESOURCE_ROLE_HOST_AUTHENTICATION_TOKEN_ADMIN"` - `"RESOURCE_ROLE_HOST_AUTHENTICATION_TOKEN_UPDATER"` - `"RESOURCE_ROLE_PROJECT_ADMIN"` - `"RESOURCE_ROLE_PROJECT_USER"` - `"RESOURCE_ROLE_PROJECT_EDITOR"` - `"RESOURCE_ROLE_ENVIRONMENT_SERVICE_ADMIN"` - `"RESOURCE_ROLE_ENVIRONMENT_SERVICE_VIEWER"` - `"RESOURCE_ROLE_ENVIRONMENT_SERVICE_USER"` - `"RESOURCE_ROLE_ENVIRONMENT_SERVICE_ENV"` - `"RESOURCE_ROLE_ENVIRONMENT_TASK_ADMIN"` - `"RESOURCE_ROLE_ENVIRONMENT_TASK_VIEWER"` - `"RESOURCE_ROLE_ENVIRONMENT_TASK_USER"` - `"RESOURCE_ROLE_ENVIRONMENT_TASK_ENV"` - `"RESOURCE_ROLE_SERVICE_ACCOUNT_IDENTITY"` - `"RESOURCE_ROLE_SERVICE_ACCOUNT_ADMIN"` - `"RESOURCE_ROLE_AGENT_EXECUTION_USER"` - `"RESOURCE_ROLE_AGENT_EXECUTION_ADMIN"` - `"RESOURCE_ROLE_AGENT_EXECUTION_RUNNER"` - `"RESOURCE_ROLE_AGENT_EXECUTION_OUTPUTS_REPORTER"` - `"RESOURCE_ROLE_AGENT_EXECUTION_VIEWER"` - `"RESOURCE_ROLE_AGENT_ADMIN"` - `"RESOURCE_ROLE_AGENT_VIEWER"` - `"RESOURCE_ROLE_AGENT_EXECUTOR"` - `"RESOURCE_ROLE_WORKFLOW_ADMIN"` - `"RESOURCE_ROLE_WORKFLOW_USER"` - `"RESOURCE_ROLE_WORKFLOW_VIEWER"` - `"RESOURCE_ROLE_WORKFLOW_EXECUTOR"` - `"RESOURCE_ROLE_SNAPSHOT_ADMIN"` - `"RESOURCE_ROLE_SNAPSHOT_RUNNER"` - `"RESOURCE_ROLE_WEBHOOK_ADMIN"` - `"RESOURCE_ROLE_WEBHOOK_VIEWER"` - `"RESOURCE_ROLE_WARMPOOL_RUNNER"` - `"RESOURCE_ROLE_WARMPOOL_ADMIN"` - `"RESOURCE_ROLE_WARMPOOL_VIEWER"` - `"RESOURCE_ROLE_SESSION_ADMIN"` - `"RESOURCE_ROLE_SESSION_USER"` - `"RESOURCE_ROLE_TEAM_ADMIN"` - `"RESOURCE_ROLE_TEAM_VIEWER"` - `groupId?: string` Group identifier - `organizationId?: string` Organization identifier - `resourceId?: string` Resource identifier - `resourceRole?: ResourceRole` Role assigned to the group on this resource - `resourceType?: ResourceType` Type of resource (runner, project, environment, etc.) - `"RESOURCE_TYPE_UNSPECIFIED"` - `"RESOURCE_TYPE_ENVIRONMENT"` - `"RESOURCE_TYPE_RUNNER"` - `"RESOURCE_TYPE_PROJECT"` - `"RESOURCE_TYPE_TASK"` - `"RESOURCE_TYPE_TASK_EXECUTION"` - `"RESOURCE_TYPE_SERVICE"` - `"RESOURCE_TYPE_ORGANIZATION"` - `"RESOURCE_TYPE_USER"` - `"RESOURCE_TYPE_ENVIRONMENT_CLASS"` - `"RESOURCE_TYPE_RUNNER_SCM_INTEGRATION"` - `"RESOURCE_TYPE_HOST_AUTHENTICATION_TOKEN"` - `"RESOURCE_TYPE_GROUP"` - `"RESOURCE_TYPE_PERSONAL_ACCESS_TOKEN"` - `"RESOURCE_TYPE_USER_PREFERENCE"` - `"RESOURCE_TYPE_SERVICE_ACCOUNT"` - `"RESOURCE_TYPE_SECRET"` - `"RESOURCE_TYPE_SSO_CONFIG"` - `"RESOURCE_TYPE_DOMAIN_VERIFICATION"` - `"RESOURCE_TYPE_AGENT_EXECUTION"` - `"RESOURCE_TYPE_RUNNER_LLM_INTEGRATION"` - `"RESOURCE_TYPE_AGENT"` - `"RESOURCE_TYPE_ENVIRONMENT_SESSION"` - `"RESOURCE_TYPE_USER_SECRET"` - `"RESOURCE_TYPE_ORGANIZATION_POLICY"` - `"RESOURCE_TYPE_ORGANIZATION_SECRET"` - `"RESOURCE_TYPE_PROJECT_ENVIRONMENT_CLASS"` - `"RESOURCE_TYPE_BILLING"` - `"RESOURCE_TYPE_PROMPT"` - `"RESOURCE_TYPE_COUPON"` - `"RESOURCE_TYPE_COUPON_REDEMPTION"` - `"RESOURCE_TYPE_ACCOUNT"` - `"RESOURCE_TYPE_INTEGRATION"` - `"RESOURCE_TYPE_WORKFLOW"` - `"RESOURCE_TYPE_WORKFLOW_EXECUTION"` - `"RESOURCE_TYPE_WORKFLOW_EXECUTION_ACTION"` - `"RESOURCE_TYPE_SNAPSHOT"` - `"RESOURCE_TYPE_PREBUILD"` - `"RESOURCE_TYPE_ORGANIZATION_LLM_INTEGRATION"` - `"RESOURCE_TYPE_CUSTOM_DOMAIN"` - `"RESOURCE_TYPE_ROLE_ASSIGNMENT_CHANGED"` - `"RESOURCE_TYPE_GROUP_MEMBERSHIP_CHANGED"` - `"RESOURCE_TYPE_WEBHOOK"` - `"RESOURCE_TYPE_SCIM_CONFIGURATION"` - `"RESOURCE_TYPE_SERVICE_ACCOUNT_SECRET"` - `"RESOURCE_TYPE_ANNOUNCEMENT_BANNER"` - `"RESOURCE_TYPE_SERVICE_ACCOUNT_TOKEN"` - `"RESOURCE_TYPE_ROLE_ASSIGNMENT"` - `"RESOURCE_TYPE_WARM_POOL"` - `"RESOURCE_TYPE_NOTIFICATION"` ### Example ```typescript import Gitpod from '@gitpod/sdk'; const client = new Gitpod({ bearerToken: process.env['GITPOD_API_KEY'], // This is the default and can be omitted }); const roleAssignment = await client.groups.roleAssignments.create({ groupId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', resourceId: 'f53d2330-3795-4c5d-a1f3-453121af9c60', resourceRole: 'RESOURCE_ROLE_RUNNER_ADMIN', resourceType: 'RESOURCE_TYPE_RUNNER', }); console.log(roleAssignment.assignment); ``` #### Response ```json { "assignment": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "derivedFromOrgRole": "RESOURCE_ROLE_UNSPECIFIED", "groupId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "resourceId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "resourceRole": "RESOURCE_ROLE_UNSPECIFIED", "resourceType": "RESOURCE_TYPE_UNSPECIFIED" } } ``` ## DeleteRoleAssignment `client.groups.roleAssignments.delete(RoleAssignmentDeleteParamsbody, RequestOptionsoptions?): RoleAssignmentDeleteResponse` **post** `/gitpod.v1.GroupService/DeleteRoleAssignment` Deletes a role assignment. Use this method to: - Remove group access to resources - Revoke role-based permissions ### Examples - Delete a role assignment: Removes a role assignment by its ID. ```yaml assignmentId: "a1b2c3d4-5678-90ab-cdef-1234567890ab" ``` ### Authorization Requires admin role on the specific resource. ### Parameters - `body: RoleAssignmentDeleteParams` - `assignmentId?: string` ### Returns - `RoleAssignmentDeleteResponse = unknown` Empty response ### Example ```typescript import Gitpod from '@gitpod/sdk'; const client = new Gitpod({ bearerToken: process.env['GITPOD_API_KEY'], // This is the default and can be omitted }); const roleAssignment = await client.groups.roleAssignments.delete({ assignmentId: 'a1b2c3d4-5678-90ab-cdef-1234567890ab', }); console.log(roleAssignment); ``` #### Response ```json {} ``` ## ListRoleAssignments `client.groups.roleAssignments.list(RoleAssignmentListParamsparams, RequestOptionsoptions?): AssignmentsPage` **post** `/gitpod.v1.GroupService/ListRoleAssignments` Lists role assignments for a group or resource. Use this method to: - View all role assignments for a group - Audit resource access - Check which groups have access to resources ### Examples - List role assignments for a group: Shows all role assignments for a specific group. ```yaml filter: groupId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" pagination: pageSize: 20 ``` - List role assignments by resource type: Shows all role assignments for runners. ```yaml filter: resourceTypes: - RESOURCE_TYPE_RUNNER pagination: pageSize: 20 ``` ### Authorization All organization members can view role assignments (transparency model). ### Parameters - `params: RoleAssignmentListParams` - `token?: string` Query param - `pageSize?: number` Query param - `filter?: Filter` Body param: Filter parameters - `groupId?: string` group_id filters the response to only role assignments for this specific group Empty string is allowed and means no filtering by group - `resourceId?: string` Filters by a single resource. Non-admin callers with :grant permission on the resource can see role assignments from groups they don't belong to. Mutually exclusive with resource_ids. - `resourceIds?: Array` Filters by multiple resources in a single request. Non-admin callers with :grant permission on a resource can see all role assignments for that resource, even from groups they don't belong to. The :grant check is applied per-resource within the batch. Mutually exclusive with resource_id. - `resourceRoles?: Array` resource_roles filters the response to only role assignments with these specific roles - `"RESOURCE_ROLE_UNSPECIFIED"` - `"RESOURCE_ROLE_ORG_ADMIN"` - `"RESOURCE_ROLE_ORG_MEMBER"` - `"RESOURCE_ROLE_ORG_RUNNERS_ADMIN"` - `"RESOURCE_ROLE_ORG_PROJECTS_ADMIN"` - `"RESOURCE_ROLE_ORG_AUTOMATIONS_ADMIN"` - `"RESOURCE_ROLE_ORG_GROUPS_ADMIN"` - `"RESOURCE_ROLE_ORG_AUDIT_LOG_READER"` - `"RESOURCE_ROLE_GROUP_ADMIN"` - `"RESOURCE_ROLE_GROUP_VIEWER"` - `"RESOURCE_ROLE_USER_IDENTITY"` - `"RESOURCE_ROLE_USER_VIEWER"` - `"RESOURCE_ROLE_USER_ADMIN"` - `"RESOURCE_ROLE_ENVIRONMENT_IDENTITY"` - `"RESOURCE_ROLE_ENVIRONMENT_ADMIN"` - `"RESOURCE_ROLE_ENVIRONMENT_USER"` - `"RESOURCE_ROLE_ENVIRONMENT_VIEWER"` - `"RESOURCE_ROLE_ENVIRONMENT_RUNNER"` - `"RESOURCE_ROLE_RUNNER_IDENTITY"` - `"RESOURCE_ROLE_RUNNER_ADMIN"` - `"RESOURCE_ROLE_RUNNER_LOCAL_ADMIN"` - `"RESOURCE_ROLE_RUNNER_MANAGED_ADMIN"` - `"RESOURCE_ROLE_RUNNER_USER"` - `"RESOURCE_ROLE_RUNNER_CONFIGURATION_READER"` - `"RESOURCE_ROLE_HOST_AUTHENTICATION_TOKEN_ADMIN"` - `"RESOURCE_ROLE_HOST_AUTHENTICATION_TOKEN_UPDATER"` - `"RESOURCE_ROLE_PROJECT_ADMIN"` - `"RESOURCE_ROLE_PROJECT_USER"` - `"RESOURCE_ROLE_PROJECT_EDITOR"` - `"RESOURCE_ROLE_ENVIRONMENT_SERVICE_ADMIN"` - `"RESOURCE_ROLE_ENVIRONMENT_SERVICE_VIEWER"` - `"RESOURCE_ROLE_ENVIRONMENT_SERVICE_USER"` - `"RESOURCE_ROLE_ENVIRONMENT_SERVICE_ENV"` - `"RESOURCE_ROLE_ENVIRONMENT_TASK_ADMIN"` - `"RESOURCE_ROLE_ENVIRONMENT_TASK_VIEWER"` - `"RESOURCE_ROLE_ENVIRONMENT_TASK_USER"` - `"RESOURCE_ROLE_ENVIRONMENT_TASK_ENV"` - `"RESOURCE_ROLE_SERVICE_ACCOUNT_IDENTITY"` - `"RESOURCE_ROLE_SERVICE_ACCOUNT_ADMIN"` - `"RESOURCE_ROLE_AGENT_EXECUTION_USER"` - `"RESOURCE_ROLE_AGENT_EXECUTION_ADMIN"` - `"RESOURCE_ROLE_AGENT_EXECUTION_RUNNER"` - `"RESOURCE_ROLE_AGENT_EXECUTION_OUTPUTS_REPORTER"` - `"RESOURCE_ROLE_AGENT_EXECUTION_VIEWER"` - `"RESOURCE_ROLE_AGENT_ADMIN"` - `"RESOURCE_ROLE_AGENT_VIEWER"` - `"RESOURCE_ROLE_AGENT_EXECUTOR"` - `"RESOURCE_ROLE_WORKFLOW_ADMIN"` - `"RESOURCE_ROLE_WORKFLOW_USER"` - `"RESOURCE_ROLE_WORKFLOW_VIEWER"` - `"RESOURCE_ROLE_WORKFLOW_EXECUTOR"` - `"RESOURCE_ROLE_SNAPSHOT_ADMIN"` - `"RESOURCE_ROLE_SNAPSHOT_RUNNER"` - `"RESOURCE_ROLE_WEBHOOK_ADMIN"` - `"RESOURCE_ROLE_WEBHOOK_VIEWER"` - `"RESOURCE_ROLE_WARMPOOL_RUNNER"` - `"RESOURCE_ROLE_WARMPOOL_ADMIN"` - `"RESOURCE_ROLE_WARMPOOL_VIEWER"` - `"RESOURCE_ROLE_SESSION_ADMIN"` - `"RESOURCE_ROLE_SESSION_USER"` - `"RESOURCE_ROLE_TEAM_ADMIN"` - `"RESOURCE_ROLE_TEAM_VIEWER"` - `resourceTypes?: Array` resource_types filters the response to only role assignments for these resource types - `"RESOURCE_TYPE_UNSPECIFIED"` - `"RESOURCE_TYPE_ENVIRONMENT"` - `"RESOURCE_TYPE_RUNNER"` - `"RESOURCE_TYPE_PROJECT"` - `"RESOURCE_TYPE_TASK"` - `"RESOURCE_TYPE_TASK_EXECUTION"` - `"RESOURCE_TYPE_SERVICE"` - `"RESOURCE_TYPE_ORGANIZATION"` - `"RESOURCE_TYPE_USER"` - `"RESOURCE_TYPE_ENVIRONMENT_CLASS"` - `"RESOURCE_TYPE_RUNNER_SCM_INTEGRATION"` - `"RESOURCE_TYPE_HOST_AUTHENTICATION_TOKEN"` - `"RESOURCE_TYPE_GROUP"` - `"RESOURCE_TYPE_PERSONAL_ACCESS_TOKEN"` - `"RESOURCE_TYPE_USER_PREFERENCE"` - `"RESOURCE_TYPE_SERVICE_ACCOUNT"` - `"RESOURCE_TYPE_SECRET"` - `"RESOURCE_TYPE_SSO_CONFIG"` - `"RESOURCE_TYPE_DOMAIN_VERIFICATION"` - `"RESOURCE_TYPE_AGENT_EXECUTION"` - `"RESOURCE_TYPE_RUNNER_LLM_INTEGRATION"` - `"RESOURCE_TYPE_AGENT"` - `"RESOURCE_TYPE_ENVIRONMENT_SESSION"` - `"RESOURCE_TYPE_USER_SECRET"` - `"RESOURCE_TYPE_ORGANIZATION_POLICY"` - `"RESOURCE_TYPE_ORGANIZATION_SECRET"` - `"RESOURCE_TYPE_PROJECT_ENVIRONMENT_CLASS"` - `"RESOURCE_TYPE_BILLING"` - `"RESOURCE_TYPE_PROMPT"` - `"RESOURCE_TYPE_COUPON"` - `"RESOURCE_TYPE_COUPON_REDEMPTION"` - `"RESOURCE_TYPE_ACCOUNT"` - `"RESOURCE_TYPE_INTEGRATION"` - `"RESOURCE_TYPE_WORKFLOW"` - `"RESOURCE_TYPE_WORKFLOW_EXECUTION"` - `"RESOURCE_TYPE_WORKFLOW_EXECUTION_ACTION"` - `"RESOURCE_TYPE_SNAPSHOT"` - `"RESOURCE_TYPE_PREBUILD"` - `"RESOURCE_TYPE_ORGANIZATION_LLM_INTEGRATION"` - `"RESOURCE_TYPE_CUSTOM_DOMAIN"` - `"RESOURCE_TYPE_ROLE_ASSIGNMENT_CHANGED"` - `"RESOURCE_TYPE_GROUP_MEMBERSHIP_CHANGED"` - `"RESOURCE_TYPE_WEBHOOK"` - `"RESOURCE_TYPE_SCIM_CONFIGURATION"` - `"RESOURCE_TYPE_SERVICE_ACCOUNT_SECRET"` - `"RESOURCE_TYPE_ANNOUNCEMENT_BANNER"` - `"RESOURCE_TYPE_SERVICE_ACCOUNT_TOKEN"` - `"RESOURCE_TYPE_ROLE_ASSIGNMENT"` - `"RESOURCE_TYPE_WARM_POOL"` - `"RESOURCE_TYPE_NOTIFICATION"` - `userId?: string` user_id filters the response to only role assignments for groups that this user is a member of Empty string is allowed and means no filtering by user - `pagination?: Pagination` Body param: Pagination parameters - `token?: string` Token for the next set of results that was returned as next_token of a PaginationResponse - `pageSize?: number` Page size is the maximum number of results to retrieve per page. Defaults to 25. Maximum 100. ### Returns - `RoleAssignment` RoleAssignment represents a role assigned to a group on a specific resource - `id?: string` Unique identifier for the role assignment - `derivedFromOrgRole?: ResourceRole | null` The org-level role that created this assignment, if any. RESOURCE_ROLE_UNSPECIFIED means this is a direct share (manually created). Non-zero (e.g., ORG_PROJECTS_ADMIN, ORG_RUNNERS_ADMIN) means this assignment was derived from an org-level role. - `"RESOURCE_ROLE_UNSPECIFIED"` - `"RESOURCE_ROLE_ORG_ADMIN"` - `"RESOURCE_ROLE_ORG_MEMBER"` - `"RESOURCE_ROLE_ORG_RUNNERS_ADMIN"` - `"RESOURCE_ROLE_ORG_PROJECTS_ADMIN"` - `"RESOURCE_ROLE_ORG_AUTOMATIONS_ADMIN"` - `"RESOURCE_ROLE_ORG_GROUPS_ADMIN"` - `"RESOURCE_ROLE_ORG_AUDIT_LOG_READER"` - `"RESOURCE_ROLE_GROUP_ADMIN"` - `"RESOURCE_ROLE_GROUP_VIEWER"` - `"RESOURCE_ROLE_USER_IDENTITY"` - `"RESOURCE_ROLE_USER_VIEWER"` - `"RESOURCE_ROLE_USER_ADMIN"` - `"RESOURCE_ROLE_ENVIRONMENT_IDENTITY"` - `"RESOURCE_ROLE_ENVIRONMENT_ADMIN"` - `"RESOURCE_ROLE_ENVIRONMENT_USER"` - `"RESOURCE_ROLE_ENVIRONMENT_VIEWER"` - `"RESOURCE_ROLE_ENVIRONMENT_RUNNER"` - `"RESOURCE_ROLE_RUNNER_IDENTITY"` - `"RESOURCE_ROLE_RUNNER_ADMIN"` - `"RESOURCE_ROLE_RUNNER_LOCAL_ADMIN"` - `"RESOURCE_ROLE_RUNNER_MANAGED_ADMIN"` - `"RESOURCE_ROLE_RUNNER_USER"` - `"RESOURCE_ROLE_RUNNER_CONFIGURATION_READER"` - `"RESOURCE_ROLE_HOST_AUTHENTICATION_TOKEN_ADMIN"` - `"RESOURCE_ROLE_HOST_AUTHENTICATION_TOKEN_UPDATER"` - `"RESOURCE_ROLE_PROJECT_ADMIN"` - `"RESOURCE_ROLE_PROJECT_USER"` - `"RESOURCE_ROLE_PROJECT_EDITOR"` - `"RESOURCE_ROLE_ENVIRONMENT_SERVICE_ADMIN"` - `"RESOURCE_ROLE_ENVIRONMENT_SERVICE_VIEWER"` - `"RESOURCE_ROLE_ENVIRONMENT_SERVICE_USER"` - `"RESOURCE_ROLE_ENVIRONMENT_SERVICE_ENV"` - `"RESOURCE_ROLE_ENVIRONMENT_TASK_ADMIN"` - `"RESOURCE_ROLE_ENVIRONMENT_TASK_VIEWER"` - `"RESOURCE_ROLE_ENVIRONMENT_TASK_USER"` - `"RESOURCE_ROLE_ENVIRONMENT_TASK_ENV"` - `"RESOURCE_ROLE_SERVICE_ACCOUNT_IDENTITY"` - `"RESOURCE_ROLE_SERVICE_ACCOUNT_ADMIN"` - `"RESOURCE_ROLE_AGENT_EXECUTION_USER"` - `"RESOURCE_ROLE_AGENT_EXECUTION_ADMIN"` - `"RESOURCE_ROLE_AGENT_EXECUTION_RUNNER"` - `"RESOURCE_ROLE_AGENT_EXECUTION_OUTPUTS_REPORTER"` - `"RESOURCE_ROLE_AGENT_EXECUTION_VIEWER"` - `"RESOURCE_ROLE_AGENT_ADMIN"` - `"RESOURCE_ROLE_AGENT_VIEWER"` - `"RESOURCE_ROLE_AGENT_EXECUTOR"` - `"RESOURCE_ROLE_WORKFLOW_ADMIN"` - `"RESOURCE_ROLE_WORKFLOW_USER"` - `"RESOURCE_ROLE_WORKFLOW_VIEWER"` - `"RESOURCE_ROLE_WORKFLOW_EXECUTOR"` - `"RESOURCE_ROLE_SNAPSHOT_ADMIN"` - `"RESOURCE_ROLE_SNAPSHOT_RUNNER"` - `"RESOURCE_ROLE_WEBHOOK_ADMIN"` - `"RESOURCE_ROLE_WEBHOOK_VIEWER"` - `"RESOURCE_ROLE_WARMPOOL_RUNNER"` - `"RESOURCE_ROLE_WARMPOOL_ADMIN"` - `"RESOURCE_ROLE_WARMPOOL_VIEWER"` - `"RESOURCE_ROLE_SESSION_ADMIN"` - `"RESOURCE_ROLE_SESSION_USER"` - `"RESOURCE_ROLE_TEAM_ADMIN"` - `"RESOURCE_ROLE_TEAM_VIEWER"` - `groupId?: string` Group identifier - `organizationId?: string` Organization identifier - `resourceId?: string` Resource identifier - `resourceRole?: ResourceRole` Role assigned to the group on this resource - `resourceType?: ResourceType` Type of resource (runner, project, environment, etc.) - `"RESOURCE_TYPE_UNSPECIFIED"` - `"RESOURCE_TYPE_ENVIRONMENT"` - `"RESOURCE_TYPE_RUNNER"` - `"RESOURCE_TYPE_PROJECT"` - `"RESOURCE_TYPE_TASK"` - `"RESOURCE_TYPE_TASK_EXECUTION"` - `"RESOURCE_TYPE_SERVICE"` - `"RESOURCE_TYPE_ORGANIZATION"` - `"RESOURCE_TYPE_USER"` - `"RESOURCE_TYPE_ENVIRONMENT_CLASS"` - `"RESOURCE_TYPE_RUNNER_SCM_INTEGRATION"` - `"RESOURCE_TYPE_HOST_AUTHENTICATION_TOKEN"` - `"RESOURCE_TYPE_GROUP"` - `"RESOURCE_TYPE_PERSONAL_ACCESS_TOKEN"` - `"RESOURCE_TYPE_USER_PREFERENCE"` - `"RESOURCE_TYPE_SERVICE_ACCOUNT"` - `"RESOURCE_TYPE_SECRET"` - `"RESOURCE_TYPE_SSO_CONFIG"` - `"RESOURCE_TYPE_DOMAIN_VERIFICATION"` - `"RESOURCE_TYPE_AGENT_EXECUTION"` - `"RESOURCE_TYPE_RUNNER_LLM_INTEGRATION"` - `"RESOURCE_TYPE_AGENT"` - `"RESOURCE_TYPE_ENVIRONMENT_SESSION"` - `"RESOURCE_TYPE_USER_SECRET"` - `"RESOURCE_TYPE_ORGANIZATION_POLICY"` - `"RESOURCE_TYPE_ORGANIZATION_SECRET"` - `"RESOURCE_TYPE_PROJECT_ENVIRONMENT_CLASS"` - `"RESOURCE_TYPE_BILLING"` - `"RESOURCE_TYPE_PROMPT"` - `"RESOURCE_TYPE_COUPON"` - `"RESOURCE_TYPE_COUPON_REDEMPTION"` - `"RESOURCE_TYPE_ACCOUNT"` - `"RESOURCE_TYPE_INTEGRATION"` - `"RESOURCE_TYPE_WORKFLOW"` - `"RESOURCE_TYPE_WORKFLOW_EXECUTION"` - `"RESOURCE_TYPE_WORKFLOW_EXECUTION_ACTION"` - `"RESOURCE_TYPE_SNAPSHOT"` - `"RESOURCE_TYPE_PREBUILD"` - `"RESOURCE_TYPE_ORGANIZATION_LLM_INTEGRATION"` - `"RESOURCE_TYPE_CUSTOM_DOMAIN"` - `"RESOURCE_TYPE_ROLE_ASSIGNMENT_CHANGED"` - `"RESOURCE_TYPE_GROUP_MEMBERSHIP_CHANGED"` - `"RESOURCE_TYPE_WEBHOOK"` - `"RESOURCE_TYPE_SCIM_CONFIGURATION"` - `"RESOURCE_TYPE_SERVICE_ACCOUNT_SECRET"` - `"RESOURCE_TYPE_ANNOUNCEMENT_BANNER"` - `"RESOURCE_TYPE_SERVICE_ACCOUNT_TOKEN"` - `"RESOURCE_TYPE_ROLE_ASSIGNMENT"` - `"RESOURCE_TYPE_WARM_POOL"` - `"RESOURCE_TYPE_NOTIFICATION"` ### Example ```typescript import Gitpod from '@gitpod/sdk'; const client = new Gitpod({ bearerToken: process.env['GITPOD_API_KEY'], // This is the default and can be omitted }); // Automatically fetches more pages as needed. for await (const roleAssignment of client.groups.roleAssignments.list({ filter: { resourceTypes: ['RESOURCE_TYPE_RUNNER'] }, pagination: { pageSize: 20 }, })) { console.log(roleAssignment.id); } ``` #### Response ```json { "assignments": [ { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "derivedFromOrgRole": "RESOURCE_ROLE_UNSPECIFIED", "groupId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "resourceId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "resourceRole": "RESOURCE_ROLE_UNSPECIFIED", "resourceType": "RESOURCE_TYPE_UNSPECIFIED" } ], "pagination": { "nextToken": "nextToken" } } ``` ## Domain Types ### Role Assignment - `RoleAssignment` RoleAssignment represents a role assigned to a group on a specific resource - `id?: string` Unique identifier for the role assignment - `derivedFromOrgRole?: ResourceRole | null` The org-level role that created this assignment, if any. RESOURCE_ROLE_UNSPECIFIED means this is a direct share (manually created). Non-zero (e.g., ORG_PROJECTS_ADMIN, ORG_RUNNERS_ADMIN) means this assignment was derived from an org-level role. - `"RESOURCE_ROLE_UNSPECIFIED"` - `"RESOURCE_ROLE_ORG_ADMIN"` - `"RESOURCE_ROLE_ORG_MEMBER"` - `"RESOURCE_ROLE_ORG_RUNNERS_ADMIN"` - `"RESOURCE_ROLE_ORG_PROJECTS_ADMIN"` - `"RESOURCE_ROLE_ORG_AUTOMATIONS_ADMIN"` - `"RESOURCE_ROLE_ORG_GROUPS_ADMIN"` - `"RESOURCE_ROLE_ORG_AUDIT_LOG_READER"` - `"RESOURCE_ROLE_GROUP_ADMIN"` - `"RESOURCE_ROLE_GROUP_VIEWER"` - `"RESOURCE_ROLE_USER_IDENTITY"` - `"RESOURCE_ROLE_USER_VIEWER"` - `"RESOURCE_ROLE_USER_ADMIN"` - `"RESOURCE_ROLE_ENVIRONMENT_IDENTITY"` - `"RESOURCE_ROLE_ENVIRONMENT_ADMIN"` - `"RESOURCE_ROLE_ENVIRONMENT_USER"` - `"RESOURCE_ROLE_ENVIRONMENT_VIEWER"` - `"RESOURCE_ROLE_ENVIRONMENT_RUNNER"` - `"RESOURCE_ROLE_RUNNER_IDENTITY"` - `"RESOURCE_ROLE_RUNNER_ADMIN"` - `"RESOURCE_ROLE_RUNNER_LOCAL_ADMIN"` - `"RESOURCE_ROLE_RUNNER_MANAGED_ADMIN"` - `"RESOURCE_ROLE_RUNNER_USER"` - `"RESOURCE_ROLE_RUNNER_CONFIGURATION_READER"` - `"RESOURCE_ROLE_HOST_AUTHENTICATION_TOKEN_ADMIN"` - `"RESOURCE_ROLE_HOST_AUTHENTICATION_TOKEN_UPDATER"` - `"RESOURCE_ROLE_PROJECT_ADMIN"` - `"RESOURCE_ROLE_PROJECT_USER"` - `"RESOURCE_ROLE_PROJECT_EDITOR"` - `"RESOURCE_ROLE_ENVIRONMENT_SERVICE_ADMIN"` - `"RESOURCE_ROLE_ENVIRONMENT_SERVICE_VIEWER"` - `"RESOURCE_ROLE_ENVIRONMENT_SERVICE_USER"` - `"RESOURCE_ROLE_ENVIRONMENT_SERVICE_ENV"` - `"RESOURCE_ROLE_ENVIRONMENT_TASK_ADMIN"` - `"RESOURCE_ROLE_ENVIRONMENT_TASK_VIEWER"` - `"RESOURCE_ROLE_ENVIRONMENT_TASK_USER"` - `"RESOURCE_ROLE_ENVIRONMENT_TASK_ENV"` - `"RESOURCE_ROLE_SERVICE_ACCOUNT_IDENTITY"` - `"RESOURCE_ROLE_SERVICE_ACCOUNT_ADMIN"` - `"RESOURCE_ROLE_AGENT_EXECUTION_USER"` - `"RESOURCE_ROLE_AGENT_EXECUTION_ADMIN"` - `"RESOURCE_ROLE_AGENT_EXECUTION_RUNNER"` - `"RESOURCE_ROLE_AGENT_EXECUTION_OUTPUTS_REPORTER"` - `"RESOURCE_ROLE_AGENT_EXECUTION_VIEWER"` - `"RESOURCE_ROLE_AGENT_ADMIN"` - `"RESOURCE_ROLE_AGENT_VIEWER"` - `"RESOURCE_ROLE_AGENT_EXECUTOR"` - `"RESOURCE_ROLE_WORKFLOW_ADMIN"` - `"RESOURCE_ROLE_WORKFLOW_USER"` - `"RESOURCE_ROLE_WORKFLOW_VIEWER"` - `"RESOURCE_ROLE_WORKFLOW_EXECUTOR"` - `"RESOURCE_ROLE_SNAPSHOT_ADMIN"` - `"RESOURCE_ROLE_SNAPSHOT_RUNNER"` - `"RESOURCE_ROLE_WEBHOOK_ADMIN"` - `"RESOURCE_ROLE_WEBHOOK_VIEWER"` - `"RESOURCE_ROLE_WARMPOOL_RUNNER"` - `"RESOURCE_ROLE_WARMPOOL_ADMIN"` - `"RESOURCE_ROLE_WARMPOOL_VIEWER"` - `"RESOURCE_ROLE_SESSION_ADMIN"` - `"RESOURCE_ROLE_SESSION_USER"` - `"RESOURCE_ROLE_TEAM_ADMIN"` - `"RESOURCE_ROLE_TEAM_VIEWER"` - `groupId?: string` Group identifier - `organizationId?: string` Organization identifier - `resourceId?: string` Resource identifier - `resourceRole?: ResourceRole` Role assigned to the group on this resource - `resourceType?: ResourceType` Type of resource (runner, project, environment, etc.) - `"RESOURCE_TYPE_UNSPECIFIED"` - `"RESOURCE_TYPE_ENVIRONMENT"` - `"RESOURCE_TYPE_RUNNER"` - `"RESOURCE_TYPE_PROJECT"` - `"RESOURCE_TYPE_TASK"` - `"RESOURCE_TYPE_TASK_EXECUTION"` - `"RESOURCE_TYPE_SERVICE"` - `"RESOURCE_TYPE_ORGANIZATION"` - `"RESOURCE_TYPE_USER"` - `"RESOURCE_TYPE_ENVIRONMENT_CLASS"` - `"RESOURCE_TYPE_RUNNER_SCM_INTEGRATION"` - `"RESOURCE_TYPE_HOST_AUTHENTICATION_TOKEN"` - `"RESOURCE_TYPE_GROUP"` - `"RESOURCE_TYPE_PERSONAL_ACCESS_TOKEN"` - `"RESOURCE_TYPE_USER_PREFERENCE"` - `"RESOURCE_TYPE_SERVICE_ACCOUNT"` - `"RESOURCE_TYPE_SECRET"` - `"RESOURCE_TYPE_SSO_CONFIG"` - `"RESOURCE_TYPE_DOMAIN_VERIFICATION"` - `"RESOURCE_TYPE_AGENT_EXECUTION"` - `"RESOURCE_TYPE_RUNNER_LLM_INTEGRATION"` - `"RESOURCE_TYPE_AGENT"` - `"RESOURCE_TYPE_ENVIRONMENT_SESSION"` - `"RESOURCE_TYPE_USER_SECRET"` - `"RESOURCE_TYPE_ORGANIZATION_POLICY"` - `"RESOURCE_TYPE_ORGANIZATION_SECRET"` - `"RESOURCE_TYPE_PROJECT_ENVIRONMENT_CLASS"` - `"RESOURCE_TYPE_BILLING"` - `"RESOURCE_TYPE_PROMPT"` - `"RESOURCE_TYPE_COUPON"` - `"RESOURCE_TYPE_COUPON_REDEMPTION"` - `"RESOURCE_TYPE_ACCOUNT"` - `"RESOURCE_TYPE_INTEGRATION"` - `"RESOURCE_TYPE_WORKFLOW"` - `"RESOURCE_TYPE_WORKFLOW_EXECUTION"` - `"RESOURCE_TYPE_WORKFLOW_EXECUTION_ACTION"` - `"RESOURCE_TYPE_SNAPSHOT"` - `"RESOURCE_TYPE_PREBUILD"` - `"RESOURCE_TYPE_ORGANIZATION_LLM_INTEGRATION"` - `"RESOURCE_TYPE_CUSTOM_DOMAIN"` - `"RESOURCE_TYPE_ROLE_ASSIGNMENT_CHANGED"` - `"RESOURCE_TYPE_GROUP_MEMBERSHIP_CHANGED"` - `"RESOURCE_TYPE_WEBHOOK"` - `"RESOURCE_TYPE_SCIM_CONFIGURATION"` - `"RESOURCE_TYPE_SERVICE_ACCOUNT_SECRET"` - `"RESOURCE_TYPE_ANNOUNCEMENT_BANNER"` - `"RESOURCE_TYPE_SERVICE_ACCOUNT_TOKEN"` - `"RESOURCE_TYPE_ROLE_ASSIGNMENT"` - `"RESOURCE_TYPE_WARM_POOL"` - `"RESOURCE_TYPE_NOTIFICATION"` ### Role Assignment Create Response - `RoleAssignmentCreateResponse` - `assignment?: RoleAssignment` RoleAssignment represents a role assigned to a group on a specific resource - `id?: string` Unique identifier for the role assignment - `derivedFromOrgRole?: ResourceRole | null` The org-level role that created this assignment, if any. RESOURCE_ROLE_UNSPECIFIED means this is a direct share (manually created). Non-zero (e.g., ORG_PROJECTS_ADMIN, ORG_RUNNERS_ADMIN) means this assignment was derived from an org-level role. - `"RESOURCE_ROLE_UNSPECIFIED"` - `"RESOURCE_ROLE_ORG_ADMIN"` - `"RESOURCE_ROLE_ORG_MEMBER"` - `"RESOURCE_ROLE_ORG_RUNNERS_ADMIN"` - `"RESOURCE_ROLE_ORG_PROJECTS_ADMIN"` - `"RESOURCE_ROLE_ORG_AUTOMATIONS_ADMIN"` - `"RESOURCE_ROLE_ORG_GROUPS_ADMIN"` - `"RESOURCE_ROLE_ORG_AUDIT_LOG_READER"` - `"RESOURCE_ROLE_GROUP_ADMIN"` - `"RESOURCE_ROLE_GROUP_VIEWER"` - `"RESOURCE_ROLE_USER_IDENTITY"` - `"RESOURCE_ROLE_USER_VIEWER"` - `"RESOURCE_ROLE_USER_ADMIN"` - `"RESOURCE_ROLE_ENVIRONMENT_IDENTITY"` - `"RESOURCE_ROLE_ENVIRONMENT_ADMIN"` - `"RESOURCE_ROLE_ENVIRONMENT_USER"` - `"RESOURCE_ROLE_ENVIRONMENT_VIEWER"` - `"RESOURCE_ROLE_ENVIRONMENT_RUNNER"` - `"RESOURCE_ROLE_RUNNER_IDENTITY"` - `"RESOURCE_ROLE_RUNNER_ADMIN"` - `"RESOURCE_ROLE_RUNNER_LOCAL_ADMIN"` - `"RESOURCE_ROLE_RUNNER_MANAGED_ADMIN"` - `"RESOURCE_ROLE_RUNNER_USER"` - `"RESOURCE_ROLE_RUNNER_CONFIGURATION_READER"` - `"RESOURCE_ROLE_HOST_AUTHENTICATION_TOKEN_ADMIN"` - `"RESOURCE_ROLE_HOST_AUTHENTICATION_TOKEN_UPDATER"` - `"RESOURCE_ROLE_PROJECT_ADMIN"` - `"RESOURCE_ROLE_PROJECT_USER"` - `"RESOURCE_ROLE_PROJECT_EDITOR"` - `"RESOURCE_ROLE_ENVIRONMENT_SERVICE_ADMIN"` - `"RESOURCE_ROLE_ENVIRONMENT_SERVICE_VIEWER"` - `"RESOURCE_ROLE_ENVIRONMENT_SERVICE_USER"` - `"RESOURCE_ROLE_ENVIRONMENT_SERVICE_ENV"` - `"RESOURCE_ROLE_ENVIRONMENT_TASK_ADMIN"` - `"RESOURCE_ROLE_ENVIRONMENT_TASK_VIEWER"` - `"RESOURCE_ROLE_ENVIRONMENT_TASK_USER"` - `"RESOURCE_ROLE_ENVIRONMENT_TASK_ENV"` - `"RESOURCE_ROLE_SERVICE_ACCOUNT_IDENTITY"` - `"RESOURCE_ROLE_SERVICE_ACCOUNT_ADMIN"` - `"RESOURCE_ROLE_AGENT_EXECUTION_USER"` - `"RESOURCE_ROLE_AGENT_EXECUTION_ADMIN"` - `"RESOURCE_ROLE_AGENT_EXECUTION_RUNNER"` - `"RESOURCE_ROLE_AGENT_EXECUTION_OUTPUTS_REPORTER"` - `"RESOURCE_ROLE_AGENT_EXECUTION_VIEWER"` - `"RESOURCE_ROLE_AGENT_ADMIN"` - `"RESOURCE_ROLE_AGENT_VIEWER"` - `"RESOURCE_ROLE_AGENT_EXECUTOR"` - `"RESOURCE_ROLE_WORKFLOW_ADMIN"` - `"RESOURCE_ROLE_WORKFLOW_USER"` - `"RESOURCE_ROLE_WORKFLOW_VIEWER"` - `"RESOURCE_ROLE_WORKFLOW_EXECUTOR"` - `"RESOURCE_ROLE_SNAPSHOT_ADMIN"` - `"RESOURCE_ROLE_SNAPSHOT_RUNNER"` - `"RESOURCE_ROLE_WEBHOOK_ADMIN"` - `"RESOURCE_ROLE_WEBHOOK_VIEWER"` - `"RESOURCE_ROLE_WARMPOOL_RUNNER"` - `"RESOURCE_ROLE_WARMPOOL_ADMIN"` - `"RESOURCE_ROLE_WARMPOOL_VIEWER"` - `"RESOURCE_ROLE_SESSION_ADMIN"` - `"RESOURCE_ROLE_SESSION_USER"` - `"RESOURCE_ROLE_TEAM_ADMIN"` - `"RESOURCE_ROLE_TEAM_VIEWER"` - `groupId?: string` Group identifier - `organizationId?: string` Organization identifier - `resourceId?: string` Resource identifier - `resourceRole?: ResourceRole` Role assigned to the group on this resource - `resourceType?: ResourceType` Type of resource (runner, project, environment, etc.) - `"RESOURCE_TYPE_UNSPECIFIED"` - `"RESOURCE_TYPE_ENVIRONMENT"` - `"RESOURCE_TYPE_RUNNER"` - `"RESOURCE_TYPE_PROJECT"` - `"RESOURCE_TYPE_TASK"` - `"RESOURCE_TYPE_TASK_EXECUTION"` - `"RESOURCE_TYPE_SERVICE"` - `"RESOURCE_TYPE_ORGANIZATION"` - `"RESOURCE_TYPE_USER"` - `"RESOURCE_TYPE_ENVIRONMENT_CLASS"` - `"RESOURCE_TYPE_RUNNER_SCM_INTEGRATION"` - `"RESOURCE_TYPE_HOST_AUTHENTICATION_TOKEN"` - `"RESOURCE_TYPE_GROUP"` - `"RESOURCE_TYPE_PERSONAL_ACCESS_TOKEN"` - `"RESOURCE_TYPE_USER_PREFERENCE"` - `"RESOURCE_TYPE_SERVICE_ACCOUNT"` - `"RESOURCE_TYPE_SECRET"` - `"RESOURCE_TYPE_SSO_CONFIG"` - `"RESOURCE_TYPE_DOMAIN_VERIFICATION"` - `"RESOURCE_TYPE_AGENT_EXECUTION"` - `"RESOURCE_TYPE_RUNNER_LLM_INTEGRATION"` - `"RESOURCE_TYPE_AGENT"` - `"RESOURCE_TYPE_ENVIRONMENT_SESSION"` - `"RESOURCE_TYPE_USER_SECRET"` - `"RESOURCE_TYPE_ORGANIZATION_POLICY"` - `"RESOURCE_TYPE_ORGANIZATION_SECRET"` - `"RESOURCE_TYPE_PROJECT_ENVIRONMENT_CLASS"` - `"RESOURCE_TYPE_BILLING"` - `"RESOURCE_TYPE_PROMPT"` - `"RESOURCE_TYPE_COUPON"` - `"RESOURCE_TYPE_COUPON_REDEMPTION"` - `"RESOURCE_TYPE_ACCOUNT"` - `"RESOURCE_TYPE_INTEGRATION"` - `"RESOURCE_TYPE_WORKFLOW"` - `"RESOURCE_TYPE_WORKFLOW_EXECUTION"` - `"RESOURCE_TYPE_WORKFLOW_EXECUTION_ACTION"` - `"RESOURCE_TYPE_SNAPSHOT"` - `"RESOURCE_TYPE_PREBUILD"` - `"RESOURCE_TYPE_ORGANIZATION_LLM_INTEGRATION"` - `"RESOURCE_TYPE_CUSTOM_DOMAIN"` - `"RESOURCE_TYPE_ROLE_ASSIGNMENT_CHANGED"` - `"RESOURCE_TYPE_GROUP_MEMBERSHIP_CHANGED"` - `"RESOURCE_TYPE_WEBHOOK"` - `"RESOURCE_TYPE_SCIM_CONFIGURATION"` - `"RESOURCE_TYPE_SERVICE_ACCOUNT_SECRET"` - `"RESOURCE_TYPE_ANNOUNCEMENT_BANNER"` - `"RESOURCE_TYPE_SERVICE_ACCOUNT_TOKEN"` - `"RESOURCE_TYPE_ROLE_ASSIGNMENT"` - `"RESOURCE_TYPE_WARM_POOL"` - `"RESOURCE_TYPE_NOTIFICATION"` ### Role Assignment Delete Response - `RoleAssignmentDeleteResponse = unknown` Empty response # Shares ## ShareResourceWithPrincipal `client.groups.shares.create(ShareCreateParamsbody, RequestOptionsoptions?): ShareCreateResponse` **post** `/gitpod.v1.GroupService/ShareResourceWithPrincipal` Shares a resource directly with a principal (user or service account). Use this method to: - Grant a user or service account direct access to a runner, project, or other resource - Share resources without creating and managing groups manually ### Examples - Share a runner with a user: Grants admin access to a runner for a specific user. ```yaml resourceType: RESOURCE_TYPE_RUNNER resourceId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" principal: PRINCIPAL_USER principalId: "f53d2330-3795-4c5d-a1f3-453121af9c60" role: RESOURCE_ROLE_RUNNER_ADMIN ``` - Share a runner with a service account: Grants user access to a runner for a service account. ```yaml resourceType: RESOURCE_TYPE_RUNNER resourceId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" principal: PRINCIPAL_SERVICE_ACCOUNT principalId: "a1b2c3d4-5678-90ab-cdef-1234567890ab" role: RESOURCE_ROLE_RUNNER_USER ``` ### Authorization Requires admin role on the specific resource. ### Parameters - `body: ShareCreateParams` - `principal?: Principal` Type of principal to share with (user or service account) - `"PRINCIPAL_UNSPECIFIED"` - `"PRINCIPAL_ACCOUNT"` - `"PRINCIPAL_USER"` - `"PRINCIPAL_RUNNER"` - `"PRINCIPAL_ENVIRONMENT"` - `"PRINCIPAL_SERVICE_ACCOUNT"` - `"PRINCIPAL_RUNNER_MANAGER"` - `principalId?: string` ID of the principal (user or service account) to share with - `resourceId?: string` ID of the resource to share - `resourceType?: ResourceType` Type of resource to share (runner, project, etc.) - `"RESOURCE_TYPE_UNSPECIFIED"` - `"RESOURCE_TYPE_ENVIRONMENT"` - `"RESOURCE_TYPE_RUNNER"` - `"RESOURCE_TYPE_PROJECT"` - `"RESOURCE_TYPE_TASK"` - `"RESOURCE_TYPE_TASK_EXECUTION"` - `"RESOURCE_TYPE_SERVICE"` - `"RESOURCE_TYPE_ORGANIZATION"` - `"RESOURCE_TYPE_USER"` - `"RESOURCE_TYPE_ENVIRONMENT_CLASS"` - `"RESOURCE_TYPE_RUNNER_SCM_INTEGRATION"` - `"RESOURCE_TYPE_HOST_AUTHENTICATION_TOKEN"` - `"RESOURCE_TYPE_GROUP"` - `"RESOURCE_TYPE_PERSONAL_ACCESS_TOKEN"` - `"RESOURCE_TYPE_USER_PREFERENCE"` - `"RESOURCE_TYPE_SERVICE_ACCOUNT"` - `"RESOURCE_TYPE_SECRET"` - `"RESOURCE_TYPE_SSO_CONFIG"` - `"RESOURCE_TYPE_DOMAIN_VERIFICATION"` - `"RESOURCE_TYPE_AGENT_EXECUTION"` - `"RESOURCE_TYPE_RUNNER_LLM_INTEGRATION"` - `"RESOURCE_TYPE_AGENT"` - `"RESOURCE_TYPE_ENVIRONMENT_SESSION"` - `"RESOURCE_TYPE_USER_SECRET"` - `"RESOURCE_TYPE_ORGANIZATION_POLICY"` - `"RESOURCE_TYPE_ORGANIZATION_SECRET"` - `"RESOURCE_TYPE_PROJECT_ENVIRONMENT_CLASS"` - `"RESOURCE_TYPE_BILLING"` - `"RESOURCE_TYPE_PROMPT"` - `"RESOURCE_TYPE_COUPON"` - `"RESOURCE_TYPE_COUPON_REDEMPTION"` - `"RESOURCE_TYPE_ACCOUNT"` - `"RESOURCE_TYPE_INTEGRATION"` - `"RESOURCE_TYPE_WORKFLOW"` - `"RESOURCE_TYPE_WORKFLOW_EXECUTION"` - `"RESOURCE_TYPE_WORKFLOW_EXECUTION_ACTION"` - `"RESOURCE_TYPE_SNAPSHOT"` - `"RESOURCE_TYPE_PREBUILD"` - `"RESOURCE_TYPE_ORGANIZATION_LLM_INTEGRATION"` - `"RESOURCE_TYPE_CUSTOM_DOMAIN"` - `"RESOURCE_TYPE_ROLE_ASSIGNMENT_CHANGED"` - `"RESOURCE_TYPE_GROUP_MEMBERSHIP_CHANGED"` - `"RESOURCE_TYPE_WEBHOOK"` - `"RESOURCE_TYPE_SCIM_CONFIGURATION"` - `"RESOURCE_TYPE_SERVICE_ACCOUNT_SECRET"` - `"RESOURCE_TYPE_ANNOUNCEMENT_BANNER"` - `"RESOURCE_TYPE_SERVICE_ACCOUNT_TOKEN"` - `"RESOURCE_TYPE_ROLE_ASSIGNMENT"` - `"RESOURCE_TYPE_WARM_POOL"` - `"RESOURCE_TYPE_NOTIFICATION"` - `role?: ResourceRole` Role to grant the principal on the resource - `"RESOURCE_ROLE_UNSPECIFIED"` - `"RESOURCE_ROLE_ORG_ADMIN"` - `"RESOURCE_ROLE_ORG_MEMBER"` - `"RESOURCE_ROLE_ORG_RUNNERS_ADMIN"` - `"RESOURCE_ROLE_ORG_PROJECTS_ADMIN"` - `"RESOURCE_ROLE_ORG_AUTOMATIONS_ADMIN"` - `"RESOURCE_ROLE_ORG_GROUPS_ADMIN"` - `"RESOURCE_ROLE_ORG_AUDIT_LOG_READER"` - `"RESOURCE_ROLE_GROUP_ADMIN"` - `"RESOURCE_ROLE_GROUP_VIEWER"` - `"RESOURCE_ROLE_USER_IDENTITY"` - `"RESOURCE_ROLE_USER_VIEWER"` - `"RESOURCE_ROLE_USER_ADMIN"` - `"RESOURCE_ROLE_ENVIRONMENT_IDENTITY"` - `"RESOURCE_ROLE_ENVIRONMENT_ADMIN"` - `"RESOURCE_ROLE_ENVIRONMENT_USER"` - `"RESOURCE_ROLE_ENVIRONMENT_VIEWER"` - `"RESOURCE_ROLE_ENVIRONMENT_RUNNER"` - `"RESOURCE_ROLE_RUNNER_IDENTITY"` - `"RESOURCE_ROLE_RUNNER_ADMIN"` - `"RESOURCE_ROLE_RUNNER_LOCAL_ADMIN"` - `"RESOURCE_ROLE_RUNNER_MANAGED_ADMIN"` - `"RESOURCE_ROLE_RUNNER_USER"` - `"RESOURCE_ROLE_RUNNER_CONFIGURATION_READER"` - `"RESOURCE_ROLE_HOST_AUTHENTICATION_TOKEN_ADMIN"` - `"RESOURCE_ROLE_HOST_AUTHENTICATION_TOKEN_UPDATER"` - `"RESOURCE_ROLE_PROJECT_ADMIN"` - `"RESOURCE_ROLE_PROJECT_USER"` - `"RESOURCE_ROLE_PROJECT_EDITOR"` - `"RESOURCE_ROLE_ENVIRONMENT_SERVICE_ADMIN"` - `"RESOURCE_ROLE_ENVIRONMENT_SERVICE_VIEWER"` - `"RESOURCE_ROLE_ENVIRONMENT_SERVICE_USER"` - `"RESOURCE_ROLE_ENVIRONMENT_SERVICE_ENV"` - `"RESOURCE_ROLE_ENVIRONMENT_TASK_ADMIN"` - `"RESOURCE_ROLE_ENVIRONMENT_TASK_VIEWER"` - `"RESOURCE_ROLE_ENVIRONMENT_TASK_USER"` - `"RESOURCE_ROLE_ENVIRONMENT_TASK_ENV"` - `"RESOURCE_ROLE_SERVICE_ACCOUNT_IDENTITY"` - `"RESOURCE_ROLE_SERVICE_ACCOUNT_ADMIN"` - `"RESOURCE_ROLE_AGENT_EXECUTION_USER"` - `"RESOURCE_ROLE_AGENT_EXECUTION_ADMIN"` - `"RESOURCE_ROLE_AGENT_EXECUTION_RUNNER"` - `"RESOURCE_ROLE_AGENT_EXECUTION_OUTPUTS_REPORTER"` - `"RESOURCE_ROLE_AGENT_EXECUTION_VIEWER"` - `"RESOURCE_ROLE_AGENT_ADMIN"` - `"RESOURCE_ROLE_AGENT_VIEWER"` - `"RESOURCE_ROLE_AGENT_EXECUTOR"` - `"RESOURCE_ROLE_WORKFLOW_ADMIN"` - `"RESOURCE_ROLE_WORKFLOW_USER"` - `"RESOURCE_ROLE_WORKFLOW_VIEWER"` - `"RESOURCE_ROLE_WORKFLOW_EXECUTOR"` - `"RESOURCE_ROLE_SNAPSHOT_ADMIN"` - `"RESOURCE_ROLE_SNAPSHOT_RUNNER"` - `"RESOURCE_ROLE_WEBHOOK_ADMIN"` - `"RESOURCE_ROLE_WEBHOOK_VIEWER"` - `"RESOURCE_ROLE_WARMPOOL_RUNNER"` - `"RESOURCE_ROLE_WARMPOOL_ADMIN"` - `"RESOURCE_ROLE_WARMPOOL_VIEWER"` - `"RESOURCE_ROLE_SESSION_ADMIN"` - `"RESOURCE_ROLE_SESSION_USER"` - `"RESOURCE_ROLE_TEAM_ADMIN"` - `"RESOURCE_ROLE_TEAM_VIEWER"` ### Returns - `ShareCreateResponse = unknown` Empty response on success ### Example ```typescript import Gitpod from '@gitpod/sdk'; const client = new Gitpod({ bearerToken: process.env['GITPOD_API_KEY'], // This is the default and can be omitted }); const share = await client.groups.shares.create({ principal: 'PRINCIPAL_SERVICE_ACCOUNT', principalId: 'a1b2c3d4-5678-90ab-cdef-1234567890ab', resourceId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', resourceType: 'RESOURCE_TYPE_RUNNER', role: 'RESOURCE_ROLE_RUNNER_USER', }); console.log(share); ``` #### Response ```json {} ``` ## UnshareResourceWithPrincipal `client.groups.shares.delete(ShareDeleteParamsbody, RequestOptionsoptions?): ShareDeleteResponse` **post** `/gitpod.v1.GroupService/UnshareResourceWithPrincipal` Removes direct access for a principal (user or service account) from a resource. Use this method to: - Revoke a principal's direct access to a resource - Remove sharing without affecting group-based access ### Examples - Remove user access from a runner: Revokes a user's direct access to a runner. ```yaml resourceType: RESOURCE_TYPE_RUNNER resourceId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" principal: PRINCIPAL_USER principalId: "f53d2330-3795-4c5d-a1f3-453121af9c60" ``` ### Authorization Requires admin role on the specific resource. ### Parameters - `body: ShareDeleteParams` - `principal?: Principal` Type of principal to remove access from (user or service account) - `"PRINCIPAL_UNSPECIFIED"` - `"PRINCIPAL_ACCOUNT"` - `"PRINCIPAL_USER"` - `"PRINCIPAL_RUNNER"` - `"PRINCIPAL_ENVIRONMENT"` - `"PRINCIPAL_SERVICE_ACCOUNT"` - `"PRINCIPAL_RUNNER_MANAGER"` - `principalId?: string` ID of the principal (user or service account) to remove access from - `resourceId?: string` ID of the resource to unshare - `resourceType?: ResourceType` Type of resource to unshare - `"RESOURCE_TYPE_UNSPECIFIED"` - `"RESOURCE_TYPE_ENVIRONMENT"` - `"RESOURCE_TYPE_RUNNER"` - `"RESOURCE_TYPE_PROJECT"` - `"RESOURCE_TYPE_TASK"` - `"RESOURCE_TYPE_TASK_EXECUTION"` - `"RESOURCE_TYPE_SERVICE"` - `"RESOURCE_TYPE_ORGANIZATION"` - `"RESOURCE_TYPE_USER"` - `"RESOURCE_TYPE_ENVIRONMENT_CLASS"` - `"RESOURCE_TYPE_RUNNER_SCM_INTEGRATION"` - `"RESOURCE_TYPE_HOST_AUTHENTICATION_TOKEN"` - `"RESOURCE_TYPE_GROUP"` - `"RESOURCE_TYPE_PERSONAL_ACCESS_TOKEN"` - `"RESOURCE_TYPE_USER_PREFERENCE"` - `"RESOURCE_TYPE_SERVICE_ACCOUNT"` - `"RESOURCE_TYPE_SECRET"` - `"RESOURCE_TYPE_SSO_CONFIG"` - `"RESOURCE_TYPE_DOMAIN_VERIFICATION"` - `"RESOURCE_TYPE_AGENT_EXECUTION"` - `"RESOURCE_TYPE_RUNNER_LLM_INTEGRATION"` - `"RESOURCE_TYPE_AGENT"` - `"RESOURCE_TYPE_ENVIRONMENT_SESSION"` - `"RESOURCE_TYPE_USER_SECRET"` - `"RESOURCE_TYPE_ORGANIZATION_POLICY"` - `"RESOURCE_TYPE_ORGANIZATION_SECRET"` - `"RESOURCE_TYPE_PROJECT_ENVIRONMENT_CLASS"` - `"RESOURCE_TYPE_BILLING"` - `"RESOURCE_TYPE_PROMPT"` - `"RESOURCE_TYPE_COUPON"` - `"RESOURCE_TYPE_COUPON_REDEMPTION"` - `"RESOURCE_TYPE_ACCOUNT"` - `"RESOURCE_TYPE_INTEGRATION"` - `"RESOURCE_TYPE_WORKFLOW"` - `"RESOURCE_TYPE_WORKFLOW_EXECUTION"` - `"RESOURCE_TYPE_WORKFLOW_EXECUTION_ACTION"` - `"RESOURCE_TYPE_SNAPSHOT"` - `"RESOURCE_TYPE_PREBUILD"` - `"RESOURCE_TYPE_ORGANIZATION_LLM_INTEGRATION"` - `"RESOURCE_TYPE_CUSTOM_DOMAIN"` - `"RESOURCE_TYPE_ROLE_ASSIGNMENT_CHANGED"` - `"RESOURCE_TYPE_GROUP_MEMBERSHIP_CHANGED"` - `"RESOURCE_TYPE_WEBHOOK"` - `"RESOURCE_TYPE_SCIM_CONFIGURATION"` - `"RESOURCE_TYPE_SERVICE_ACCOUNT_SECRET"` - `"RESOURCE_TYPE_ANNOUNCEMENT_BANNER"` - `"RESOURCE_TYPE_SERVICE_ACCOUNT_TOKEN"` - `"RESOURCE_TYPE_ROLE_ASSIGNMENT"` - `"RESOURCE_TYPE_WARM_POOL"` - `"RESOURCE_TYPE_NOTIFICATION"` ### Returns - `ShareDeleteResponse = unknown` Empty response on success ### Example ```typescript import Gitpod from '@gitpod/sdk'; const client = new Gitpod({ bearerToken: process.env['GITPOD_API_KEY'], // This is the default and can be omitted }); const share = await client.groups.shares.delete({ principal: 'PRINCIPAL_USER', principalId: 'f53d2330-3795-4c5d-a1f3-453121af9c60', resourceId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', resourceType: 'RESOURCE_TYPE_RUNNER', }); console.log(share); ``` #### Response ```json {} ``` ## Domain Types ### Share Create Response - `ShareCreateResponse = unknown` Empty response on success ### Share Delete Response - `ShareDeleteResponse = unknown` Empty response on success