@@ -35,10 +35,33 @@ func NewUsageService(opts ...option.RequestOption) (r *UsageService) {
35
35
return
36
36
}
37
37
38
- // Lists environment sessions within a specified date range.
38
+ // Lists completed environment sessions within a specified date range.
39
39
//
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
+ // ```
42
65
func (r * UsageService ) ListEnvironmentSessions (ctx context.Context , params UsageListEnvironmentSessionsParams , opts ... option.RequestOption ) (res * pagination.SessionsPage [EnvironmentSession ], err error ) {
43
66
var raw * http.Response
44
67
opts = append (r .Options [:], opts ... )
@@ -56,10 +79,33 @@ func (r *UsageService) ListEnvironmentSessions(ctx context.Context, params Usage
56
79
return res , nil
57
80
}
58
81
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
60
107
//
61
- // Returns a list of environment sessions that were active within the specified
62
- // date range.
108
+ // ```
63
109
func (r * UsageService ) ListEnvironmentSessionsAutoPaging (ctx context.Context , params UsageListEnvironmentSessionsParams , opts ... option.RequestOption ) * pagination.SessionsPageAutoPager [EnvironmentSession ] {
64
110
return pagination .NewSessionsPageAutoPager (r .ListEnvironmentSessions (ctx , params , opts ... ))
65
111
}
@@ -73,13 +119,13 @@ type EnvironmentSession struct {
73
119
EnvironmentClassID string `json:"environmentClassId"`
74
120
// Environment ID associated with the session.
75
121
EnvironmentID string `json:"environmentId"`
76
- // Project ID associated with the session.
122
+ // Project ID associated with the session (if available) .
77
123
ProjectID string `json:"projectId"`
78
124
// Runner ID associated with the session.
79
125
RunnerID string `json:"runnerId"`
80
126
// Time when the session was stopped.
81
127
StoppedAt time.Time `json:"stoppedAt" format:"date-time"`
82
- // User ID who created the session.
128
+ // User ID that created the session.
83
129
UserID string `json:"userId"`
84
130
JSON environmentSessionJSON `json:"-"`
85
131
}
0 commit comments