File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change 1
1
configured_endpoints : 68
2
- openapi_spec_url : https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-7c699d4503077d06a4a44f52c0c1f902d19a87c766b8be75b97c8dfd484ad4aa .yml
2
+ openapi_spec_url : https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-dfb00c627f58e5180af7a9b29ed2f2aa0764a3b9daa6a32a1cc45bc8e48dfe15 .yml
Original file line number Diff line number Diff line change @@ -109,15 +109,17 @@ func (r *PageAutoPager[T]) Index() int {
109
109
}
110
110
111
111
type CursorPage [T any ] struct {
112
- Data []T `json:"data"`
113
- JSON cursorPageJSON `json:"-"`
114
- cfg * requestconfig.RequestConfig
115
- res * http.Response
112
+ Data []T `json:"data"`
113
+ HasMore bool `json:"has_more"`
114
+ JSON cursorPageJSON `json:"-"`
115
+ cfg * requestconfig.RequestConfig
116
+ res * http.Response
116
117
}
117
118
118
119
// cursorPageJSON contains the JSON metadata for the struct [CursorPage[T]]
119
120
type cursorPageJSON struct {
120
121
Data apijson.Field
122
+ HasMore apijson.Field
121
123
raw string
122
124
ExtraFields map [string ]apijson.Field
123
125
}
@@ -134,6 +136,9 @@ func (r cursorPageJSON) RawJSON() string {
134
136
// there is no next page, this function will return a 'nil' for the page value, but
135
137
// will not return an error
136
138
func (r * CursorPage [T ]) GetNextPage () (res * CursorPage [T ], err error ) {
139
+ if ! r .JSON .HasMore .IsMissing () && r .HasMore == false {
140
+ return nil , nil
141
+ }
137
142
items := r .Data
138
143
if items == nil || len (items ) == 0 {
139
144
return nil , nil
You can’t perform that action at this time.
0 commit comments