@@ -318,6 +318,27 @@ func (r *EnvironmentService) Delete(ctx context.Context, body EnvironmentDeleteP
318318 return
319319}
320320
321+ // Creates an access token for the environment.
322+ //
323+ // Generated tokens are valid for one hour and provide environment-specific access
324+ // permissions. The token is scoped to a specific environment.
325+ //
326+ // ### Examples
327+ //
328+ // - Generate environment token:
329+ //
330+ // Creates a temporary access token for accessing an environment.
331+ //
332+ // ```yaml
333+ // environmentId: "07e03a28-65a5-4d98-b532-8ea67b188048"
334+ // ```
335+ func (r * EnvironmentService ) NewEnvironmentToken (ctx context.Context , body EnvironmentNewEnvironmentTokenParams , opts ... option.RequestOption ) (res * EnvironmentNewEnvironmentTokenResponse , err error ) {
336+ opts = append (r .Options [:], opts ... )
337+ path := "gitpod.v1.EnvironmentService/CreateEnvironmentAccessToken"
338+ err = requestconfig .ExecuteNewRequest (ctx , http .MethodPost , path , body , & res , opts ... )
339+ return
340+ }
341+
321342// Creates an environment from an existing project configuration and starts it.
322343//
323344// This method uses project settings as defaults but allows overriding specific
@@ -731,6 +752,9 @@ func (r environmentSpecContentJSON) RawJSON() string {
731752
732753// devcontainer is the devcontainer spec of the environment
733754type EnvironmentSpecDevcontainer struct {
755+ // default_devcontainer_image is the default image that is used to start the
756+ // devcontainer if no devcontainer config file is found
757+ DefaultDevcontainerImage string `json:"defaultDevcontainerImage"`
734758 // devcontainer_file_path is the path to the devcontainer file relative to the repo
735759 // root path must not be absolute (start with a /):
736760 //
@@ -747,11 +771,12 @@ type EnvironmentSpecDevcontainer struct {
747771// environmentSpecDevcontainerJSON contains the JSON metadata for the struct
748772// [EnvironmentSpecDevcontainer]
749773type environmentSpecDevcontainerJSON struct {
750- DevcontainerFilePath apijson.Field
751- Dotfiles apijson.Field
752- Session apijson.Field
753- raw string
754- ExtraFields map [string ]apijson.Field
774+ DefaultDevcontainerImage apijson.Field
775+ DevcontainerFilePath apijson.Field
776+ Dotfiles apijson.Field
777+ Session apijson.Field
778+ raw string
779+ ExtraFields map [string ]apijson.Field
755780}
756781
757782func (r * EnvironmentSpecDevcontainer ) UnmarshalJSON (data []byte ) (err error ) {
@@ -839,6 +864,8 @@ func (r environmentSpecPortJSON) RawJSON() string {
839864}
840865
841866type EnvironmentSpecSecret struct {
867+ // id is the unique identifier of the secret.
868+ ID string `json:"id"`
842869 // container_registry_basic_auth_host is the hostname of the container registry
843870 // that supports basic auth
844871 ContainerRegistryBasicAuthHost string `json:"containerRegistryBasicAuthHost"`
@@ -861,6 +888,7 @@ type EnvironmentSpecSecret struct {
861888// environmentSpecSecretJSON contains the JSON metadata for the struct
862889// [EnvironmentSpecSecret]
863890type environmentSpecSecretJSON struct {
891+ ID apijson.Field
864892 ContainerRegistryBasicAuthHost apijson.Field
865893 EnvironmentVariable apijson.Field
866894 FilePath apijson.Field
@@ -997,6 +1025,9 @@ func (r EnvironmentSpecContentParam) MarshalJSON() (data []byte, err error) {
9971025
9981026// devcontainer is the devcontainer spec of the environment
9991027type EnvironmentSpecDevcontainerParam struct {
1028+ // default_devcontainer_image is the default image that is used to start the
1029+ // devcontainer if no devcontainer config file is found
1030+ DefaultDevcontainerImage param.Field [string ] `json:"defaultDevcontainerImage"`
10001031 // devcontainer_file_path is the path to the devcontainer file relative to the repo
10011032 // root path must not be absolute (start with a /):
10021033 //
@@ -1048,6 +1079,8 @@ func (r EnvironmentSpecPortParam) MarshalJSON() (data []byte, err error) {
10481079}
10491080
10501081type EnvironmentSpecSecretParam struct {
1082+ // id is the unique identifier of the secret.
1083+ ID param.Field [string ] `json:"id"`
10511084 // container_registry_basic_auth_host is the hostname of the container registry
10521085 // that supports basic auth
10531086 ContainerRegistryBasicAuthHost param.Field [string ] `json:"containerRegistryBasicAuthHost"`
@@ -1176,8 +1209,11 @@ type EnvironmentStatusAutomationsFile struct {
11761209 Phase EnvironmentStatusAutomationsFilePhase `json:"phase"`
11771210 // session is the automations file session that is currently applied in the
11781211 // environment.
1179- Session string `json:"session"`
1180- JSON environmentStatusAutomationsFileJSON `json:"-"`
1212+ Session string `json:"session"`
1213+ // warning_message contains warnings, e.g. when no triggers are defined in the
1214+ // automations file.
1215+ WarningMessage string `json:"warningMessage"`
1216+ JSON environmentStatusAutomationsFileJSON `json:"-"`
11811217}
11821218
11831219// environmentStatusAutomationsFileJSON contains the JSON metadata for the struct
@@ -1188,6 +1224,7 @@ type environmentStatusAutomationsFileJSON struct {
11881224 FailureMessage apijson.Field
11891225 Phase apijson.Field
11901226 Session apijson.Field
1227+ WarningMessage apijson.Field
11911228 raw string
11921229 ExtraFields map [string ]apijson.Field
11931230}
@@ -1700,6 +1737,8 @@ func (r EnvironmentStatusRunnerAckStatusCode) IsKnown() bool {
17001737}
17011738
17021739type EnvironmentStatusSecret struct {
1740+ // id is the unique identifier of the secret.
1741+ ID string `json:"id"`
17031742 // failure_message contains the reason the secret failed to be materialize.
17041743 FailureMessage string `json:"failureMessage"`
17051744 Phase EnvironmentStatusSecretsPhase `json:"phase"`
@@ -1715,6 +1754,7 @@ type EnvironmentStatusSecret struct {
17151754// environmentStatusSecretJSON contains the JSON metadata for the struct
17161755// [EnvironmentStatusSecret]
17171756type environmentStatusSecretJSON struct {
1757+ ID apijson.Field
17181758 FailureMessage apijson.Field
17191759 Phase apijson.Field
17201760 SecretName apijson.Field
@@ -1844,6 +1884,28 @@ type EnvironmentUpdateResponse = interface{}
18441884
18451885type EnvironmentDeleteResponse = interface {}
18461886
1887+ type EnvironmentNewEnvironmentTokenResponse struct {
1888+ // access_token is the token that can be used for environment authentication
1889+ AccessToken string `json:"accessToken,required"`
1890+ JSON environmentNewEnvironmentTokenResponseJSON `json:"-"`
1891+ }
1892+
1893+ // environmentNewEnvironmentTokenResponseJSON contains the JSON metadata for the
1894+ // struct [EnvironmentNewEnvironmentTokenResponse]
1895+ type environmentNewEnvironmentTokenResponseJSON struct {
1896+ AccessToken apijson.Field
1897+ raw string
1898+ ExtraFields map [string ]apijson.Field
1899+ }
1900+
1901+ func (r * EnvironmentNewEnvironmentTokenResponse ) UnmarshalJSON (data []byte ) (err error ) {
1902+ return apijson .UnmarshalRoot (data , r )
1903+ }
1904+
1905+ func (r environmentNewEnvironmentTokenResponseJSON ) RawJSON () string {
1906+ return r .raw
1907+ }
1908+
18471909type EnvironmentNewFromProjectResponse struct {
18481910 // +resource get environment
18491911 Environment Environment `json:"environment,required"`
@@ -2099,6 +2161,16 @@ func (r EnvironmentDeleteParams) MarshalJSON() (data []byte, err error) {
20992161 return apijson .MarshalRoot (r )
21002162}
21012163
2164+ type EnvironmentNewEnvironmentTokenParams struct {
2165+ // environment_id specifies the environment for which the access token should be
2166+ // created.
2167+ EnvironmentID param.Field [string ] `json:"environmentId,required" format:"uuid"`
2168+ }
2169+
2170+ func (r EnvironmentNewEnvironmentTokenParams ) MarshalJSON () (data []byte , err error ) {
2171+ return apijson .MarshalRoot (r )
2172+ }
2173+
21022174type EnvironmentNewFromProjectParams struct {
21032175 ProjectID param.Field [string ] `json:"projectId" format:"uuid"`
21042176 // Spec is the configuration of the environment that's required for the runner to
0 commit comments