# Groups ## CreateGroup `client.Groups.New(ctx, body) (*GroupNewResponse, error)` **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 GroupNewParams` - `Description param.Field[string]` - `Name param.Field[string]` - `OrganizationID param.Field[string]` ### Returns - `type GroupNewResponse struct{…}` - `Group Group` - `ID string` - `CreatedAt Time` A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `Description string` - `DirectShare bool` direct_share indicates that this group is used for direct user sharing on resources. These groups are hidden from regular group listings. - `MemberCount int64` member_count is the total number of members in this group - `Name string` - `OrganizationID string` - `SystemManaged bool` system_managed indicates that this group is created by the system automatically - `UpdatedAt Time` A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. ### Example ```go package main import ( "context" "fmt" "github.com/gitpod-io/gitpod-sdk-go" "github.com/gitpod-io/gitpod-sdk-go/option" ) func main() { client := gitpod.NewClient( option.WithBearerToken("My Bearer Token"), ) group, err := client.Groups.New(context.TODO(), gitpod.GroupNewParams{ Description: gitpod.F("Backend engineering team"), Name: gitpod.F("Backend Team"), OrganizationID: gitpod.F("b0e12f6c-4c67-429d-a4a6-d9838b5da047"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", 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(ctx, body) (*GroupDeleteResponse, error)` **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 param.Field[string]` ### Returns - `type GroupDeleteResponse interface{…}` Empty response ### Example ```go package main import ( "context" "fmt" "github.com/gitpod-io/gitpod-sdk-go" "github.com/gitpod-io/gitpod-sdk-go/option" ) func main() { client := gitpod.NewClient( option.WithBearerToken("My Bearer Token"), ) group, err := client.Groups.Delete(context.TODO(), gitpod.GroupDeleteParams{ GroupID: gitpod.F("d2c94c27-3b76-4a42-b88c-95a85e392c68"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", group) } ``` #### Response ```json {} ``` ## ListGroups `client.Groups.List(ctx, params) (*GroupsPage[Group], error)` **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 param.Field[string]` Query param - `PageSize param.Field[int64]` Query param - `Filter param.Field[GroupListParamsFilter]` Body param: filter contains options for filtering the list of groups. - `DirectShare bool` direct_share filters groups by their direct_share flag. When set, only groups matching this value are returned. - `GroupIDs []string` 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 bool` system_managed filters groups by their system_managed flag. When set, only groups matching this value are returned. - `Pagination param.Field[GroupListParamsPagination]` 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 int64` Page size is the maximum number of results to retrieve per page. Defaults to 25. Maximum 100. ### Returns - `type Group struct{…}` - `ID string` - `CreatedAt Time` A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `Description string` - `DirectShare bool` direct_share indicates that this group is used for direct user sharing on resources. These groups are hidden from regular group listings. - `MemberCount int64` member_count is the total number of members in this group - `Name string` - `OrganizationID string` - `SystemManaged bool` system_managed indicates that this group is created by the system automatically - `UpdatedAt Time` A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. ### Example ```go package main import ( "context" "fmt" "github.com/gitpod-io/gitpod-sdk-go" "github.com/gitpod-io/gitpod-sdk-go/option" ) func main() { client := gitpod.NewClient( option.WithBearerToken("My Bearer Token"), ) page, err := client.Groups.List(context.TODO(), gitpod.GroupListParams{ Pagination: gitpod.F(gitpod.GroupListParamsPagination{ PageSize: gitpod.F(int64(20)), }), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", page) } ``` #### 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.Get(ctx, body) (*GroupGetResponse, error)` **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 GroupGetParams` - `ID param.Field[string]` id looks up the group by its unique ID. - `GroupID param.Field[string]` Deprecated: use the group oneof instead. - `Name param.Field[string]` name looks up the group by its name within the caller's organization. ### Returns - `type GroupGetResponse struct{…}` - `Group Group` - `ID string` - `CreatedAt Time` A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `Description string` - `DirectShare bool` direct_share indicates that this group is used for direct user sharing on resources. These groups are hidden from regular group listings. - `MemberCount int64` member_count is the total number of members in this group - `Name string` - `OrganizationID string` - `SystemManaged bool` system_managed indicates that this group is created by the system automatically - `UpdatedAt Time` A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. ### Example ```go package main import ( "context" "fmt" "github.com/gitpod-io/gitpod-sdk-go" "github.com/gitpod-io/gitpod-sdk-go/option" ) func main() { client := gitpod.NewClient( option.WithBearerToken("My Bearer Token"), ) group, err := client.Groups.Get(context.TODO(), gitpod.GroupGetParams{ ID: gitpod.F("d2c94c27-3b76-4a42-b88c-95a85e392c68"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", 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(ctx, body) (*GroupUpdateResponse, error)` **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 param.Field[string]` - `GroupID param.Field[string]` - `Name param.Field[string]` ### Returns - `type GroupUpdateResponse struct{…}` - `Group Group` - `ID string` - `CreatedAt Time` A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `Description string` - `DirectShare bool` direct_share indicates that this group is used for direct user sharing on resources. These groups are hidden from regular group listings. - `MemberCount int64` member_count is the total number of members in this group - `Name string` - `OrganizationID string` - `SystemManaged bool` system_managed indicates that this group is created by the system automatically - `UpdatedAt Time` A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. ### Example ```go package main import ( "context" "fmt" "github.com/gitpod-io/gitpod-sdk-go" "github.com/gitpod-io/gitpod-sdk-go/option" ) func main() { client := gitpod.NewClient( option.WithBearerToken("My Bearer Token"), ) group, err := client.Groups.Update(context.TODO(), gitpod.GroupUpdateParams{ Description: gitpod.F("Platform engineering team"), GroupID: gitpod.F("d2c94c27-3b76-4a42-b88c-95a85e392c68"), Name: gitpod.F("Platform Team"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", 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 - `type Group struct{…}` - `ID string` - `CreatedAt Time` A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `Description string` - `DirectShare bool` direct_share indicates that this group is used for direct user sharing on resources. These groups are hidden from regular group listings. - `MemberCount int64` member_count is the total number of members in this group - `Name string` - `OrganizationID string` - `SystemManaged bool` system_managed indicates that this group is created by the system automatically - `UpdatedAt Time` A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. # Memberships ## CreateMembership `client.Groups.Memberships.New(ctx, body) (*GroupMembershipNewResponse, error)` **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 GroupMembershipNewParams` - `GroupID param.Field[string]` - `Subject param.Field[Subject]` Subject to add to the group ### Returns - `type GroupMembershipNewResponse struct{…}` - `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 - `const PrincipalUnspecified Principal = "PRINCIPAL_UNSPECIFIED"` - `const PrincipalAccount Principal = "PRINCIPAL_ACCOUNT"` - `const PrincipalUser Principal = "PRINCIPAL_USER"` - `const PrincipalRunner Principal = "PRINCIPAL_RUNNER"` - `const PrincipalEnvironment Principal = "PRINCIPAL_ENVIRONMENT"` - `const PrincipalServiceAccount Principal = "PRINCIPAL_SERVICE_ACCOUNT"` - `const PrincipalRunnerManager Principal = "PRINCIPAL_RUNNER_MANAGER"` ### Example ```go package main import ( "context" "fmt" "github.com/gitpod-io/gitpod-sdk-go" "github.com/gitpod-io/gitpod-sdk-go/option" "github.com/gitpod-io/gitpod-sdk-go/shared" ) func main() { client := gitpod.NewClient( option.WithBearerToken("My Bearer Token"), ) membership, err := client.Groups.Memberships.New(context.TODO(), gitpod.GroupMembershipNewParams{ GroupID: gitpod.F("d2c94c27-3b76-4a42-b88c-95a85e392c68"), Subject: gitpod.F(shared.SubjectParam{ ID: gitpod.F("f53d2330-3795-4c5d-a1f3-453121af9c60"), Principal: gitpod.F(shared.PrincipalUser), }), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", 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(ctx, body) (*GroupMembershipDeleteResponse, error)` **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 GroupMembershipDeleteParams` - `MembershipID param.Field[string]` The membership to delete ### Returns - `type GroupMembershipDeleteResponse interface{…}` Empty response ### Example ```go package main import ( "context" "fmt" "github.com/gitpod-io/gitpod-sdk-go" "github.com/gitpod-io/gitpod-sdk-go/option" ) func main() { client := gitpod.NewClient( option.WithBearerToken("My Bearer Token"), ) membership, err := client.Groups.Memberships.Delete(context.TODO(), gitpod.GroupMembershipDeleteParams{ MembershipID: gitpod.F("a1b2c3d4-5678-90ab-cdef-1234567890ab"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", membership) } ``` #### Response ```json {} ``` ## ListMemberships `client.Groups.Memberships.List(ctx, params) (*MembersPage[GroupMembership], error)` **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 GroupMembershipListParams` - `Token param.Field[string]` Query param - `PageSize param.Field[int64]` Query param - `Filter param.Field[GroupMembershipListParamsFilter]` 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 param.Field[string]` Body param - `Pagination param.Field[GroupMembershipListParamsPagination]` 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 int64` Page size is the maximum number of results to retrieve per page. Defaults to 25. Maximum 100. ### Returns - `type GroupMembership struct{…}` 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 - `const PrincipalUnspecified Principal = "PRINCIPAL_UNSPECIFIED"` - `const PrincipalAccount Principal = "PRINCIPAL_ACCOUNT"` - `const PrincipalUser Principal = "PRINCIPAL_USER"` - `const PrincipalRunner Principal = "PRINCIPAL_RUNNER"` - `const PrincipalEnvironment Principal = "PRINCIPAL_ENVIRONMENT"` - `const PrincipalServiceAccount Principal = "PRINCIPAL_SERVICE_ACCOUNT"` - `const PrincipalRunnerManager Principal = "PRINCIPAL_RUNNER_MANAGER"` ### Example ```go package main import ( "context" "fmt" "github.com/gitpod-io/gitpod-sdk-go" "github.com/gitpod-io/gitpod-sdk-go/option" ) func main() { client := gitpod.NewClient( option.WithBearerToken("My Bearer Token"), ) page, err := client.Groups.Memberships.List(context.TODO(), gitpod.GroupMembershipListParams{ GroupID: gitpod.F("d2c94c27-3b76-4a42-b88c-95a85e392c68"), Pagination: gitpod.F(gitpod.GroupMembershipListParamsPagination{ PageSize: gitpod.F(int64(20)), }), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", page) } ``` #### 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.Get(ctx, body) (*GroupMembershipGetResponse, error)` **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 GroupMembershipGetParams` - `Subject param.Field[Subject]` Subject to check membership for - `GroupID param.Field[string]` ### Returns - `type GroupMembershipGetResponse struct{…}` - `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 - `const PrincipalUnspecified Principal = "PRINCIPAL_UNSPECIFIED"` - `const PrincipalAccount Principal = "PRINCIPAL_ACCOUNT"` - `const PrincipalUser Principal = "PRINCIPAL_USER"` - `const PrincipalRunner Principal = "PRINCIPAL_RUNNER"` - `const PrincipalEnvironment Principal = "PRINCIPAL_ENVIRONMENT"` - `const PrincipalServiceAccount Principal = "PRINCIPAL_SERVICE_ACCOUNT"` - `const PrincipalRunnerManager Principal = "PRINCIPAL_RUNNER_MANAGER"` ### Example ```go package main import ( "context" "fmt" "github.com/gitpod-io/gitpod-sdk-go" "github.com/gitpod-io/gitpod-sdk-go/option" "github.com/gitpod-io/gitpod-sdk-go/shared" ) func main() { client := gitpod.NewClient( option.WithBearerToken("My Bearer Token"), ) membership, err := client.Groups.Memberships.Get(context.TODO(), gitpod.GroupMembershipGetParams{ Subject: gitpod.F(shared.SubjectParam{ ID: gitpod.F("f53d2330-3795-4c5d-a1f3-453121af9c60"), Principal: gitpod.F(shared.PrincipalUser), }), GroupID: gitpod.F("d2c94c27-3b76-4a42-b88c-95a85e392c68"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", 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 - `type GroupMembership struct{…}` 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 - `const PrincipalUnspecified Principal = "PRINCIPAL_UNSPECIFIED"` - `const PrincipalAccount Principal = "PRINCIPAL_ACCOUNT"` - `const PrincipalUser Principal = "PRINCIPAL_USER"` - `const PrincipalRunner Principal = "PRINCIPAL_RUNNER"` - `const PrincipalEnvironment Principal = "PRINCIPAL_ENVIRONMENT"` - `const PrincipalServiceAccount Principal = "PRINCIPAL_SERVICE_ACCOUNT"` - `const PrincipalRunnerManager Principal = "PRINCIPAL_RUNNER_MANAGER"` # Role Assignments ## CreateRoleAssignment `client.Groups.RoleAssignments.New(ctx, body) (*GroupRoleAssignmentNewResponse, error)` **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 GroupRoleAssignmentNewParams` - `GroupID param.Field[string]` - `ResourceID param.Field[string]` - `ResourceRole param.Field[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 - `ResourceType param.Field[ResourceType]` ### Returns - `type GroupRoleAssignmentNewResponse struct{…}` - `Assignment RoleAssignment` RoleAssignment represents a role assigned to a group on a specific resource - `ID string` Unique identifier for the role assignment - `DerivedFromOrgRole ResourceRole` 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. - `const ResourceRoleUnspecified ResourceRole = "RESOURCE_ROLE_UNSPECIFIED"` - `const ResourceRoleOrgAdmin ResourceRole = "RESOURCE_ROLE_ORG_ADMIN"` - `const ResourceRoleOrgMember ResourceRole = "RESOURCE_ROLE_ORG_MEMBER"` - `const ResourceRoleOrgRunnersAdmin ResourceRole = "RESOURCE_ROLE_ORG_RUNNERS_ADMIN"` - `const ResourceRoleOrgProjectsAdmin ResourceRole = "RESOURCE_ROLE_ORG_PROJECTS_ADMIN"` - `const ResourceRoleOrgAutomationsAdmin ResourceRole = "RESOURCE_ROLE_ORG_AUTOMATIONS_ADMIN"` - `const ResourceRoleOrgGroupsAdmin ResourceRole = "RESOURCE_ROLE_ORG_GROUPS_ADMIN"` - `const ResourceRoleOrgAuditLogReader ResourceRole = "RESOURCE_ROLE_ORG_AUDIT_LOG_READER"` - `const ResourceRoleGroupAdmin ResourceRole = "RESOURCE_ROLE_GROUP_ADMIN"` - `const ResourceRoleGroupViewer ResourceRole = "RESOURCE_ROLE_GROUP_VIEWER"` - `const ResourceRoleUserIdentity ResourceRole = "RESOURCE_ROLE_USER_IDENTITY"` - `const ResourceRoleUserViewer ResourceRole = "RESOURCE_ROLE_USER_VIEWER"` - `const ResourceRoleUserAdmin ResourceRole = "RESOURCE_ROLE_USER_ADMIN"` - `const ResourceRoleEnvironmentIdentity ResourceRole = "RESOURCE_ROLE_ENVIRONMENT_IDENTITY"` - `const ResourceRoleEnvironmentAdmin ResourceRole = "RESOURCE_ROLE_ENVIRONMENT_ADMIN"` - `const ResourceRoleEnvironmentUser ResourceRole = "RESOURCE_ROLE_ENVIRONMENT_USER"` - `const ResourceRoleEnvironmentViewer ResourceRole = "RESOURCE_ROLE_ENVIRONMENT_VIEWER"` - `const ResourceRoleEnvironmentRunner ResourceRole = "RESOURCE_ROLE_ENVIRONMENT_RUNNER"` - `const ResourceRoleRunnerIdentity ResourceRole = "RESOURCE_ROLE_RUNNER_IDENTITY"` - `const ResourceRoleRunnerAdmin ResourceRole = "RESOURCE_ROLE_RUNNER_ADMIN"` - `const ResourceRoleRunnerLocalAdmin ResourceRole = "RESOURCE_ROLE_RUNNER_LOCAL_ADMIN"` - `const ResourceRoleRunnerManagedAdmin ResourceRole = "RESOURCE_ROLE_RUNNER_MANAGED_ADMIN"` - `const ResourceRoleRunnerUser ResourceRole = "RESOURCE_ROLE_RUNNER_USER"` - `const ResourceRoleRunnerConfigurationReader ResourceRole = "RESOURCE_ROLE_RUNNER_CONFIGURATION_READER"` - `const ResourceRoleHostAuthenticationTokenAdmin ResourceRole = "RESOURCE_ROLE_HOST_AUTHENTICATION_TOKEN_ADMIN"` - `const ResourceRoleHostAuthenticationTokenUpdater ResourceRole = "RESOURCE_ROLE_HOST_AUTHENTICATION_TOKEN_UPDATER"` - `const ResourceRoleProjectAdmin ResourceRole = "RESOURCE_ROLE_PROJECT_ADMIN"` - `const ResourceRoleProjectUser ResourceRole = "RESOURCE_ROLE_PROJECT_USER"` - `const ResourceRoleProjectEditor ResourceRole = "RESOURCE_ROLE_PROJECT_EDITOR"` - `const ResourceRoleEnvironmentServiceAdmin ResourceRole = "RESOURCE_ROLE_ENVIRONMENT_SERVICE_ADMIN"` - `const ResourceRoleEnvironmentServiceViewer ResourceRole = "RESOURCE_ROLE_ENVIRONMENT_SERVICE_VIEWER"` - `const ResourceRoleEnvironmentServiceUser ResourceRole = "RESOURCE_ROLE_ENVIRONMENT_SERVICE_USER"` - `const ResourceRoleEnvironmentServiceEnv ResourceRole = "RESOURCE_ROLE_ENVIRONMENT_SERVICE_ENV"` - `const ResourceRoleEnvironmentTaskAdmin ResourceRole = "RESOURCE_ROLE_ENVIRONMENT_TASK_ADMIN"` - `const ResourceRoleEnvironmentTaskViewer ResourceRole = "RESOURCE_ROLE_ENVIRONMENT_TASK_VIEWER"` - `const ResourceRoleEnvironmentTaskUser ResourceRole = "RESOURCE_ROLE_ENVIRONMENT_TASK_USER"` - `const ResourceRoleEnvironmentTaskEnv ResourceRole = "RESOURCE_ROLE_ENVIRONMENT_TASK_ENV"` - `const ResourceRoleServiceAccountIdentity ResourceRole = "RESOURCE_ROLE_SERVICE_ACCOUNT_IDENTITY"` - `const ResourceRoleServiceAccountAdmin ResourceRole = "RESOURCE_ROLE_SERVICE_ACCOUNT_ADMIN"` - `const ResourceRoleAgentExecutionUser ResourceRole = "RESOURCE_ROLE_AGENT_EXECUTION_USER"` - `const ResourceRoleAgentExecutionAdmin ResourceRole = "RESOURCE_ROLE_AGENT_EXECUTION_ADMIN"` - `const ResourceRoleAgentExecutionRunner ResourceRole = "RESOURCE_ROLE_AGENT_EXECUTION_RUNNER"` - `const ResourceRoleAgentExecutionOutputsReporter ResourceRole = "RESOURCE_ROLE_AGENT_EXECUTION_OUTPUTS_REPORTER"` - `const ResourceRoleAgentExecutionViewer ResourceRole = "RESOURCE_ROLE_AGENT_EXECUTION_VIEWER"` - `const ResourceRoleAgentAdmin ResourceRole = "RESOURCE_ROLE_AGENT_ADMIN"` - `const ResourceRoleAgentViewer ResourceRole = "RESOURCE_ROLE_AGENT_VIEWER"` - `const ResourceRoleAgentExecutor ResourceRole = "RESOURCE_ROLE_AGENT_EXECUTOR"` - `const ResourceRoleWorkflowAdmin ResourceRole = "RESOURCE_ROLE_WORKFLOW_ADMIN"` - `const ResourceRoleWorkflowUser ResourceRole = "RESOURCE_ROLE_WORKFLOW_USER"` - `const ResourceRoleWorkflowViewer ResourceRole = "RESOURCE_ROLE_WORKFLOW_VIEWER"` - `const ResourceRoleWorkflowExecutor ResourceRole = "RESOURCE_ROLE_WORKFLOW_EXECUTOR"` - `const ResourceRoleSnapshotAdmin ResourceRole = "RESOURCE_ROLE_SNAPSHOT_ADMIN"` - `const ResourceRoleSnapshotRunner ResourceRole = "RESOURCE_ROLE_SNAPSHOT_RUNNER"` - `const ResourceRoleWebhookAdmin ResourceRole = "RESOURCE_ROLE_WEBHOOK_ADMIN"` - `const ResourceRoleWebhookViewer ResourceRole = "RESOURCE_ROLE_WEBHOOK_VIEWER"` - `const ResourceRoleWarmpoolRunner ResourceRole = "RESOURCE_ROLE_WARMPOOL_RUNNER"` - `const ResourceRoleWarmpoolAdmin ResourceRole = "RESOURCE_ROLE_WARMPOOL_ADMIN"` - `const ResourceRoleWarmpoolViewer ResourceRole = "RESOURCE_ROLE_WARMPOOL_VIEWER"` - `const ResourceRoleSessionAdmin ResourceRole = "RESOURCE_ROLE_SESSION_ADMIN"` - `const ResourceRoleSessionUser ResourceRole = "RESOURCE_ROLE_SESSION_USER"` - `const ResourceRoleTeamAdmin ResourceRole = "RESOURCE_ROLE_TEAM_ADMIN"` - `const ResourceRoleTeamViewer ResourceRole = "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.) - `const ResourceTypeUnspecified ResourceType = "RESOURCE_TYPE_UNSPECIFIED"` - `const ResourceTypeEnvironment ResourceType = "RESOURCE_TYPE_ENVIRONMENT"` - `const ResourceTypeRunner ResourceType = "RESOURCE_TYPE_RUNNER"` - `const ResourceTypeProject ResourceType = "RESOURCE_TYPE_PROJECT"` - `const ResourceTypeTask ResourceType = "RESOURCE_TYPE_TASK"` - `const ResourceTypeTaskExecution ResourceType = "RESOURCE_TYPE_TASK_EXECUTION"` - `const ResourceTypeService ResourceType = "RESOURCE_TYPE_SERVICE"` - `const ResourceTypeOrganization ResourceType = "RESOURCE_TYPE_ORGANIZATION"` - `const ResourceTypeUser ResourceType = "RESOURCE_TYPE_USER"` - `const ResourceTypeEnvironmentClass ResourceType = "RESOURCE_TYPE_ENVIRONMENT_CLASS"` - `const ResourceTypeRunnerScmIntegration ResourceType = "RESOURCE_TYPE_RUNNER_SCM_INTEGRATION"` - `const ResourceTypeHostAuthenticationToken ResourceType = "RESOURCE_TYPE_HOST_AUTHENTICATION_TOKEN"` - `const ResourceTypeGroup ResourceType = "RESOURCE_TYPE_GROUP"` - `const ResourceTypePersonalAccessToken ResourceType = "RESOURCE_TYPE_PERSONAL_ACCESS_TOKEN"` - `const ResourceTypeUserPreference ResourceType = "RESOURCE_TYPE_USER_PREFERENCE"` - `const ResourceTypeServiceAccount ResourceType = "RESOURCE_TYPE_SERVICE_ACCOUNT"` - `const ResourceTypeSecret ResourceType = "RESOURCE_TYPE_SECRET"` - `const ResourceTypeSSOConfig ResourceType = "RESOURCE_TYPE_SSO_CONFIG"` - `const ResourceTypeDomainVerification ResourceType = "RESOURCE_TYPE_DOMAIN_VERIFICATION"` - `const ResourceTypeAgentExecution ResourceType = "RESOURCE_TYPE_AGENT_EXECUTION"` - `const ResourceTypeRunnerLlmIntegration ResourceType = "RESOURCE_TYPE_RUNNER_LLM_INTEGRATION"` - `const ResourceTypeAgent ResourceType = "RESOURCE_TYPE_AGENT"` - `const ResourceTypeEnvironmentSession ResourceType = "RESOURCE_TYPE_ENVIRONMENT_SESSION"` - `const ResourceTypeUserSecret ResourceType = "RESOURCE_TYPE_USER_SECRET"` - `const ResourceTypeOrganizationPolicy ResourceType = "RESOURCE_TYPE_ORGANIZATION_POLICY"` - `const ResourceTypeOrganizationSecret ResourceType = "RESOURCE_TYPE_ORGANIZATION_SECRET"` - `const ResourceTypeProjectEnvironmentClass ResourceType = "RESOURCE_TYPE_PROJECT_ENVIRONMENT_CLASS"` - `const ResourceTypeBilling ResourceType = "RESOURCE_TYPE_BILLING"` - `const ResourceTypePrompt ResourceType = "RESOURCE_TYPE_PROMPT"` - `const ResourceTypeCoupon ResourceType = "RESOURCE_TYPE_COUPON"` - `const ResourceTypeCouponRedemption ResourceType = "RESOURCE_TYPE_COUPON_REDEMPTION"` - `const ResourceTypeAccount ResourceType = "RESOURCE_TYPE_ACCOUNT"` - `const ResourceTypeIntegration ResourceType = "RESOURCE_TYPE_INTEGRATION"` - `const ResourceTypeWorkflow ResourceType = "RESOURCE_TYPE_WORKFLOW"` - `const ResourceTypeWorkflowExecution ResourceType = "RESOURCE_TYPE_WORKFLOW_EXECUTION"` - `const ResourceTypeWorkflowExecutionAction ResourceType = "RESOURCE_TYPE_WORKFLOW_EXECUTION_ACTION"` - `const ResourceTypeSnapshot ResourceType = "RESOURCE_TYPE_SNAPSHOT"` - `const ResourceTypePrebuild ResourceType = "RESOURCE_TYPE_PREBUILD"` - `const ResourceTypeOrganizationLlmIntegration ResourceType = "RESOURCE_TYPE_ORGANIZATION_LLM_INTEGRATION"` - `const ResourceTypeCustomDomain ResourceType = "RESOURCE_TYPE_CUSTOM_DOMAIN"` - `const ResourceTypeRoleAssignmentChanged ResourceType = "RESOURCE_TYPE_ROLE_ASSIGNMENT_CHANGED"` - `const ResourceTypeGroupMembershipChanged ResourceType = "RESOURCE_TYPE_GROUP_MEMBERSHIP_CHANGED"` - `const ResourceTypeWebhook ResourceType = "RESOURCE_TYPE_WEBHOOK"` - `const ResourceTypeScimConfiguration ResourceType = "RESOURCE_TYPE_SCIM_CONFIGURATION"` - `const ResourceTypeServiceAccountSecret ResourceType = "RESOURCE_TYPE_SERVICE_ACCOUNT_SECRET"` - `const ResourceTypeAnnouncementBanner ResourceType = "RESOURCE_TYPE_ANNOUNCEMENT_BANNER"` - `const ResourceTypeServiceAccountToken ResourceType = "RESOURCE_TYPE_SERVICE_ACCOUNT_TOKEN"` - `const ResourceTypeRoleAssignment ResourceType = "RESOURCE_TYPE_ROLE_ASSIGNMENT"` - `const ResourceTypeWarmPool ResourceType = "RESOURCE_TYPE_WARM_POOL"` - `const ResourceTypeNotification ResourceType = "RESOURCE_TYPE_NOTIFICATION"` ### Example ```go package main import ( "context" "fmt" "github.com/gitpod-io/gitpod-sdk-go" "github.com/gitpod-io/gitpod-sdk-go/option" "github.com/gitpod-io/gitpod-sdk-go/shared" ) func main() { client := gitpod.NewClient( option.WithBearerToken("My Bearer Token"), ) roleAssignment, err := client.Groups.RoleAssignments.New(context.TODO(), gitpod.GroupRoleAssignmentNewParams{ GroupID: gitpod.F("d2c94c27-3b76-4a42-b88c-95a85e392c68"), ResourceID: gitpod.F("f53d2330-3795-4c5d-a1f3-453121af9c60"), ResourceRole: gitpod.F(shared.ResourceRoleRunnerAdmin), ResourceType: gitpod.F(shared.ResourceTypeRunner), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", 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(ctx, body) (*GroupRoleAssignmentDeleteResponse, error)` **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 GroupRoleAssignmentDeleteParams` - `AssignmentID param.Field[string]` ### Returns - `type GroupRoleAssignmentDeleteResponse interface{…}` Empty response ### Example ```go package main import ( "context" "fmt" "github.com/gitpod-io/gitpod-sdk-go" "github.com/gitpod-io/gitpod-sdk-go/option" ) func main() { client := gitpod.NewClient( option.WithBearerToken("My Bearer Token"), ) roleAssignment, err := client.Groups.RoleAssignments.Delete(context.TODO(), gitpod.GroupRoleAssignmentDeleteParams{ AssignmentID: gitpod.F("a1b2c3d4-5678-90ab-cdef-1234567890ab"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", roleAssignment) } ``` #### Response ```json {} ``` ## ListRoleAssignments `client.Groups.RoleAssignments.List(ctx, params) (*AssignmentsPage[RoleAssignment], error)` **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 GroupRoleAssignmentListParams` - `Token param.Field[string]` Query param - `PageSize param.Field[int64]` Query param - `Filter param.Field[GroupRoleAssignmentListParamsFilter]` 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 []string` 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 []ResourceRole` resource_roles filters the response to only role assignments with these specific roles - `const ResourceRoleUnspecified ResourceRole = "RESOURCE_ROLE_UNSPECIFIED"` - `const ResourceRoleOrgAdmin ResourceRole = "RESOURCE_ROLE_ORG_ADMIN"` - `const ResourceRoleOrgMember ResourceRole = "RESOURCE_ROLE_ORG_MEMBER"` - `const ResourceRoleOrgRunnersAdmin ResourceRole = "RESOURCE_ROLE_ORG_RUNNERS_ADMIN"` - `const ResourceRoleOrgProjectsAdmin ResourceRole = "RESOURCE_ROLE_ORG_PROJECTS_ADMIN"` - `const ResourceRoleOrgAutomationsAdmin ResourceRole = "RESOURCE_ROLE_ORG_AUTOMATIONS_ADMIN"` - `const ResourceRoleOrgGroupsAdmin ResourceRole = "RESOURCE_ROLE_ORG_GROUPS_ADMIN"` - `const ResourceRoleOrgAuditLogReader ResourceRole = "RESOURCE_ROLE_ORG_AUDIT_LOG_READER"` - `const ResourceRoleGroupAdmin ResourceRole = "RESOURCE_ROLE_GROUP_ADMIN"` - `const ResourceRoleGroupViewer ResourceRole = "RESOURCE_ROLE_GROUP_VIEWER"` - `const ResourceRoleUserIdentity ResourceRole = "RESOURCE_ROLE_USER_IDENTITY"` - `const ResourceRoleUserViewer ResourceRole = "RESOURCE_ROLE_USER_VIEWER"` - `const ResourceRoleUserAdmin ResourceRole = "RESOURCE_ROLE_USER_ADMIN"` - `const ResourceRoleEnvironmentIdentity ResourceRole = "RESOURCE_ROLE_ENVIRONMENT_IDENTITY"` - `const ResourceRoleEnvironmentAdmin ResourceRole = "RESOURCE_ROLE_ENVIRONMENT_ADMIN"` - `const ResourceRoleEnvironmentUser ResourceRole = "RESOURCE_ROLE_ENVIRONMENT_USER"` - `const ResourceRoleEnvironmentViewer ResourceRole = "RESOURCE_ROLE_ENVIRONMENT_VIEWER"` - `const ResourceRoleEnvironmentRunner ResourceRole = "RESOURCE_ROLE_ENVIRONMENT_RUNNER"` - `const ResourceRoleRunnerIdentity ResourceRole = "RESOURCE_ROLE_RUNNER_IDENTITY"` - `const ResourceRoleRunnerAdmin ResourceRole = "RESOURCE_ROLE_RUNNER_ADMIN"` - `const ResourceRoleRunnerLocalAdmin ResourceRole = "RESOURCE_ROLE_RUNNER_LOCAL_ADMIN"` - `const ResourceRoleRunnerManagedAdmin ResourceRole = "RESOURCE_ROLE_RUNNER_MANAGED_ADMIN"` - `const ResourceRoleRunnerUser ResourceRole = "RESOURCE_ROLE_RUNNER_USER"` - `const ResourceRoleRunnerConfigurationReader ResourceRole = "RESOURCE_ROLE_RUNNER_CONFIGURATION_READER"` - `const ResourceRoleHostAuthenticationTokenAdmin ResourceRole = "RESOURCE_ROLE_HOST_AUTHENTICATION_TOKEN_ADMIN"` - `const ResourceRoleHostAuthenticationTokenUpdater ResourceRole = "RESOURCE_ROLE_HOST_AUTHENTICATION_TOKEN_UPDATER"` - `const ResourceRoleProjectAdmin ResourceRole = "RESOURCE_ROLE_PROJECT_ADMIN"` - `const ResourceRoleProjectUser ResourceRole = "RESOURCE_ROLE_PROJECT_USER"` - `const ResourceRoleProjectEditor ResourceRole = "RESOURCE_ROLE_PROJECT_EDITOR"` - `const ResourceRoleEnvironmentServiceAdmin ResourceRole = "RESOURCE_ROLE_ENVIRONMENT_SERVICE_ADMIN"` - `const ResourceRoleEnvironmentServiceViewer ResourceRole = "RESOURCE_ROLE_ENVIRONMENT_SERVICE_VIEWER"` - `const ResourceRoleEnvironmentServiceUser ResourceRole = "RESOURCE_ROLE_ENVIRONMENT_SERVICE_USER"` - `const ResourceRoleEnvironmentServiceEnv ResourceRole = "RESOURCE_ROLE_ENVIRONMENT_SERVICE_ENV"` - `const ResourceRoleEnvironmentTaskAdmin ResourceRole = "RESOURCE_ROLE_ENVIRONMENT_TASK_ADMIN"` - `const ResourceRoleEnvironmentTaskViewer ResourceRole = "RESOURCE_ROLE_ENVIRONMENT_TASK_VIEWER"` - `const ResourceRoleEnvironmentTaskUser ResourceRole = "RESOURCE_ROLE_ENVIRONMENT_TASK_USER"` - `const ResourceRoleEnvironmentTaskEnv ResourceRole = "RESOURCE_ROLE_ENVIRONMENT_TASK_ENV"` - `const ResourceRoleServiceAccountIdentity ResourceRole = "RESOURCE_ROLE_SERVICE_ACCOUNT_IDENTITY"` - `const ResourceRoleServiceAccountAdmin ResourceRole = "RESOURCE_ROLE_SERVICE_ACCOUNT_ADMIN"` - `const ResourceRoleAgentExecutionUser ResourceRole = "RESOURCE_ROLE_AGENT_EXECUTION_USER"` - `const ResourceRoleAgentExecutionAdmin ResourceRole = "RESOURCE_ROLE_AGENT_EXECUTION_ADMIN"` - `const ResourceRoleAgentExecutionRunner ResourceRole = "RESOURCE_ROLE_AGENT_EXECUTION_RUNNER"` - `const ResourceRoleAgentExecutionOutputsReporter ResourceRole = "RESOURCE_ROLE_AGENT_EXECUTION_OUTPUTS_REPORTER"` - `const ResourceRoleAgentExecutionViewer ResourceRole = "RESOURCE_ROLE_AGENT_EXECUTION_VIEWER"` - `const ResourceRoleAgentAdmin ResourceRole = "RESOURCE_ROLE_AGENT_ADMIN"` - `const ResourceRoleAgentViewer ResourceRole = "RESOURCE_ROLE_AGENT_VIEWER"` - `const ResourceRoleAgentExecutor ResourceRole = "RESOURCE_ROLE_AGENT_EXECUTOR"` - `const ResourceRoleWorkflowAdmin ResourceRole = "RESOURCE_ROLE_WORKFLOW_ADMIN"` - `const ResourceRoleWorkflowUser ResourceRole = "RESOURCE_ROLE_WORKFLOW_USER"` - `const ResourceRoleWorkflowViewer ResourceRole = "RESOURCE_ROLE_WORKFLOW_VIEWER"` - `const ResourceRoleWorkflowExecutor ResourceRole = "RESOURCE_ROLE_WORKFLOW_EXECUTOR"` - `const ResourceRoleSnapshotAdmin ResourceRole = "RESOURCE_ROLE_SNAPSHOT_ADMIN"` - `const ResourceRoleSnapshotRunner ResourceRole = "RESOURCE_ROLE_SNAPSHOT_RUNNER"` - `const ResourceRoleWebhookAdmin ResourceRole = "RESOURCE_ROLE_WEBHOOK_ADMIN"` - `const ResourceRoleWebhookViewer ResourceRole = "RESOURCE_ROLE_WEBHOOK_VIEWER"` - `const ResourceRoleWarmpoolRunner ResourceRole = "RESOURCE_ROLE_WARMPOOL_RUNNER"` - `const ResourceRoleWarmpoolAdmin ResourceRole = "RESOURCE_ROLE_WARMPOOL_ADMIN"` - `const ResourceRoleWarmpoolViewer ResourceRole = "RESOURCE_ROLE_WARMPOOL_VIEWER"` - `const ResourceRoleSessionAdmin ResourceRole = "RESOURCE_ROLE_SESSION_ADMIN"` - `const ResourceRoleSessionUser ResourceRole = "RESOURCE_ROLE_SESSION_USER"` - `const ResourceRoleTeamAdmin ResourceRole = "RESOURCE_ROLE_TEAM_ADMIN"` - `const ResourceRoleTeamViewer ResourceRole = "RESOURCE_ROLE_TEAM_VIEWER"` - `ResourceTypes []ResourceType` resource_types filters the response to only role assignments for these resource types - `const ResourceTypeUnspecified ResourceType = "RESOURCE_TYPE_UNSPECIFIED"` - `const ResourceTypeEnvironment ResourceType = "RESOURCE_TYPE_ENVIRONMENT"` - `const ResourceTypeRunner ResourceType = "RESOURCE_TYPE_RUNNER"` - `const ResourceTypeProject ResourceType = "RESOURCE_TYPE_PROJECT"` - `const ResourceTypeTask ResourceType = "RESOURCE_TYPE_TASK"` - `const ResourceTypeTaskExecution ResourceType = "RESOURCE_TYPE_TASK_EXECUTION"` - `const ResourceTypeService ResourceType = "RESOURCE_TYPE_SERVICE"` - `const ResourceTypeOrganization ResourceType = "RESOURCE_TYPE_ORGANIZATION"` - `const ResourceTypeUser ResourceType = "RESOURCE_TYPE_USER"` - `const ResourceTypeEnvironmentClass ResourceType = "RESOURCE_TYPE_ENVIRONMENT_CLASS"` - `const ResourceTypeRunnerScmIntegration ResourceType = "RESOURCE_TYPE_RUNNER_SCM_INTEGRATION"` - `const ResourceTypeHostAuthenticationToken ResourceType = "RESOURCE_TYPE_HOST_AUTHENTICATION_TOKEN"` - `const ResourceTypeGroup ResourceType = "RESOURCE_TYPE_GROUP"` - `const ResourceTypePersonalAccessToken ResourceType = "RESOURCE_TYPE_PERSONAL_ACCESS_TOKEN"` - `const ResourceTypeUserPreference ResourceType = "RESOURCE_TYPE_USER_PREFERENCE"` - `const ResourceTypeServiceAccount ResourceType = "RESOURCE_TYPE_SERVICE_ACCOUNT"` - `const ResourceTypeSecret ResourceType = "RESOURCE_TYPE_SECRET"` - `const ResourceTypeSSOConfig ResourceType = "RESOURCE_TYPE_SSO_CONFIG"` - `const ResourceTypeDomainVerification ResourceType = "RESOURCE_TYPE_DOMAIN_VERIFICATION"` - `const ResourceTypeAgentExecution ResourceType = "RESOURCE_TYPE_AGENT_EXECUTION"` - `const ResourceTypeRunnerLlmIntegration ResourceType = "RESOURCE_TYPE_RUNNER_LLM_INTEGRATION"` - `const ResourceTypeAgent ResourceType = "RESOURCE_TYPE_AGENT"` - `const ResourceTypeEnvironmentSession ResourceType = "RESOURCE_TYPE_ENVIRONMENT_SESSION"` - `const ResourceTypeUserSecret ResourceType = "RESOURCE_TYPE_USER_SECRET"` - `const ResourceTypeOrganizationPolicy ResourceType = "RESOURCE_TYPE_ORGANIZATION_POLICY"` - `const ResourceTypeOrganizationSecret ResourceType = "RESOURCE_TYPE_ORGANIZATION_SECRET"` - `const ResourceTypeProjectEnvironmentClass ResourceType = "RESOURCE_TYPE_PROJECT_ENVIRONMENT_CLASS"` - `const ResourceTypeBilling ResourceType = "RESOURCE_TYPE_BILLING"` - `const ResourceTypePrompt ResourceType = "RESOURCE_TYPE_PROMPT"` - `const ResourceTypeCoupon ResourceType = "RESOURCE_TYPE_COUPON"` - `const ResourceTypeCouponRedemption ResourceType = "RESOURCE_TYPE_COUPON_REDEMPTION"` - `const ResourceTypeAccount ResourceType = "RESOURCE_TYPE_ACCOUNT"` - `const ResourceTypeIntegration ResourceType = "RESOURCE_TYPE_INTEGRATION"` - `const ResourceTypeWorkflow ResourceType = "RESOURCE_TYPE_WORKFLOW"` - `const ResourceTypeWorkflowExecution ResourceType = "RESOURCE_TYPE_WORKFLOW_EXECUTION"` - `const ResourceTypeWorkflowExecutionAction ResourceType = "RESOURCE_TYPE_WORKFLOW_EXECUTION_ACTION"` - `const ResourceTypeSnapshot ResourceType = "RESOURCE_TYPE_SNAPSHOT"` - `const ResourceTypePrebuild ResourceType = "RESOURCE_TYPE_PREBUILD"` - `const ResourceTypeOrganizationLlmIntegration ResourceType = "RESOURCE_TYPE_ORGANIZATION_LLM_INTEGRATION"` - `const ResourceTypeCustomDomain ResourceType = "RESOURCE_TYPE_CUSTOM_DOMAIN"` - `const ResourceTypeRoleAssignmentChanged ResourceType = "RESOURCE_TYPE_ROLE_ASSIGNMENT_CHANGED"` - `const ResourceTypeGroupMembershipChanged ResourceType = "RESOURCE_TYPE_GROUP_MEMBERSHIP_CHANGED"` - `const ResourceTypeWebhook ResourceType = "RESOURCE_TYPE_WEBHOOK"` - `const ResourceTypeScimConfiguration ResourceType = "RESOURCE_TYPE_SCIM_CONFIGURATION"` - `const ResourceTypeServiceAccountSecret ResourceType = "RESOURCE_TYPE_SERVICE_ACCOUNT_SECRET"` - `const ResourceTypeAnnouncementBanner ResourceType = "RESOURCE_TYPE_ANNOUNCEMENT_BANNER"` - `const ResourceTypeServiceAccountToken ResourceType = "RESOURCE_TYPE_SERVICE_ACCOUNT_TOKEN"` - `const ResourceTypeRoleAssignment ResourceType = "RESOURCE_TYPE_ROLE_ASSIGNMENT"` - `const ResourceTypeWarmPool ResourceType = "RESOURCE_TYPE_WARM_POOL"` - `const ResourceTypeNotification ResourceType = "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 param.Field[GroupRoleAssignmentListParamsPagination]` Body param: Pagination parameters - `Token string` Token for the next set of results that was returned as next_token of a PaginationResponse - `PageSize int64` Page size is the maximum number of results to retrieve per page. Defaults to 25. Maximum 100. ### Returns - `type RoleAssignment struct{…}` RoleAssignment represents a role assigned to a group on a specific resource - `ID string` Unique identifier for the role assignment - `DerivedFromOrgRole ResourceRole` 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. - `const ResourceRoleUnspecified ResourceRole = "RESOURCE_ROLE_UNSPECIFIED"` - `const ResourceRoleOrgAdmin ResourceRole = "RESOURCE_ROLE_ORG_ADMIN"` - `const ResourceRoleOrgMember ResourceRole = "RESOURCE_ROLE_ORG_MEMBER"` - `const ResourceRoleOrgRunnersAdmin ResourceRole = "RESOURCE_ROLE_ORG_RUNNERS_ADMIN"` - `const ResourceRoleOrgProjectsAdmin ResourceRole = "RESOURCE_ROLE_ORG_PROJECTS_ADMIN"` - `const ResourceRoleOrgAutomationsAdmin ResourceRole = "RESOURCE_ROLE_ORG_AUTOMATIONS_ADMIN"` - `const ResourceRoleOrgGroupsAdmin ResourceRole = "RESOURCE_ROLE_ORG_GROUPS_ADMIN"` - `const ResourceRoleOrgAuditLogReader ResourceRole = "RESOURCE_ROLE_ORG_AUDIT_LOG_READER"` - `const ResourceRoleGroupAdmin ResourceRole = "RESOURCE_ROLE_GROUP_ADMIN"` - `const ResourceRoleGroupViewer ResourceRole = "RESOURCE_ROLE_GROUP_VIEWER"` - `const ResourceRoleUserIdentity ResourceRole = "RESOURCE_ROLE_USER_IDENTITY"` - `const ResourceRoleUserViewer ResourceRole = "RESOURCE_ROLE_USER_VIEWER"` - `const ResourceRoleUserAdmin ResourceRole = "RESOURCE_ROLE_USER_ADMIN"` - `const ResourceRoleEnvironmentIdentity ResourceRole = "RESOURCE_ROLE_ENVIRONMENT_IDENTITY"` - `const ResourceRoleEnvironmentAdmin ResourceRole = "RESOURCE_ROLE_ENVIRONMENT_ADMIN"` - `const ResourceRoleEnvironmentUser ResourceRole = "RESOURCE_ROLE_ENVIRONMENT_USER"` - `const ResourceRoleEnvironmentViewer ResourceRole = "RESOURCE_ROLE_ENVIRONMENT_VIEWER"` - `const ResourceRoleEnvironmentRunner ResourceRole = "RESOURCE_ROLE_ENVIRONMENT_RUNNER"` - `const ResourceRoleRunnerIdentity ResourceRole = "RESOURCE_ROLE_RUNNER_IDENTITY"` - `const ResourceRoleRunnerAdmin ResourceRole = "RESOURCE_ROLE_RUNNER_ADMIN"` - `const ResourceRoleRunnerLocalAdmin ResourceRole = "RESOURCE_ROLE_RUNNER_LOCAL_ADMIN"` - `const ResourceRoleRunnerManagedAdmin ResourceRole = "RESOURCE_ROLE_RUNNER_MANAGED_ADMIN"` - `const ResourceRoleRunnerUser ResourceRole = "RESOURCE_ROLE_RUNNER_USER"` - `const ResourceRoleRunnerConfigurationReader ResourceRole = "RESOURCE_ROLE_RUNNER_CONFIGURATION_READER"` - `const ResourceRoleHostAuthenticationTokenAdmin ResourceRole = "RESOURCE_ROLE_HOST_AUTHENTICATION_TOKEN_ADMIN"` - `const ResourceRoleHostAuthenticationTokenUpdater ResourceRole = "RESOURCE_ROLE_HOST_AUTHENTICATION_TOKEN_UPDATER"` - `const ResourceRoleProjectAdmin ResourceRole = "RESOURCE_ROLE_PROJECT_ADMIN"` - `const ResourceRoleProjectUser ResourceRole = "RESOURCE_ROLE_PROJECT_USER"` - `const ResourceRoleProjectEditor ResourceRole = "RESOURCE_ROLE_PROJECT_EDITOR"` - `const ResourceRoleEnvironmentServiceAdmin ResourceRole = "RESOURCE_ROLE_ENVIRONMENT_SERVICE_ADMIN"` - `const ResourceRoleEnvironmentServiceViewer ResourceRole = "RESOURCE_ROLE_ENVIRONMENT_SERVICE_VIEWER"` - `const ResourceRoleEnvironmentServiceUser ResourceRole = "RESOURCE_ROLE_ENVIRONMENT_SERVICE_USER"` - `const ResourceRoleEnvironmentServiceEnv ResourceRole = "RESOURCE_ROLE_ENVIRONMENT_SERVICE_ENV"` - `const ResourceRoleEnvironmentTaskAdmin ResourceRole = "RESOURCE_ROLE_ENVIRONMENT_TASK_ADMIN"` - `const ResourceRoleEnvironmentTaskViewer ResourceRole = "RESOURCE_ROLE_ENVIRONMENT_TASK_VIEWER"` - `const ResourceRoleEnvironmentTaskUser ResourceRole = "RESOURCE_ROLE_ENVIRONMENT_TASK_USER"` - `const ResourceRoleEnvironmentTaskEnv ResourceRole = "RESOURCE_ROLE_ENVIRONMENT_TASK_ENV"` - `const ResourceRoleServiceAccountIdentity ResourceRole = "RESOURCE_ROLE_SERVICE_ACCOUNT_IDENTITY"` - `const ResourceRoleServiceAccountAdmin ResourceRole = "RESOURCE_ROLE_SERVICE_ACCOUNT_ADMIN"` - `const ResourceRoleAgentExecutionUser ResourceRole = "RESOURCE_ROLE_AGENT_EXECUTION_USER"` - `const ResourceRoleAgentExecutionAdmin ResourceRole = "RESOURCE_ROLE_AGENT_EXECUTION_ADMIN"` - `const ResourceRoleAgentExecutionRunner ResourceRole = "RESOURCE_ROLE_AGENT_EXECUTION_RUNNER"` - `const ResourceRoleAgentExecutionOutputsReporter ResourceRole = "RESOURCE_ROLE_AGENT_EXECUTION_OUTPUTS_REPORTER"` - `const ResourceRoleAgentExecutionViewer ResourceRole = "RESOURCE_ROLE_AGENT_EXECUTION_VIEWER"` - `const ResourceRoleAgentAdmin ResourceRole = "RESOURCE_ROLE_AGENT_ADMIN"` - `const ResourceRoleAgentViewer ResourceRole = "RESOURCE_ROLE_AGENT_VIEWER"` - `const ResourceRoleAgentExecutor ResourceRole = "RESOURCE_ROLE_AGENT_EXECUTOR"` - `const ResourceRoleWorkflowAdmin ResourceRole = "RESOURCE_ROLE_WORKFLOW_ADMIN"` - `const ResourceRoleWorkflowUser ResourceRole = "RESOURCE_ROLE_WORKFLOW_USER"` - `const ResourceRoleWorkflowViewer ResourceRole = "RESOURCE_ROLE_WORKFLOW_VIEWER"` - `const ResourceRoleWorkflowExecutor ResourceRole = "RESOURCE_ROLE_WORKFLOW_EXECUTOR"` - `const ResourceRoleSnapshotAdmin ResourceRole = "RESOURCE_ROLE_SNAPSHOT_ADMIN"` - `const ResourceRoleSnapshotRunner ResourceRole = "RESOURCE_ROLE_SNAPSHOT_RUNNER"` - `const ResourceRoleWebhookAdmin ResourceRole = "RESOURCE_ROLE_WEBHOOK_ADMIN"` - `const ResourceRoleWebhookViewer ResourceRole = "RESOURCE_ROLE_WEBHOOK_VIEWER"` - `const ResourceRoleWarmpoolRunner ResourceRole = "RESOURCE_ROLE_WARMPOOL_RUNNER"` - `const ResourceRoleWarmpoolAdmin ResourceRole = "RESOURCE_ROLE_WARMPOOL_ADMIN"` - `const ResourceRoleWarmpoolViewer ResourceRole = "RESOURCE_ROLE_WARMPOOL_VIEWER"` - `const ResourceRoleSessionAdmin ResourceRole = "RESOURCE_ROLE_SESSION_ADMIN"` - `const ResourceRoleSessionUser ResourceRole = "RESOURCE_ROLE_SESSION_USER"` - `const ResourceRoleTeamAdmin ResourceRole = "RESOURCE_ROLE_TEAM_ADMIN"` - `const ResourceRoleTeamViewer ResourceRole = "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.) - `const ResourceTypeUnspecified ResourceType = "RESOURCE_TYPE_UNSPECIFIED"` - `const ResourceTypeEnvironment ResourceType = "RESOURCE_TYPE_ENVIRONMENT"` - `const ResourceTypeRunner ResourceType = "RESOURCE_TYPE_RUNNER"` - `const ResourceTypeProject ResourceType = "RESOURCE_TYPE_PROJECT"` - `const ResourceTypeTask ResourceType = "RESOURCE_TYPE_TASK"` - `const ResourceTypeTaskExecution ResourceType = "RESOURCE_TYPE_TASK_EXECUTION"` - `const ResourceTypeService ResourceType = "RESOURCE_TYPE_SERVICE"` - `const ResourceTypeOrganization ResourceType = "RESOURCE_TYPE_ORGANIZATION"` - `const ResourceTypeUser ResourceType = "RESOURCE_TYPE_USER"` - `const ResourceTypeEnvironmentClass ResourceType = "RESOURCE_TYPE_ENVIRONMENT_CLASS"` - `const ResourceTypeRunnerScmIntegration ResourceType = "RESOURCE_TYPE_RUNNER_SCM_INTEGRATION"` - `const ResourceTypeHostAuthenticationToken ResourceType = "RESOURCE_TYPE_HOST_AUTHENTICATION_TOKEN"` - `const ResourceTypeGroup ResourceType = "RESOURCE_TYPE_GROUP"` - `const ResourceTypePersonalAccessToken ResourceType = "RESOURCE_TYPE_PERSONAL_ACCESS_TOKEN"` - `const ResourceTypeUserPreference ResourceType = "RESOURCE_TYPE_USER_PREFERENCE"` - `const ResourceTypeServiceAccount ResourceType = "RESOURCE_TYPE_SERVICE_ACCOUNT"` - `const ResourceTypeSecret ResourceType = "RESOURCE_TYPE_SECRET"` - `const ResourceTypeSSOConfig ResourceType = "RESOURCE_TYPE_SSO_CONFIG"` - `const ResourceTypeDomainVerification ResourceType = "RESOURCE_TYPE_DOMAIN_VERIFICATION"` - `const ResourceTypeAgentExecution ResourceType = "RESOURCE_TYPE_AGENT_EXECUTION"` - `const ResourceTypeRunnerLlmIntegration ResourceType = "RESOURCE_TYPE_RUNNER_LLM_INTEGRATION"` - `const ResourceTypeAgent ResourceType = "RESOURCE_TYPE_AGENT"` - `const ResourceTypeEnvironmentSession ResourceType = "RESOURCE_TYPE_ENVIRONMENT_SESSION"` - `const ResourceTypeUserSecret ResourceType = "RESOURCE_TYPE_USER_SECRET"` - `const ResourceTypeOrganizationPolicy ResourceType = "RESOURCE_TYPE_ORGANIZATION_POLICY"` - `const ResourceTypeOrganizationSecret ResourceType = "RESOURCE_TYPE_ORGANIZATION_SECRET"` - `const ResourceTypeProjectEnvironmentClass ResourceType = "RESOURCE_TYPE_PROJECT_ENVIRONMENT_CLASS"` - `const ResourceTypeBilling ResourceType = "RESOURCE_TYPE_BILLING"` - `const ResourceTypePrompt ResourceType = "RESOURCE_TYPE_PROMPT"` - `const ResourceTypeCoupon ResourceType = "RESOURCE_TYPE_COUPON"` - `const ResourceTypeCouponRedemption ResourceType = "RESOURCE_TYPE_COUPON_REDEMPTION"` - `const ResourceTypeAccount ResourceType = "RESOURCE_TYPE_ACCOUNT"` - `const ResourceTypeIntegration ResourceType = "RESOURCE_TYPE_INTEGRATION"` - `const ResourceTypeWorkflow ResourceType = "RESOURCE_TYPE_WORKFLOW"` - `const ResourceTypeWorkflowExecution ResourceType = "RESOURCE_TYPE_WORKFLOW_EXECUTION"` - `const ResourceTypeWorkflowExecutionAction ResourceType = "RESOURCE_TYPE_WORKFLOW_EXECUTION_ACTION"` - `const ResourceTypeSnapshot ResourceType = "RESOURCE_TYPE_SNAPSHOT"` - `const ResourceTypePrebuild ResourceType = "RESOURCE_TYPE_PREBUILD"` - `const ResourceTypeOrganizationLlmIntegration ResourceType = "RESOURCE_TYPE_ORGANIZATION_LLM_INTEGRATION"` - `const ResourceTypeCustomDomain ResourceType = "RESOURCE_TYPE_CUSTOM_DOMAIN"` - `const ResourceTypeRoleAssignmentChanged ResourceType = "RESOURCE_TYPE_ROLE_ASSIGNMENT_CHANGED"` - `const ResourceTypeGroupMembershipChanged ResourceType = "RESOURCE_TYPE_GROUP_MEMBERSHIP_CHANGED"` - `const ResourceTypeWebhook ResourceType = "RESOURCE_TYPE_WEBHOOK"` - `const ResourceTypeScimConfiguration ResourceType = "RESOURCE_TYPE_SCIM_CONFIGURATION"` - `const ResourceTypeServiceAccountSecret ResourceType = "RESOURCE_TYPE_SERVICE_ACCOUNT_SECRET"` - `const ResourceTypeAnnouncementBanner ResourceType = "RESOURCE_TYPE_ANNOUNCEMENT_BANNER"` - `const ResourceTypeServiceAccountToken ResourceType = "RESOURCE_TYPE_SERVICE_ACCOUNT_TOKEN"` - `const ResourceTypeRoleAssignment ResourceType = "RESOURCE_TYPE_ROLE_ASSIGNMENT"` - `const ResourceTypeWarmPool ResourceType = "RESOURCE_TYPE_WARM_POOL"` - `const ResourceTypeNotification ResourceType = "RESOURCE_TYPE_NOTIFICATION"` ### Example ```go package main import ( "context" "fmt" "github.com/gitpod-io/gitpod-sdk-go" "github.com/gitpod-io/gitpod-sdk-go/option" "github.com/gitpod-io/gitpod-sdk-go/shared" ) func main() { client := gitpod.NewClient( option.WithBearerToken("My Bearer Token"), ) page, err := client.Groups.RoleAssignments.List(context.TODO(), gitpod.GroupRoleAssignmentListParams{ Filter: gitpod.F(gitpod.GroupRoleAssignmentListParamsFilter{ ResourceTypes: gitpod.F([]shared.ResourceType{shared.ResourceTypeRunner}), }), Pagination: gitpod.F(gitpod.GroupRoleAssignmentListParamsPagination{ PageSize: gitpod.F(int64(20)), }), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", page) } ``` #### 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 - `type RoleAssignment struct{…}` RoleAssignment represents a role assigned to a group on a specific resource - `ID string` Unique identifier for the role assignment - `DerivedFromOrgRole ResourceRole` 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. - `const ResourceRoleUnspecified ResourceRole = "RESOURCE_ROLE_UNSPECIFIED"` - `const ResourceRoleOrgAdmin ResourceRole = "RESOURCE_ROLE_ORG_ADMIN"` - `const ResourceRoleOrgMember ResourceRole = "RESOURCE_ROLE_ORG_MEMBER"` - `const ResourceRoleOrgRunnersAdmin ResourceRole = "RESOURCE_ROLE_ORG_RUNNERS_ADMIN"` - `const ResourceRoleOrgProjectsAdmin ResourceRole = "RESOURCE_ROLE_ORG_PROJECTS_ADMIN"` - `const ResourceRoleOrgAutomationsAdmin ResourceRole = "RESOURCE_ROLE_ORG_AUTOMATIONS_ADMIN"` - `const ResourceRoleOrgGroupsAdmin ResourceRole = "RESOURCE_ROLE_ORG_GROUPS_ADMIN"` - `const ResourceRoleOrgAuditLogReader ResourceRole = "RESOURCE_ROLE_ORG_AUDIT_LOG_READER"` - `const ResourceRoleGroupAdmin ResourceRole = "RESOURCE_ROLE_GROUP_ADMIN"` - `const ResourceRoleGroupViewer ResourceRole = "RESOURCE_ROLE_GROUP_VIEWER"` - `const ResourceRoleUserIdentity ResourceRole = "RESOURCE_ROLE_USER_IDENTITY"` - `const ResourceRoleUserViewer ResourceRole = "RESOURCE_ROLE_USER_VIEWER"` - `const ResourceRoleUserAdmin ResourceRole = "RESOURCE_ROLE_USER_ADMIN"` - `const ResourceRoleEnvironmentIdentity ResourceRole = "RESOURCE_ROLE_ENVIRONMENT_IDENTITY"` - `const ResourceRoleEnvironmentAdmin ResourceRole = "RESOURCE_ROLE_ENVIRONMENT_ADMIN"` - `const ResourceRoleEnvironmentUser ResourceRole = "RESOURCE_ROLE_ENVIRONMENT_USER"` - `const ResourceRoleEnvironmentViewer ResourceRole = "RESOURCE_ROLE_ENVIRONMENT_VIEWER"` - `const ResourceRoleEnvironmentRunner ResourceRole = "RESOURCE_ROLE_ENVIRONMENT_RUNNER"` - `const ResourceRoleRunnerIdentity ResourceRole = "RESOURCE_ROLE_RUNNER_IDENTITY"` - `const ResourceRoleRunnerAdmin ResourceRole = "RESOURCE_ROLE_RUNNER_ADMIN"` - `const ResourceRoleRunnerLocalAdmin ResourceRole = "RESOURCE_ROLE_RUNNER_LOCAL_ADMIN"` - `const ResourceRoleRunnerManagedAdmin ResourceRole = "RESOURCE_ROLE_RUNNER_MANAGED_ADMIN"` - `const ResourceRoleRunnerUser ResourceRole = "RESOURCE_ROLE_RUNNER_USER"` - `const ResourceRoleRunnerConfigurationReader ResourceRole = "RESOURCE_ROLE_RUNNER_CONFIGURATION_READER"` - `const ResourceRoleHostAuthenticationTokenAdmin ResourceRole = "RESOURCE_ROLE_HOST_AUTHENTICATION_TOKEN_ADMIN"` - `const ResourceRoleHostAuthenticationTokenUpdater ResourceRole = "RESOURCE_ROLE_HOST_AUTHENTICATION_TOKEN_UPDATER"` - `const ResourceRoleProjectAdmin ResourceRole = "RESOURCE_ROLE_PROJECT_ADMIN"` - `const ResourceRoleProjectUser ResourceRole = "RESOURCE_ROLE_PROJECT_USER"` - `const ResourceRoleProjectEditor ResourceRole = "RESOURCE_ROLE_PROJECT_EDITOR"` - `const ResourceRoleEnvironmentServiceAdmin ResourceRole = "RESOURCE_ROLE_ENVIRONMENT_SERVICE_ADMIN"` - `const ResourceRoleEnvironmentServiceViewer ResourceRole = "RESOURCE_ROLE_ENVIRONMENT_SERVICE_VIEWER"` - `const ResourceRoleEnvironmentServiceUser ResourceRole = "RESOURCE_ROLE_ENVIRONMENT_SERVICE_USER"` - `const ResourceRoleEnvironmentServiceEnv ResourceRole = "RESOURCE_ROLE_ENVIRONMENT_SERVICE_ENV"` - `const ResourceRoleEnvironmentTaskAdmin ResourceRole = "RESOURCE_ROLE_ENVIRONMENT_TASK_ADMIN"` - `const ResourceRoleEnvironmentTaskViewer ResourceRole = "RESOURCE_ROLE_ENVIRONMENT_TASK_VIEWER"` - `const ResourceRoleEnvironmentTaskUser ResourceRole = "RESOURCE_ROLE_ENVIRONMENT_TASK_USER"` - `const ResourceRoleEnvironmentTaskEnv ResourceRole = "RESOURCE_ROLE_ENVIRONMENT_TASK_ENV"` - `const ResourceRoleServiceAccountIdentity ResourceRole = "RESOURCE_ROLE_SERVICE_ACCOUNT_IDENTITY"` - `const ResourceRoleServiceAccountAdmin ResourceRole = "RESOURCE_ROLE_SERVICE_ACCOUNT_ADMIN"` - `const ResourceRoleAgentExecutionUser ResourceRole = "RESOURCE_ROLE_AGENT_EXECUTION_USER"` - `const ResourceRoleAgentExecutionAdmin ResourceRole = "RESOURCE_ROLE_AGENT_EXECUTION_ADMIN"` - `const ResourceRoleAgentExecutionRunner ResourceRole = "RESOURCE_ROLE_AGENT_EXECUTION_RUNNER"` - `const ResourceRoleAgentExecutionOutputsReporter ResourceRole = "RESOURCE_ROLE_AGENT_EXECUTION_OUTPUTS_REPORTER"` - `const ResourceRoleAgentExecutionViewer ResourceRole = "RESOURCE_ROLE_AGENT_EXECUTION_VIEWER"` - `const ResourceRoleAgentAdmin ResourceRole = "RESOURCE_ROLE_AGENT_ADMIN"` - `const ResourceRoleAgentViewer ResourceRole = "RESOURCE_ROLE_AGENT_VIEWER"` - `const ResourceRoleAgentExecutor ResourceRole = "RESOURCE_ROLE_AGENT_EXECUTOR"` - `const ResourceRoleWorkflowAdmin ResourceRole = "RESOURCE_ROLE_WORKFLOW_ADMIN"` - `const ResourceRoleWorkflowUser ResourceRole = "RESOURCE_ROLE_WORKFLOW_USER"` - `const ResourceRoleWorkflowViewer ResourceRole = "RESOURCE_ROLE_WORKFLOW_VIEWER"` - `const ResourceRoleWorkflowExecutor ResourceRole = "RESOURCE_ROLE_WORKFLOW_EXECUTOR"` - `const ResourceRoleSnapshotAdmin ResourceRole = "RESOURCE_ROLE_SNAPSHOT_ADMIN"` - `const ResourceRoleSnapshotRunner ResourceRole = "RESOURCE_ROLE_SNAPSHOT_RUNNER"` - `const ResourceRoleWebhookAdmin ResourceRole = "RESOURCE_ROLE_WEBHOOK_ADMIN"` - `const ResourceRoleWebhookViewer ResourceRole = "RESOURCE_ROLE_WEBHOOK_VIEWER"` - `const ResourceRoleWarmpoolRunner ResourceRole = "RESOURCE_ROLE_WARMPOOL_RUNNER"` - `const ResourceRoleWarmpoolAdmin ResourceRole = "RESOURCE_ROLE_WARMPOOL_ADMIN"` - `const ResourceRoleWarmpoolViewer ResourceRole = "RESOURCE_ROLE_WARMPOOL_VIEWER"` - `const ResourceRoleSessionAdmin ResourceRole = "RESOURCE_ROLE_SESSION_ADMIN"` - `const ResourceRoleSessionUser ResourceRole = "RESOURCE_ROLE_SESSION_USER"` - `const ResourceRoleTeamAdmin ResourceRole = "RESOURCE_ROLE_TEAM_ADMIN"` - `const ResourceRoleTeamViewer ResourceRole = "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.) - `const ResourceTypeUnspecified ResourceType = "RESOURCE_TYPE_UNSPECIFIED"` - `const ResourceTypeEnvironment ResourceType = "RESOURCE_TYPE_ENVIRONMENT"` - `const ResourceTypeRunner ResourceType = "RESOURCE_TYPE_RUNNER"` - `const ResourceTypeProject ResourceType = "RESOURCE_TYPE_PROJECT"` - `const ResourceTypeTask ResourceType = "RESOURCE_TYPE_TASK"` - `const ResourceTypeTaskExecution ResourceType = "RESOURCE_TYPE_TASK_EXECUTION"` - `const ResourceTypeService ResourceType = "RESOURCE_TYPE_SERVICE"` - `const ResourceTypeOrganization ResourceType = "RESOURCE_TYPE_ORGANIZATION"` - `const ResourceTypeUser ResourceType = "RESOURCE_TYPE_USER"` - `const ResourceTypeEnvironmentClass ResourceType = "RESOURCE_TYPE_ENVIRONMENT_CLASS"` - `const ResourceTypeRunnerScmIntegration ResourceType = "RESOURCE_TYPE_RUNNER_SCM_INTEGRATION"` - `const ResourceTypeHostAuthenticationToken ResourceType = "RESOURCE_TYPE_HOST_AUTHENTICATION_TOKEN"` - `const ResourceTypeGroup ResourceType = "RESOURCE_TYPE_GROUP"` - `const ResourceTypePersonalAccessToken ResourceType = "RESOURCE_TYPE_PERSONAL_ACCESS_TOKEN"` - `const ResourceTypeUserPreference ResourceType = "RESOURCE_TYPE_USER_PREFERENCE"` - `const ResourceTypeServiceAccount ResourceType = "RESOURCE_TYPE_SERVICE_ACCOUNT"` - `const ResourceTypeSecret ResourceType = "RESOURCE_TYPE_SECRET"` - `const ResourceTypeSSOConfig ResourceType = "RESOURCE_TYPE_SSO_CONFIG"` - `const ResourceTypeDomainVerification ResourceType = "RESOURCE_TYPE_DOMAIN_VERIFICATION"` - `const ResourceTypeAgentExecution ResourceType = "RESOURCE_TYPE_AGENT_EXECUTION"` - `const ResourceTypeRunnerLlmIntegration ResourceType = "RESOURCE_TYPE_RUNNER_LLM_INTEGRATION"` - `const ResourceTypeAgent ResourceType = "RESOURCE_TYPE_AGENT"` - `const ResourceTypeEnvironmentSession ResourceType = "RESOURCE_TYPE_ENVIRONMENT_SESSION"` - `const ResourceTypeUserSecret ResourceType = "RESOURCE_TYPE_USER_SECRET"` - `const ResourceTypeOrganizationPolicy ResourceType = "RESOURCE_TYPE_ORGANIZATION_POLICY"` - `const ResourceTypeOrganizationSecret ResourceType = "RESOURCE_TYPE_ORGANIZATION_SECRET"` - `const ResourceTypeProjectEnvironmentClass ResourceType = "RESOURCE_TYPE_PROJECT_ENVIRONMENT_CLASS"` - `const ResourceTypeBilling ResourceType = "RESOURCE_TYPE_BILLING"` - `const ResourceTypePrompt ResourceType = "RESOURCE_TYPE_PROMPT"` - `const ResourceTypeCoupon ResourceType = "RESOURCE_TYPE_COUPON"` - `const ResourceTypeCouponRedemption ResourceType = "RESOURCE_TYPE_COUPON_REDEMPTION"` - `const ResourceTypeAccount ResourceType = "RESOURCE_TYPE_ACCOUNT"` - `const ResourceTypeIntegration ResourceType = "RESOURCE_TYPE_INTEGRATION"` - `const ResourceTypeWorkflow ResourceType = "RESOURCE_TYPE_WORKFLOW"` - `const ResourceTypeWorkflowExecution ResourceType = "RESOURCE_TYPE_WORKFLOW_EXECUTION"` - `const ResourceTypeWorkflowExecutionAction ResourceType = "RESOURCE_TYPE_WORKFLOW_EXECUTION_ACTION"` - `const ResourceTypeSnapshot ResourceType = "RESOURCE_TYPE_SNAPSHOT"` - `const ResourceTypePrebuild ResourceType = "RESOURCE_TYPE_PREBUILD"` - `const ResourceTypeOrganizationLlmIntegration ResourceType = "RESOURCE_TYPE_ORGANIZATION_LLM_INTEGRATION"` - `const ResourceTypeCustomDomain ResourceType = "RESOURCE_TYPE_CUSTOM_DOMAIN"` - `const ResourceTypeRoleAssignmentChanged ResourceType = "RESOURCE_TYPE_ROLE_ASSIGNMENT_CHANGED"` - `const ResourceTypeGroupMembershipChanged ResourceType = "RESOURCE_TYPE_GROUP_MEMBERSHIP_CHANGED"` - `const ResourceTypeWebhook ResourceType = "RESOURCE_TYPE_WEBHOOK"` - `const ResourceTypeScimConfiguration ResourceType = "RESOURCE_TYPE_SCIM_CONFIGURATION"` - `const ResourceTypeServiceAccountSecret ResourceType = "RESOURCE_TYPE_SERVICE_ACCOUNT_SECRET"` - `const ResourceTypeAnnouncementBanner ResourceType = "RESOURCE_TYPE_ANNOUNCEMENT_BANNER"` - `const ResourceTypeServiceAccountToken ResourceType = "RESOURCE_TYPE_SERVICE_ACCOUNT_TOKEN"` - `const ResourceTypeRoleAssignment ResourceType = "RESOURCE_TYPE_ROLE_ASSIGNMENT"` - `const ResourceTypeWarmPool ResourceType = "RESOURCE_TYPE_WARM_POOL"` - `const ResourceTypeNotification ResourceType = "RESOURCE_TYPE_NOTIFICATION"` # Shares ## ShareResourceWithPrincipal `client.Groups.Shares.New(ctx, body) (*GroupShareNewResponse, error)` **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 GroupShareNewParams` - `Principal param.Field[Principal]` Type of principal to share with (user or service account) - `PrincipalID param.Field[string]` ID of the principal (user or service account) to share with - `ResourceID param.Field[string]` ID of the resource to share - `ResourceType param.Field[ResourceType]` Type of resource to share (runner, project, etc.) - `Role param.Field[ResourceRole]` Role to grant the principal on the resource ### Returns - `type GroupShareNewResponse interface{…}` Empty response on success ### Example ```go package main import ( "context" "fmt" "github.com/gitpod-io/gitpod-sdk-go" "github.com/gitpod-io/gitpod-sdk-go/option" "github.com/gitpod-io/gitpod-sdk-go/shared" ) func main() { client := gitpod.NewClient( option.WithBearerToken("My Bearer Token"), ) share, err := client.Groups.Shares.New(context.TODO(), gitpod.GroupShareNewParams{ Principal: gitpod.F(shared.PrincipalServiceAccount), PrincipalID: gitpod.F("a1b2c3d4-5678-90ab-cdef-1234567890ab"), ResourceID: gitpod.F("d2c94c27-3b76-4a42-b88c-95a85e392c68"), ResourceType: gitpod.F(shared.ResourceTypeRunner), Role: gitpod.F(shared.ResourceRoleRunnerUser), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", share) } ``` #### Response ```json {} ``` ## UnshareResourceWithPrincipal `client.Groups.Shares.Delete(ctx, body) (*GroupShareDeleteResponse, error)` **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 GroupShareDeleteParams` - `Principal param.Field[Principal]` Type of principal to remove access from (user or service account) - `PrincipalID param.Field[string]` ID of the principal (user or service account) to remove access from - `ResourceID param.Field[string]` ID of the resource to unshare - `ResourceType param.Field[ResourceType]` Type of resource to unshare ### Returns - `type GroupShareDeleteResponse interface{…}` Empty response on success ### Example ```go package main import ( "context" "fmt" "github.com/gitpod-io/gitpod-sdk-go" "github.com/gitpod-io/gitpod-sdk-go/option" "github.com/gitpod-io/gitpod-sdk-go/shared" ) func main() { client := gitpod.NewClient( option.WithBearerToken("My Bearer Token"), ) share, err := client.Groups.Shares.Delete(context.TODO(), gitpod.GroupShareDeleteParams{ Principal: gitpod.F(shared.PrincipalUser), PrincipalID: gitpod.F("f53d2330-3795-4c5d-a1f3-453121af9c60"), ResourceID: gitpod.F("d2c94c27-3b76-4a42-b88c-95a85e392c68"), ResourceType: gitpod.F(shared.ResourceTypeRunner), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", share) } ``` #### Response ```json {} ```