Skip to content

Commit a71a350

Browse files
feat(api): manual updates (#40)
1 parent 853ae5c commit a71a350

File tree

4 files changed

+74
-8
lines changed

4 files changed

+74
-8
lines changed

Diff for: .stats.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 111
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-410f762771ac58738f3d165b19c5e2e9377ebbfa3f090f041e269142cfa2e7f4.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-bef0e79f204c51c91f5dca61e621e5e31c7494dccccb200e51da0c7654340816.yml

Diff for: environment.go

+60-4
Original file line numberDiff line numberDiff line change
@@ -1082,15 +1082,18 @@ type EnvironmentSpecDevcontainer struct {
10821082
// ```
10831083
// this.matches('^$|^[^/].*')
10841084
// ```
1085-
DevcontainerFilePath string `json:"devcontainerFilePath"`
1086-
Session string `json:"session"`
1087-
JSON environmentSpecDevcontainerJSON `json:"-"`
1085+
DevcontainerFilePath string `json:"devcontainerFilePath"`
1086+
// Experimental: dotfiles is the dotfiles configuration of the devcontainer
1087+
Dotfiles EnvironmentSpecDevcontainerDotfiles `json:"dotfiles"`
1088+
Session string `json:"session"`
1089+
JSON environmentSpecDevcontainerJSON `json:"-"`
10881090
}
10891091

10901092
// environmentSpecDevcontainerJSON contains the JSON metadata for the struct
10911093
// [EnvironmentSpecDevcontainer]
10921094
type environmentSpecDevcontainerJSON struct {
10931095
DevcontainerFilePath apijson.Field
1096+
Dotfiles apijson.Field
10941097
Session apijson.Field
10951098
raw string
10961099
ExtraFields map[string]apijson.Field
@@ -1104,6 +1107,39 @@ func (r environmentSpecDevcontainerJSON) RawJSON() string {
11041107
return r.raw
11051108
}
11061109

1110+
// Experimental: dotfiles is the dotfiles configuration of the devcontainer
1111+
type EnvironmentSpecDevcontainerDotfiles struct {
1112+
// URL of a dotfiles Git repository (e.g. https://github.com/owner/repository)
1113+
Repository string `json:"repository,required" format:"uri"`
1114+
// install_command is the command to run after cloning the dotfiles repository.
1115+
// Defaults to run the first file of `install.sh`, `install`, `bootstrap.sh`,
1116+
// `bootstrap`, `setup.sh` and `setup` found in the dotfiles repository's root
1117+
// folder.
1118+
InstallCommand string `json:"installCommand"`
1119+
// target_path is the path to clone the dotfiles repository to. Defaults to
1120+
// `~/dotfiles`.
1121+
TargetPath string `json:"targetPath"`
1122+
JSON environmentSpecDevcontainerDotfilesJSON `json:"-"`
1123+
}
1124+
1125+
// environmentSpecDevcontainerDotfilesJSON contains the JSON metadata for the
1126+
// struct [EnvironmentSpecDevcontainerDotfiles]
1127+
type environmentSpecDevcontainerDotfilesJSON struct {
1128+
Repository apijson.Field
1129+
InstallCommand apijson.Field
1130+
TargetPath apijson.Field
1131+
raw string
1132+
ExtraFields map[string]apijson.Field
1133+
}
1134+
1135+
func (r *EnvironmentSpecDevcontainerDotfiles) UnmarshalJSON(data []byte) (err error) {
1136+
return apijson.UnmarshalRoot(data, r)
1137+
}
1138+
1139+
func (r environmentSpecDevcontainerDotfilesJSON) RawJSON() string {
1140+
return r.raw
1141+
}
1142+
11071143
// machine is the machine spec of the environment
11081144
type EnvironmentSpecMachine struct {
11091145
// Class denotes the class of the environment we ought to start
@@ -1378,13 +1414,33 @@ type EnvironmentSpecDevcontainerParam struct {
13781414
// this.matches('^$|^[^/].*')
13791415
// ```
13801416
DevcontainerFilePath param.Field[string] `json:"devcontainerFilePath"`
1381-
Session param.Field[string] `json:"session"`
1417+
// Experimental: dotfiles is the dotfiles configuration of the devcontainer
1418+
Dotfiles param.Field[EnvironmentSpecDevcontainerDotfilesParam] `json:"dotfiles"`
1419+
Session param.Field[string] `json:"session"`
13821420
}
13831421

13841422
func (r EnvironmentSpecDevcontainerParam) MarshalJSON() (data []byte, err error) {
13851423
return apijson.MarshalRoot(r)
13861424
}
13871425

1426+
// Experimental: dotfiles is the dotfiles configuration of the devcontainer
1427+
type EnvironmentSpecDevcontainerDotfilesParam struct {
1428+
// URL of a dotfiles Git repository (e.g. https://github.com/owner/repository)
1429+
Repository param.Field[string] `json:"repository,required" format:"uri"`
1430+
// install_command is the command to run after cloning the dotfiles repository.
1431+
// Defaults to run the first file of `install.sh`, `install`, `bootstrap.sh`,
1432+
// `bootstrap`, `setup.sh` and `setup` found in the dotfiles repository's root
1433+
// folder.
1434+
InstallCommand param.Field[string] `json:"installCommand"`
1435+
// target_path is the path to clone the dotfiles repository to. Defaults to
1436+
// `~/dotfiles`.
1437+
TargetPath param.Field[string] `json:"targetPath"`
1438+
}
1439+
1440+
func (r EnvironmentSpecDevcontainerDotfilesParam) MarshalJSON() (data []byte, err error) {
1441+
return apijson.MarshalRoot(r)
1442+
}
1443+
13881444
// machine is the machine spec of the environment
13891445
type EnvironmentSpecMachineParam struct {
13901446
// Class denotes the class of the environment we ought to start

Diff for: environment_test.go

+12-2
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,12 @@ func TestEnvironmentNewWithOptionalParams(t *testing.T) {
5656
DesiredPhase: gitpod.F(gitpod.EnvironmentPhaseUnspecified),
5757
Devcontainer: gitpod.F(gitpod.EnvironmentSpecDevcontainerParam{
5858
DevcontainerFilePath: gitpod.F("devcontainerFilePath"),
59-
Session: gitpod.F("session"),
59+
Dotfiles: gitpod.F(gitpod.EnvironmentSpecDevcontainerDotfilesParam{
60+
Repository: gitpod.F("https://example.com"),
61+
InstallCommand: gitpod.F("installCommand"),
62+
TargetPath: gitpod.F("targetPath"),
63+
}),
64+
Session: gitpod.F("session"),
6065
}),
6166
Machine: gitpod.F(gitpod.EnvironmentSpecMachineParam{
6267
Class: gitpod.F("d2c94c27-3b76-4a42-b88c-95a85e392c68"),
@@ -294,7 +299,12 @@ func TestEnvironmentNewFromProjectWithOptionalParams(t *testing.T) {
294299
DesiredPhase: gitpod.F(gitpod.EnvironmentPhaseUnspecified),
295300
Devcontainer: gitpod.F(gitpod.EnvironmentSpecDevcontainerParam{
296301
DevcontainerFilePath: gitpod.F("devcontainerFilePath"),
297-
Session: gitpod.F("session"),
302+
Dotfiles: gitpod.F(gitpod.EnvironmentSpecDevcontainerDotfilesParam{
303+
Repository: gitpod.F("https://example.com"),
304+
InstallCommand: gitpod.F("installCommand"),
305+
TargetPath: gitpod.F("targetPath"),
306+
}),
307+
Session: gitpod.F("session"),
298308
}),
299309
Machine: gitpod.F(gitpod.EnvironmentSpecMachineParam{
300310
Class: gitpod.F("d2c94c27-3b76-4a42-b88c-95a85e392c68"),

Diff for: user.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ func (r *UserService) SetSuspended(ctx context.Context, body UserSetSuspendedPar
9696

9797
type User struct {
9898
// id is a UUID of the user
99-
ID string `json:"id" format:"uuid"`
99+
ID string `json:"id,required" format:"uuid"`
100100
// avatar_url is a link to the user avatar
101101
AvatarURL string `json:"avatarUrl"`
102102
// A Timestamp represents a point in time independent of any time zone or local

0 commit comments

Comments
 (0)