@@ -35,10 +35,33 @@ func NewUsageService(opts ...option.RequestOption) (r *UsageService) {
3535 return
3636}
3737
38- // Lists environment sessions within a specified date range.
38+ // Lists completed environment sessions within a specified date range.
3939//
40- // Returns a list of environment sessions that were active within the specified
41- // date range.
40+ // Returns a list of environment sessions that were completed within the specified
41+ // date range. Currently running sessions are not included.
42+ //
43+ // Use this method to:
44+ //
45+ // - View environment sessions
46+ // - Filter by project
47+ // - Monitor session activity
48+ // - Create custom usage reports
49+ //
50+ // ### Example
51+ //
52+ // ```yaml
53+ // filter:
54+ //
55+ // projectId: "d2c94c27-3b76-4a42-b88c-95a85e392c68"
56+ // dateRange:
57+ // startTime: "2024-01-01T00:00:00Z"
58+ // endTime: "2024-01-02T00:00:00Z"
59+ //
60+ // pagination:
61+ //
62+ // pageSize: 100
63+ //
64+ // ```
4265func (r * UsageService ) ListEnvironmentSessions (ctx context.Context , params UsageListEnvironmentSessionsParams , opts ... option.RequestOption ) (res * pagination.SessionsPage [EnvironmentSession ], err error ) {
4366 var raw * http.Response
4467 opts = append (r .Options [:], opts ... )
@@ -56,10 +79,33 @@ func (r *UsageService) ListEnvironmentSessions(ctx context.Context, params Usage
5679 return res , nil
5780}
5881
59- // Lists environment sessions within a specified date range.
82+ // Lists completed environment sessions within a specified date range.
83+ //
84+ // Returns a list of environment sessions that were completed within the specified
85+ // date range. Currently running sessions are not included.
86+ //
87+ // Use this method to:
88+ //
89+ // - View environment sessions
90+ // - Filter by project
91+ // - Monitor session activity
92+ // - Create custom usage reports
93+ //
94+ // ### Example
95+ //
96+ // ```yaml
97+ // filter:
98+ //
99+ // projectId: "d2c94c27-3b76-4a42-b88c-95a85e392c68"
100+ // dateRange:
101+ // startTime: "2024-01-01T00:00:00Z"
102+ // endTime: "2024-01-02T00:00:00Z"
103+ //
104+ // pagination:
105+ //
106+ // pageSize: 100
60107//
61- // Returns a list of environment sessions that were active within the specified
62- // date range.
108+ // ```
63109func (r * UsageService ) ListEnvironmentSessionsAutoPaging (ctx context.Context , params UsageListEnvironmentSessionsParams , opts ... option.RequestOption ) * pagination.SessionsPageAutoPager [EnvironmentSession ] {
64110 return pagination .NewSessionsPageAutoPager (r .ListEnvironmentSessions (ctx , params , opts ... ))
65111}
@@ -73,13 +119,13 @@ type EnvironmentSession struct {
73119 EnvironmentClassID string `json:"environmentClassId"`
74120 // Environment ID associated with the session.
75121 EnvironmentID string `json:"environmentId"`
76- // Project ID associated with the session.
122+ // Project ID associated with the session (if available) .
77123 ProjectID string `json:"projectId"`
78124 // Runner ID associated with the session.
79125 RunnerID string `json:"runnerId"`
80126 // Time when the session was stopped.
81127 StoppedAt time.Time `json:"stoppedAt" format:"date-time"`
82- // User ID who created the session.
128+ // User ID that created the session.
83129 UserID string `json:"userId"`
84130 JSON environmentSessionJSON `json:"-"`
85131}
0 commit comments