@@ -318,6 +318,27 @@ func (r *EnvironmentService) Delete(ctx context.Context, body EnvironmentDeleteP
318
318
return
319
319
}
320
320
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
+
321
342
// Creates an environment from an existing project configuration and starts it.
322
343
//
323
344
// This method uses project settings as defaults but allows overriding specific
@@ -731,6 +752,9 @@ func (r environmentSpecContentJSON) RawJSON() string {
731
752
732
753
// devcontainer is the devcontainer spec of the environment
733
754
type 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"`
734
758
// devcontainer_file_path is the path to the devcontainer file relative to the repo
735
759
// root path must not be absolute (start with a /):
736
760
//
@@ -747,11 +771,12 @@ type EnvironmentSpecDevcontainer struct {
747
771
// environmentSpecDevcontainerJSON contains the JSON metadata for the struct
748
772
// [EnvironmentSpecDevcontainer]
749
773
type 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
755
780
}
756
781
757
782
func (r * EnvironmentSpecDevcontainer ) UnmarshalJSON (data []byte ) (err error ) {
@@ -839,6 +864,8 @@ func (r environmentSpecPortJSON) RawJSON() string {
839
864
}
840
865
841
866
type EnvironmentSpecSecret struct {
867
+ // id is the unique identifier of the secret.
868
+ ID string `json:"id"`
842
869
// container_registry_basic_auth_host is the hostname of the container registry
843
870
// that supports basic auth
844
871
ContainerRegistryBasicAuthHost string `json:"containerRegistryBasicAuthHost"`
@@ -861,6 +888,7 @@ type EnvironmentSpecSecret struct {
861
888
// environmentSpecSecretJSON contains the JSON metadata for the struct
862
889
// [EnvironmentSpecSecret]
863
890
type environmentSpecSecretJSON struct {
891
+ ID apijson.Field
864
892
ContainerRegistryBasicAuthHost apijson.Field
865
893
EnvironmentVariable apijson.Field
866
894
FilePath apijson.Field
@@ -997,6 +1025,9 @@ func (r EnvironmentSpecContentParam) MarshalJSON() (data []byte, err error) {
997
1025
998
1026
// devcontainer is the devcontainer spec of the environment
999
1027
type 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"`
1000
1031
// devcontainer_file_path is the path to the devcontainer file relative to the repo
1001
1032
// root path must not be absolute (start with a /):
1002
1033
//
@@ -1048,6 +1079,8 @@ func (r EnvironmentSpecPortParam) MarshalJSON() (data []byte, err error) {
1048
1079
}
1049
1080
1050
1081
type EnvironmentSpecSecretParam struct {
1082
+ // id is the unique identifier of the secret.
1083
+ ID param.Field [string ] `json:"id"`
1051
1084
// container_registry_basic_auth_host is the hostname of the container registry
1052
1085
// that supports basic auth
1053
1086
ContainerRegistryBasicAuthHost param.Field [string ] `json:"containerRegistryBasicAuthHost"`
@@ -1176,8 +1209,11 @@ type EnvironmentStatusAutomationsFile struct {
1176
1209
Phase EnvironmentStatusAutomationsFilePhase `json:"phase"`
1177
1210
// session is the automations file session that is currently applied in the
1178
1211
// 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:"-"`
1181
1217
}
1182
1218
1183
1219
// environmentStatusAutomationsFileJSON contains the JSON metadata for the struct
@@ -1188,6 +1224,7 @@ type environmentStatusAutomationsFileJSON struct {
1188
1224
FailureMessage apijson.Field
1189
1225
Phase apijson.Field
1190
1226
Session apijson.Field
1227
+ WarningMessage apijson.Field
1191
1228
raw string
1192
1229
ExtraFields map [string ]apijson.Field
1193
1230
}
@@ -1700,6 +1737,8 @@ func (r EnvironmentStatusRunnerAckStatusCode) IsKnown() bool {
1700
1737
}
1701
1738
1702
1739
type EnvironmentStatusSecret struct {
1740
+ // id is the unique identifier of the secret.
1741
+ ID string `json:"id"`
1703
1742
// failure_message contains the reason the secret failed to be materialize.
1704
1743
FailureMessage string `json:"failureMessage"`
1705
1744
Phase EnvironmentStatusSecretsPhase `json:"phase"`
@@ -1715,6 +1754,7 @@ type EnvironmentStatusSecret struct {
1715
1754
// environmentStatusSecretJSON contains the JSON metadata for the struct
1716
1755
// [EnvironmentStatusSecret]
1717
1756
type environmentStatusSecretJSON struct {
1757
+ ID apijson.Field
1718
1758
FailureMessage apijson.Field
1719
1759
Phase apijson.Field
1720
1760
SecretName apijson.Field
@@ -1844,6 +1884,28 @@ type EnvironmentUpdateResponse = interface{}
1844
1884
1845
1885
type EnvironmentDeleteResponse = interface {}
1846
1886
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
+
1847
1909
type EnvironmentNewFromProjectResponse struct {
1848
1910
// +resource get environment
1849
1911
Environment Environment `json:"environment,required"`
@@ -2099,6 +2161,16 @@ func (r EnvironmentDeleteParams) MarshalJSON() (data []byte, err error) {
2099
2161
return apijson .MarshalRoot (r )
2100
2162
}
2101
2163
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
+
2102
2174
type EnvironmentNewFromProjectParams struct {
2103
2175
ProjectID param.Field [string ] `json:"projectId" format:"uuid"`
2104
2176
// Spec is the configuration of the environment that's required for the runner to
0 commit comments