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 11configured_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 {
109109}
110110
111111type 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
116117}
117118
118119// cursorPageJSON contains the JSON metadata for the struct [CursorPage[T]]
119120type cursorPageJSON struct {
120121 Data apijson.Field
122+ HasMore apijson.Field
121123 raw string
122124 ExtraFields map [string ]apijson.Field
123125}
@@ -134,6 +136,9 @@ func (r cursorPageJSON) RawJSON() string {
134136// there is no next page, this function will return a 'nil' for the page value, but
135137// will not return an error
136138func (r * CursorPage [T ]) GetNextPage () (res * CursorPage [T ], err error ) {
139+ if ! r .JSON .HasMore .IsMissing () && r .HasMore == false {
140+ return nil , nil
141+ }
137142 items := r .Data
138143 if items == nil || len (items ) == 0 {
139144 return nil , nil
You can’t perform that action at this time.
0 commit comments