Skip to content

Commit f45ff56

Browse files
jsell-rhclaude
andcommitted
fix(sdk): add missing ScheduledSession fields to Go SDK types
Add Timeout, InactivityTimeout, StopOnRunFinished, and RunnerType fields to ScheduledSession, ScheduledSessionPatch, and their builders. These fields exist in the OpenAPI spec but were missing from the Go SDK, causing compilation failures in the CLI. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent fbe3cbe commit f45ff56

1 file changed

Lines changed: 70 additions & 16 deletions

File tree

components/ambient-sdk/go-sdk/types/scheduled_session.go

Lines changed: 70 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,20 @@ import (
99
type ScheduledSession struct {
1010
ObjectReference
1111

12-
AgentID string `json:"agent_id,omitempty"`
13-
Description string `json:"description,omitempty"`
14-
Enabled bool `json:"enabled,omitempty"`
15-
LastRunAt *time.Time `json:"last_run_at,omitempty"`
16-
Name string `json:"name"`
17-
NextRunAt *time.Time `json:"next_run_at,omitempty"`
18-
ProjectID string `json:"project_id,omitempty"`
19-
Schedule string `json:"schedule,omitempty"`
20-
SessionPrompt string `json:"session_prompt,omitempty"`
21-
Timezone string `json:"timezone,omitempty"`
12+
AgentID string `json:"agent_id,omitempty"`
13+
Description string `json:"description,omitempty"`
14+
Enabled bool `json:"enabled,omitempty"`
15+
InactivityTimeout *int32 `json:"inactivity_timeout,omitempty"`
16+
LastRunAt *time.Time `json:"last_run_at,omitempty"`
17+
Name string `json:"name"`
18+
NextRunAt *time.Time `json:"next_run_at,omitempty"`
19+
ProjectID string `json:"project_id,omitempty"`
20+
RunnerType string `json:"runner_type,omitempty"`
21+
Schedule string `json:"schedule,omitempty"`
22+
SessionPrompt string `json:"session_prompt,omitempty"`
23+
StopOnRunFinished *bool `json:"stop_on_run_finished,omitempty"`
24+
Timeout *int32 `json:"timeout,omitempty"`
25+
Timezone string `json:"timezone,omitempty"`
2226
}
2327

2428
type ScheduledSessionList struct {
@@ -34,12 +38,17 @@ func (l *ScheduledSessionList) GetSize() int { return l.Size }
3438
// ScheduledSessionPatch is the request body for a PATCH operation.
3539
// Only set fields that should be changed; omitted (nil) fields are left unchanged.
3640
type ScheduledSessionPatch struct {
37-
Name *string `json:"name,omitempty"`
38-
Description *string `json:"description,omitempty"`
39-
Schedule *string `json:"schedule,omitempty"`
40-
Timezone *string `json:"timezone,omitempty"`
41-
Enabled *bool `json:"enabled,omitempty"`
42-
SessionPrompt *string `json:"session_prompt,omitempty"`
41+
AgentID *string `json:"agent_id,omitempty"`
42+
Name *string `json:"name,omitempty"`
43+
Description *string `json:"description,omitempty"`
44+
Schedule *string `json:"schedule,omitempty"`
45+
Timezone *string `json:"timezone,omitempty"`
46+
Enabled *bool `json:"enabled,omitempty"`
47+
InactivityTimeout *int32 `json:"inactivity_timeout,omitempty"`
48+
RunnerType *string `json:"runner_type,omitempty"`
49+
SessionPrompt *string `json:"session_prompt,omitempty"`
50+
StopOnRunFinished *bool `json:"stop_on_run_finished,omitempty"`
51+
Timeout *int32 `json:"timeout,omitempty"`
4352
}
4453

4554
// ScheduledSessionBuilder builds a ScheduledSession for creation.
@@ -87,6 +96,26 @@ func (b *ScheduledSessionBuilder) Description(v string) *ScheduledSessionBuilder
8796
return b
8897
}
8998

99+
func (b *ScheduledSessionBuilder) Timeout(v int32) *ScheduledSessionBuilder {
100+
b.resource.Timeout = &v
101+
return b
102+
}
103+
104+
func (b *ScheduledSessionBuilder) InactivityTimeout(v int32) *ScheduledSessionBuilder {
105+
b.resource.InactivityTimeout = &v
106+
return b
107+
}
108+
109+
func (b *ScheduledSessionBuilder) StopOnRunFinished(v bool) *ScheduledSessionBuilder {
110+
b.resource.StopOnRunFinished = &v
111+
return b
112+
}
113+
114+
func (b *ScheduledSessionBuilder) RunnerType(v string) *ScheduledSessionBuilder {
115+
b.resource.RunnerType = v
116+
return b
117+
}
118+
90119
func (b *ScheduledSessionBuilder) Build() (*ScheduledSession, error) {
91120
if b.resource.Name == "" {
92121
b.errs = append(b.errs, fmt.Errorf("name is required"))
@@ -142,6 +171,31 @@ func (b *ScheduledSessionPatchBuilder) SessionPrompt(v string) *ScheduledSession
142171
return b
143172
}
144173

174+
func (b *ScheduledSessionPatchBuilder) AgentID(v string) *ScheduledSessionPatchBuilder {
175+
b.patch.AgentID = &v
176+
return b
177+
}
178+
179+
func (b *ScheduledSessionPatchBuilder) Timeout(v int32) *ScheduledSessionPatchBuilder {
180+
b.patch.Timeout = &v
181+
return b
182+
}
183+
184+
func (b *ScheduledSessionPatchBuilder) InactivityTimeout(v int32) *ScheduledSessionPatchBuilder {
185+
b.patch.InactivityTimeout = &v
186+
return b
187+
}
188+
189+
func (b *ScheduledSessionPatchBuilder) StopOnRunFinished(v bool) *ScheduledSessionPatchBuilder {
190+
b.patch.StopOnRunFinished = &v
191+
return b
192+
}
193+
194+
func (b *ScheduledSessionPatchBuilder) RunnerType(v string) *ScheduledSessionPatchBuilder {
195+
b.patch.RunnerType = &v
196+
return b
197+
}
198+
145199
func (b *ScheduledSessionPatchBuilder) Build() *ScheduledSessionPatch {
146200
return &b.patch
147201
}

0 commit comments

Comments
 (0)