22
33import { APIResource } from '../core/resource' ;
44import * as BrowsersAPI from './browsers/browsers' ;
5+ import { ProfilesOffsetPagination } from './browsers/browsers' ;
56import { APIPromise } from '../core/api-promise' ;
7+ import { OffsetPagination , type OffsetPaginationParams , PagePromise } from '../core/pagination' ;
68import { buildHeaders } from '../internal/headers' ;
79import { RequestOptions } from '../internal/request-options' ;
810import { path } from '../internal/utils/path' ;
@@ -26,8 +28,11 @@ export class Profiles extends APIResource {
2628 /**
2729 * List profiles with optional filtering and pagination.
2830 */
29- list ( options ?: RequestOptions ) : APIPromise < ProfileListResponse > {
30- return this . _client . get ( '/profiles' , options ) ;
31+ list (
32+ query : ProfileListParams | null | undefined = { } ,
33+ options ?: RequestOptions ,
34+ ) : PagePromise < ProfilesOffsetPagination , BrowsersAPI . Profile > {
35+ return this . _client . getAPIList ( '/profiles' , OffsetPagination < BrowsersAPI . Profile > , { query, ...options } ) ;
3136 }
3237
3338 /**
@@ -53,15 +58,22 @@ export class Profiles extends APIResource {
5358 }
5459}
5560
56- export type ProfileListResponse = Array < BrowsersAPI . Profile > ;
57-
5861export interface ProfileCreateParams {
5962 /**
6063 * Optional name of the profile. Must be unique within the organization.
6164 */
6265 name ?: string ;
6366}
6467
68+ export interface ProfileListParams extends OffsetPaginationParams {
69+ /**
70+ * Search profiles by name or ID.
71+ */
72+ query ?: string ;
73+ }
74+
6575export declare namespace Profiles {
66- export { type ProfileListResponse as ProfileListResponse , type ProfileCreateParams as ProfileCreateParams } ;
76+ export { type ProfileCreateParams as ProfileCreateParams , type ProfileListParams as ProfileListParams } ;
6777}
78+
79+ export { type ProfilesOffsetPagination } ;
0 commit comments