## UpdateRunnerPolicy `client.Runners.Policies.Update(ctx, body) (*RunnerPolicyUpdateResponse, error)` **post** `/gitpod.v1.RunnerService/UpdateRunnerPolicy` Updates an existing runner policy. Use this method to: - Modify access levels - Change group roles - Update permissions ### Examples - Update policy role: Changes a group's access level. ```yaml runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" groupId: "f53d2330-3795-4c5d-a1f3-453121af9c60" role: RUNNER_ROLE_USER ``` ### Parameters - `body RunnerPolicyUpdateParams` - `GroupID param.Field[string]` group_id specifies the group_id identifier - `Role param.Field[RunnerRole]` - `RunnerID param.Field[string]` runner_id specifies the project identifier ### Returns - `type RunnerPolicyUpdateResponse struct{…}` - `Policy RunnerPolicy` - `GroupID string` - `Role RunnerRole` role is the role assigned to the group - `const RunnerRoleUnspecified RunnerRole = "RUNNER_ROLE_UNSPECIFIED"` - `const RunnerRoleAdmin RunnerRole = "RUNNER_ROLE_ADMIN"` - `const RunnerRoleUser RunnerRole = "RUNNER_ROLE_USER"` ### Example ```go package main import ( "context" "fmt" "github.com/gitpod-io/gitpod-sdk-go" "github.com/gitpod-io/gitpod-sdk-go/option" ) func main() { client := gitpod.NewClient( option.WithBearerToken("My Bearer Token"), ) policy, err := client.Runners.Policies.Update(context.TODO(), gitpod.RunnerPolicyUpdateParams{ GroupID: gitpod.F("f53d2330-3795-4c5d-a1f3-453121af9c60"), Role: gitpod.F(gitpod.RunnerRoleUser), RunnerID: gitpod.F("d2c94c27-3b76-4a42-b88c-95a85e392c68"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", policy.Policy) } ``` #### Response ```json { "policy": { "groupId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "role": "RUNNER_ROLE_UNSPECIFIED" } } ```