22
33import { APIResource } from '../core/resource' ;
44import * as Shared from './shared' ;
5- import { APIPromise } from '../core/api-promise ' ;
5+ import { OffsetPagination , type OffsetPaginationParams , PagePromise } from '../core/pagination ' ;
66import { RequestOptions } from '../internal/request-options' ;
77
88export class Apps extends APIResource {
99 /**
1010 * List applications. Optionally filter by app name and/or version label.
1111 */
12- list ( query : AppListParams | null | undefined = { } , options ?: RequestOptions ) : APIPromise < AppListResponse > {
13- return this . _client . get ( '/apps' , { query, ...options } ) ;
12+ list (
13+ query : AppListParams | null | undefined = { } ,
14+ options ?: RequestOptions ,
15+ ) : PagePromise < AppListResponsesOffsetPagination , AppListResponse > {
16+ return this . _client . getAPIList ( '/apps' , OffsetPagination < AppListResponse > , { query, ...options } ) ;
1417 }
1518}
1619
17- export type AppListResponse = Array < AppListResponse . AppListResponseItem > ;
20+ export type AppListResponsesOffsetPagination = OffsetPagination < AppListResponse > ;
1821
19- export namespace AppListResponse {
22+ /**
23+ * Summary of an application version.
24+ */
25+ export interface AppListResponse {
2026 /**
21- * Summary of an application version.
27+ * Unique identifier for the app version
2228 */
23- export interface AppListResponseItem {
24- /**
25- * Unique identifier for the app version
26- */
27- id : string ;
29+ id : string ;
2830
29- /**
30- * List of actions available on the app
31- */
32- actions : Array < Shared . AppAction > ;
31+ /**
32+ * List of actions available on the app
33+ */
34+ actions : Array < Shared . AppAction > ;
3335
34- /**
35- * Name of the application
36- */
37- app_name : string ;
36+ /**
37+ * Name of the application
38+ */
39+ app_name : string ;
3840
39- /**
40- * Deployment ID
41- */
42- deployment : string ;
41+ /**
42+ * Deployment ID
43+ */
44+ deployment : string ;
4345
44- /**
45- * Environment variables configured for this app version
46- */
47- env_vars : { [ key : string ] : string } ;
46+ /**
47+ * Environment variables configured for this app version
48+ */
49+ env_vars : { [ key : string ] : string } ;
4850
49- /**
50- * Deployment region code
51- */
52- region : 'aws.us-east-1a' ;
51+ /**
52+ * Deployment region code
53+ */
54+ region : 'aws.us-east-1a' ;
5355
54- /**
55- * Version label for the application
56- */
57- version : string ;
58- }
56+ /**
57+ * Version label for the application
58+ */
59+ version : string ;
5960}
6061
61- export interface AppListParams {
62+ export interface AppListParams extends OffsetPaginationParams {
6263 /**
6364 * Filter results by application name.
6465 */
@@ -71,5 +72,9 @@ export interface AppListParams {
7172}
7273
7374export declare namespace Apps {
74- export { type AppListResponse as AppListResponse , type AppListParams as AppListParams } ;
75+ export {
76+ type AppListResponse as AppListResponse ,
77+ type AppListResponsesOffsetPagination as AppListResponsesOffsetPagination ,
78+ type AppListParams as AppListParams ,
79+ } ;
7580}
0 commit comments