@@ -3371,6 +3371,131 @@ func (r *SecretsPageAutoPager[T]) Index() int {
33713371 return r .run
33723372}
33733373
3374+ type SecurityPoliciesPagePagination struct {
3375+ NextToken string `json:"nextToken"`
3376+ JSON securityPoliciesPagePaginationJSON `json:"-"`
3377+ }
3378+
3379+ // securityPoliciesPagePaginationJSON contains the JSON metadata for the struct
3380+ // [SecurityPoliciesPagePagination]
3381+ type securityPoliciesPagePaginationJSON struct {
3382+ NextToken apijson.Field
3383+ raw string
3384+ ExtraFields map [string ]apijson.Field
3385+ }
3386+
3387+ func (r * SecurityPoliciesPagePagination ) UnmarshalJSON (data []byte ) (err error ) {
3388+ return apijson .UnmarshalRoot (data , r )
3389+ }
3390+
3391+ func (r securityPoliciesPagePaginationJSON ) RawJSON () string {
3392+ return r .raw
3393+ }
3394+
3395+ type SecurityPoliciesPage [T any ] struct {
3396+ Pagination SecurityPoliciesPagePagination `json:"pagination"`
3397+ SecurityPolicies []T `json:"securityPolicies"`
3398+ JSON securityPoliciesPageJSON `json:"-"`
3399+ cfg * requestconfig.RequestConfig
3400+ res * http.Response
3401+ }
3402+
3403+ // securityPoliciesPageJSON contains the JSON metadata for the struct
3404+ // [SecurityPoliciesPage[T]]
3405+ type securityPoliciesPageJSON struct {
3406+ Pagination apijson.Field
3407+ SecurityPolicies apijson.Field
3408+ raw string
3409+ ExtraFields map [string ]apijson.Field
3410+ }
3411+
3412+ func (r * SecurityPoliciesPage [T ]) UnmarshalJSON (data []byte ) (err error ) {
3413+ return apijson .UnmarshalRoot (data , r )
3414+ }
3415+
3416+ func (r securityPoliciesPageJSON ) RawJSON () string {
3417+ return r .raw
3418+ }
3419+
3420+ // GetNextPage returns the next page as defined by this pagination style. When
3421+ // there is no next page, this function will return a 'nil' for the page value, but
3422+ // will not return an error
3423+ func (r * SecurityPoliciesPage [T ]) GetNextPage () (res * SecurityPoliciesPage [T ], err error ) {
3424+ if len (r .SecurityPolicies ) == 0 {
3425+ return nil , nil
3426+ }
3427+ next := r .Pagination .NextToken
3428+ if len (next ) == 0 {
3429+ return nil , nil
3430+ }
3431+ cfg := r .cfg .Clone (r .cfg .Context )
3432+ err = cfg .Apply (option .WithQuery ("token" , next ))
3433+ if err != nil {
3434+ return nil , err
3435+ }
3436+ var raw * http.Response
3437+ cfg .ResponseInto = & raw
3438+ cfg .ResponseBodyInto = & res
3439+ err = cfg .Execute ()
3440+ if err != nil {
3441+ return nil , err
3442+ }
3443+ res .SetPageConfig (cfg , raw )
3444+ return res , nil
3445+ }
3446+
3447+ func (r * SecurityPoliciesPage [T ]) SetPageConfig (cfg * requestconfig.RequestConfig , res * http.Response ) {
3448+ if r == nil {
3449+ r = & SecurityPoliciesPage [T ]{}
3450+ }
3451+ r .cfg = cfg
3452+ r .res = res
3453+ }
3454+
3455+ type SecurityPoliciesPageAutoPager [T any ] struct {
3456+ page * SecurityPoliciesPage [T ]
3457+ cur T
3458+ idx int
3459+ run int
3460+ err error
3461+ }
3462+
3463+ func NewSecurityPoliciesPageAutoPager [T any ](page * SecurityPoliciesPage [T ], err error ) * SecurityPoliciesPageAutoPager [T ] {
3464+ return & SecurityPoliciesPageAutoPager [T ]{
3465+ page : page ,
3466+ err : err ,
3467+ }
3468+ }
3469+
3470+ func (r * SecurityPoliciesPageAutoPager [T ]) Next () bool {
3471+ if r .page == nil || len (r .page .SecurityPolicies ) == 0 {
3472+ return false
3473+ }
3474+ if r .idx >= len (r .page .SecurityPolicies ) {
3475+ r .idx = 0
3476+ r .page , r .err = r .page .GetNextPage ()
3477+ if r .err != nil || r .page == nil || len (r .page .SecurityPolicies ) == 0 {
3478+ return false
3479+ }
3480+ }
3481+ r .cur = r .page .SecurityPolicies [r .idx ]
3482+ r .run += 1
3483+ r .idx += 1
3484+ return true
3485+ }
3486+
3487+ func (r * SecurityPoliciesPageAutoPager [T ]) Current () T {
3488+ return r .cur
3489+ }
3490+
3491+ func (r * SecurityPoliciesPageAutoPager [T ]) Err () error {
3492+ return r .err
3493+ }
3494+
3495+ func (r * SecurityPoliciesPageAutoPager [T ]) Index () int {
3496+ return r .run
3497+ }
3498+
33743499type ServicesPagePagination struct {
33753500 NextToken string `json:"nextToken"`
33763501 JSON servicesPagePaginationJSON `json:"-"`
0 commit comments