@@ -365,11 +365,66 @@ func (r *RunnerService) NewRunnerToken(ctx context.Context, body RunnerNewRunner
365365// runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68"
366366// scmHost: "github.com"
367367// ```
368- func (r * RunnerService ) ListScmOrganizations (ctx context.Context , params RunnerListScmOrganizationsParams , opts ... option.RequestOption ) (res * RunnerListScmOrganizationsResponse , err error ) {
368+ //
369+ // - Search GitLab groups:
370+ //
371+ // Returns the first page of GitLab groups matching the substring.
372+ //
373+ // ```yaml
374+ // runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68"
375+ // scmHost: "gitlab.com"
376+ // query: "platform"
377+ // pagination:
378+ // pageSize: 25
379+ // ```
380+ func (r * RunnerService ) ListScmOrganizations (ctx context.Context , params RunnerListScmOrganizationsParams , opts ... option.RequestOption ) (res * pagination.OrganizationsPage [RunnerListScmOrganizationsResponse ], err error ) {
381+ var raw * http.Response
369382 opts = slices .Concat (r .Options , opts )
383+ opts = append ([]option.RequestOption {option .WithResponseInto (& raw )}, opts ... )
370384 path := "gitpod.v1.RunnerService/ListSCMOrganizations"
371- err = requestconfig .ExecuteNewRequest (ctx , http .MethodPost , path , params , & res , opts ... )
372- return res , err
385+ cfg , err := requestconfig .NewRequestConfig (ctx , http .MethodPost , path , params , & res , opts ... )
386+ if err != nil {
387+ return nil , err
388+ }
389+ err = cfg .Execute ()
390+ if err != nil {
391+ return nil , err
392+ }
393+ res .SetPageConfig (cfg , raw )
394+ return res , nil
395+ }
396+
397+ // Lists SCM organizations the user belongs to.
398+ //
399+ // Use this method to:
400+ //
401+ // - Get all organizations for a user on a specific SCM host
402+ // - Check organization admin permissions for webhook creation
403+ //
404+ // ### Examples
405+ //
406+ // - List GitHub organizations:
407+ //
408+ // Lists all organizations the user belongs to on GitHub.
409+ //
410+ // ```yaml
411+ // runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68"
412+ // scmHost: "github.com"
413+ // ```
414+ //
415+ // - Search GitLab groups:
416+ //
417+ // Returns the first page of GitLab groups matching the substring.
418+ //
419+ // ```yaml
420+ // runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68"
421+ // scmHost: "gitlab.com"
422+ // query: "platform"
423+ // pagination:
424+ // pageSize: 25
425+ // ```
426+ func (r * RunnerService ) ListScmOrganizationsAutoPaging (ctx context.Context , params RunnerListScmOrganizationsParams , opts ... option.RequestOption ) * pagination.OrganizationsPageAutoPager [RunnerListScmOrganizationsResponse ] {
427+ return pagination .NewOrganizationsPageAutoPager (r .ListScmOrganizations (ctx , params , opts ... ))
373428}
374429
375430// Parses a context URL and returns the parsed result.
@@ -1169,28 +1224,6 @@ func (r runnerNewRunnerTokenResponseJSON) RawJSON() string {
11691224}
11701225
11711226type RunnerListScmOrganizationsResponse struct {
1172- // List of organizations the user belongs to
1173- Organizations []RunnerListScmOrganizationsResponseOrganization `json:"organizations"`
1174- JSON runnerListScmOrganizationsResponseJSON `json:"-"`
1175- }
1176-
1177- // runnerListScmOrganizationsResponseJSON contains the JSON metadata for the struct
1178- // [RunnerListScmOrganizationsResponse]
1179- type runnerListScmOrganizationsResponseJSON struct {
1180- Organizations apijson.Field
1181- raw string
1182- ExtraFields map [string ]apijson.Field
1183- }
1184-
1185- func (r * RunnerListScmOrganizationsResponse ) UnmarshalJSON (data []byte ) (err error ) {
1186- return apijson .UnmarshalRoot (data , r )
1187- }
1188-
1189- func (r runnerListScmOrganizationsResponseJSON ) RawJSON () string {
1190- return r .raw
1191- }
1192-
1193- type RunnerListScmOrganizationsResponseOrganization struct {
11941227 // Deprecated: this field is unused by all known consumers and is scheduled for
11951228 // removal in a future release. Do not read it.
11961229 //
@@ -1204,25 +1237,25 @@ type RunnerListScmOrganizationsResponseOrganization struct {
12041237 // Organization name/slug (e.g., "gitpod-io")
12051238 Name string `json:"name"`
12061239 // Organization URL (e.g., "https://github.com/gitpod-io")
1207- URL string `json:"url"`
1208- JSON runnerListScmOrganizationsResponseOrganizationJSON `json:"-"`
1240+ URL string `json:"url"`
1241+ JSON runnerListScmOrganizationsResponseJSON `json:"-"`
12091242}
12101243
1211- // runnerListScmOrganizationsResponseOrganizationJSON contains the JSON metadata
1212- // for the struct [RunnerListScmOrganizationsResponseOrganization ]
1213- type runnerListScmOrganizationsResponseOrganizationJSON struct {
1244+ // runnerListScmOrganizationsResponseJSON contains the JSON metadata for the struct
1245+ // [RunnerListScmOrganizationsResponse ]
1246+ type runnerListScmOrganizationsResponseJSON struct {
12141247 IsAdmin apijson.Field
12151248 Name apijson.Field
12161249 URL apijson.Field
12171250 raw string
12181251 ExtraFields map [string ]apijson.Field
12191252}
12201253
1221- func (r * RunnerListScmOrganizationsResponseOrganization ) UnmarshalJSON (data []byte ) (err error ) {
1254+ func (r * RunnerListScmOrganizationsResponse ) UnmarshalJSON (data []byte ) (err error ) {
12221255 return apijson .UnmarshalRoot (data , r )
12231256}
12241257
1225- func (r runnerListScmOrganizationsResponseOrganizationJSON ) RawJSON () string {
1258+ func (r runnerListScmOrganizationsResponseJSON ) RawJSON () string {
12261259 return r .raw
12271260}
12281261
@@ -1723,6 +1756,16 @@ func (r RunnerNewRunnerTokenParams) MarshalJSON() (data []byte, err error) {
17231756type RunnerListScmOrganizationsParams struct {
17241757 Token param.Field [string ] `query:"token"`
17251758 PageSize param.Field [int64 ] `query:"pageSize"`
1759+ // Pagination parameters. When unset, defaults to the standard PaginationRequest
1760+ // defaults (page_size 25, max 100). Tokens are opaque and provider-specific.
1761+ Pagination param.Field [RunnerListScmOrganizationsParamsPagination ] `json:"pagination"`
1762+ // Optional substring filter applied to the organization name.
1763+ //
1764+ // - GitLab: forwarded to the upstream `search` parameter (server-side,
1765+ // case-insensitive substring on name/path).
1766+ // - GitHub and Bitbucket: not implemented as they don't support searching Empty
1767+ // value means no filter.
1768+ Query param.Field [string ] `json:"query"`
17261769 RunnerID param.Field [string ] `json:"runnerId" format:"uuid"`
17271770 // The SCM host to list organizations from (e.g., "github.com", "gitlab.com")
17281771 ScmHost param.Field [string ] `json:"scmHost"`
@@ -1741,6 +1784,21 @@ func (r RunnerListScmOrganizationsParams) URLQuery() (v url.Values) {
17411784 })
17421785}
17431786
1787+ // Pagination parameters. When unset, defaults to the standard PaginationRequest
1788+ // defaults (page_size 25, max 100). Tokens are opaque and provider-specific.
1789+ type RunnerListScmOrganizationsParamsPagination struct {
1790+ // Token for the next set of results that was returned as next_token of a
1791+ // PaginationResponse
1792+ Token param.Field [string ] `json:"token"`
1793+ // Page size is the maximum number of results to retrieve per page. Defaults to 25.
1794+ // Maximum 100.
1795+ PageSize param.Field [int64 ] `json:"pageSize"`
1796+ }
1797+
1798+ func (r RunnerListScmOrganizationsParamsPagination ) MarshalJSON () (data []byte , err error ) {
1799+ return apijson .MarshalRoot (r )
1800+ }
1801+
17441802type RunnerParseContextURLParams struct {
17451803 ContextURL param.Field [string ] `json:"contextUrl" format:"uri"`
17461804 RunnerID param.Field [string ] `json:"runnerId" format:"uuid"`
0 commit comments