@@ -75,15 +75,33 @@ func (r *FineTuningCheckpointPermissionService) NewAutoPaging(ctx context.Contex
7575//
7676// Organization owners can use this endpoint to view all permissions for a
7777// fine-tuned model checkpoint.
78- func (r * FineTuningCheckpointPermissionService ) Get (ctx context.Context , fineTunedModelCheckpoint string , query FineTuningCheckpointPermissionGetParams , opts ... option.RequestOption ) (res * FineTuningCheckpointPermissionGetResponse , err error ) {
78+ func (r * FineTuningCheckpointPermissionService ) Get (ctx context.Context , fineTunedModelCheckpoint string , query FineTuningCheckpointPermissionGetParams , opts ... option.RequestOption ) (res * pagination.CursorPage [FineTuningCheckpointPermissionGetResponse ], err error ) {
79+ var raw * http.Response
7980 opts = append (r .Options [:], opts ... )
81+ opts = append ([]option.RequestOption {option .WithResponseInto (& raw )}, opts ... )
8082 if fineTunedModelCheckpoint == "" {
8183 err = errors .New ("missing required fine_tuned_model_checkpoint parameter" )
8284 return
8385 }
8486 path := fmt .Sprintf ("fine_tuning/checkpoints/%s/permissions" , fineTunedModelCheckpoint )
85- err = requestconfig .ExecuteNewRequest (ctx , http .MethodGet , path , query , & res , opts ... )
86- return
87+ cfg , err := requestconfig .NewRequestConfig (ctx , http .MethodGet , path , query , & res , opts ... )
88+ if err != nil {
89+ return nil , err
90+ }
91+ err = cfg .Execute ()
92+ if err != nil {
93+ return nil , err
94+ }
95+ res .SetPageConfig (cfg , raw )
96+ return res , nil
97+ }
98+
99+ // **NOTE:** This endpoint requires an [admin API key](../admin-api-keys).
100+ //
101+ // Organization owners can use this endpoint to view all permissions for a
102+ // fine-tuned model checkpoint.
103+ func (r * FineTuningCheckpointPermissionService ) GetAutoPaging (ctx context.Context , fineTunedModelCheckpoint string , query FineTuningCheckpointPermissionGetParams , opts ... option.RequestOption ) * pagination.CursorPageAutoPager [FineTuningCheckpointPermissionGetResponse ] {
104+ return pagination .NewCursorPageAutoPager (r .Get (ctx , fineTunedModelCheckpoint , query , opts ... ))
87105}
88106
89107// **NOTE:** This endpoint requires an [admin API key](../admin-api-keys).
@@ -133,33 +151,9 @@ func (r *FineTuningCheckpointPermissionNewResponse) UnmarshalJSON(data []byte) e
133151 return apijson .UnmarshalRoot (data , r )
134152}
135153
136- type FineTuningCheckpointPermissionGetResponse struct {
137- Data []FineTuningCheckpointPermissionGetResponseData `json:"data,required"`
138- HasMore bool `json:"has_more,required"`
139- Object constant.List `json:"object,required"`
140- FirstID string `json:"first_id,nullable"`
141- LastID string `json:"last_id,nullable"`
142- // JSON contains metadata for fields, check presence with [respjson.Field.Valid].
143- JSON struct {
144- Data respjson.Field
145- HasMore respjson.Field
146- Object respjson.Field
147- FirstID respjson.Field
148- LastID respjson.Field
149- ExtraFields map [string ]respjson.Field
150- raw string
151- } `json:"-"`
152- }
153-
154- // Returns the unmodified JSON received from the API
155- func (r FineTuningCheckpointPermissionGetResponse ) RawJSON () string { return r .JSON .raw }
156- func (r * FineTuningCheckpointPermissionGetResponse ) UnmarshalJSON (data []byte ) error {
157- return apijson .UnmarshalRoot (data , r )
158- }
159-
160154// The `checkpoint.permission` object represents a permission for a fine-tuned
161155// model checkpoint.
162- type FineTuningCheckpointPermissionGetResponseData struct {
156+ type FineTuningCheckpointPermissionGetResponse struct {
163157 // The permission identifier, which can be referenced in the API endpoints.
164158 ID string `json:"id,required"`
165159 // The Unix timestamp (in seconds) for when the permission was created.
@@ -180,8 +174,8 @@ type FineTuningCheckpointPermissionGetResponseData struct {
180174}
181175
182176// Returns the unmodified JSON received from the API
183- func (r FineTuningCheckpointPermissionGetResponseData ) RawJSON () string { return r .JSON .raw }
184- func (r * FineTuningCheckpointPermissionGetResponseData ) UnmarshalJSON (data []byte ) error {
177+ func (r FineTuningCheckpointPermissionGetResponse ) RawJSON () string { return r .JSON .raw }
178+ func (r * FineTuningCheckpointPermissionGetResponse ) UnmarshalJSON (data []byte ) error {
185179 return apijson .UnmarshalRoot (data , r )
186180}
187181
0 commit comments