From cf52a9c6c3d49cf10adb8a6536f69576f099adb9 Mon Sep 17 00:00:00 2001 From: Daniel Date: Wed, 14 Feb 2024 16:10:42 +0100 Subject: [PATCH] pagination --- matsen-tool/openapi.yaml | 75 +++++++++++++++++++ .../app/core/api/v1/api/contact.service.ts | 13 +++- .../core/api/v1/api/mediaObject.service.ts | 13 +++- .../app/core/api/v1/api/partner.service.ts | 13 +++- .../src/app/core/api/v1/api/post.service.ts | 13 +++- .../src/app/core/api/v1/api/user.service.ts | 13 +++- 6 files changed, 120 insertions(+), 20 deletions(-) diff --git a/matsen-tool/openapi.yaml b/matsen-tool/openapi.yaml index 3e9679d..8f78e07 100644 --- a/matsen-tool/openapi.yaml +++ b/matsen-tool/openapi.yaml @@ -64,6 +64,21 @@ paths: style: form explode: false allowReserved: false + - + name: itemsPerPage + in: query + description: 'The number of items per page' + required: false + deprecated: false + allowEmptyValue: true + schema: + type: integer + default: 10 + minimum: 0 + maximum: 50 + style: form + explode: false + allowReserved: false - name: partner in: query @@ -308,6 +323,21 @@ paths: style: form explode: false allowReserved: false + - + name: itemsPerPage + in: query + description: 'The number of items per page' + required: false + deprecated: false + allowEmptyValue: true + schema: + type: integer + default: 10 + minimum: 0 + maximum: 50 + style: form + explode: false + allowReserved: false deprecated: false post: operationId: api_media_objects_post @@ -446,6 +476,21 @@ paths: style: form explode: false allowReserved: false + - + name: itemsPerPage + in: query + description: 'The number of items per page' + required: false + deprecated: false + allowEmptyValue: true + schema: + type: integer + default: 10 + minimum: 0 + maximum: 50 + style: form + explode: false + allowReserved: false - name: type in: query @@ -735,6 +780,21 @@ paths: style: form explode: false allowReserved: false + - + name: itemsPerPage + in: query + description: 'The number of items per page' + required: false + deprecated: false + allowEmptyValue: true + schema: + type: integer + default: 10 + minimum: 0 + maximum: 50 + style: form + explode: false + allowReserved: false deprecated: false post: operationId: api_posts_post @@ -953,6 +1013,21 @@ paths: style: form explode: false allowReserved: false + - + name: itemsPerPage + in: query + description: 'The number of items per page' + required: false + deprecated: false + allowEmptyValue: true + schema: + type: integer + default: 10 + minimum: 0 + maximum: 50 + style: form + explode: false + allowReserved: false deprecated: false post: operationId: api_users_post diff --git a/matsen-tool/src/app/core/api/v1/api/contact.service.ts b/matsen-tool/src/app/core/api/v1/api/contact.service.ts index 48acbd0..914db0c 100644 --- a/matsen-tool/src/app/core/api/v1/api/contact.service.ts +++ b/matsen-tool/src/app/core/api/v1/api/contact.service.ts @@ -103,21 +103,26 @@ export class ContactService { * Retrieves the collection of Contact resources. * Retrieves the collection of Contact resources. * @param page The collection page number + * @param itemsPerPage The number of items per page * @param partner * @param partner2 * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public contactsGetCollection(page?: number, partner?: string, partner2?: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext}): Observable; - public contactsGetCollection(page?: number, partner?: string, partner2?: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext}): Observable>; - public contactsGetCollection(page?: number, partner?: string, partner2?: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext}): Observable>; - public contactsGetCollection(page?: number, partner?: string, partner2?: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext}): Observable { + public contactsGetCollection(page?: number, itemsPerPage?: number, partner?: string, partner2?: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext}): Observable; + public contactsGetCollection(page?: number, itemsPerPage?: number, partner?: string, partner2?: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext}): Observable>; + public contactsGetCollection(page?: number, itemsPerPage?: number, partner?: string, partner2?: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext}): Observable>; + public contactsGetCollection(page?: number, itemsPerPage?: number, partner?: string, partner2?: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext}): Observable { let localVarQueryParameters = new HttpParams({encoder: this.encoder}); if (page !== undefined && page !== null) { localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, page, 'page'); } + if (itemsPerPage !== undefined && itemsPerPage !== null) { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + itemsPerPage, 'itemsPerPage'); + } if (partner !== undefined && partner !== null) { localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, partner, 'partner'); diff --git a/matsen-tool/src/app/core/api/v1/api/mediaObject.service.ts b/matsen-tool/src/app/core/api/v1/api/mediaObject.service.ts index 0257530..9b0cbf8 100644 --- a/matsen-tool/src/app/core/api/v1/api/mediaObject.service.ts +++ b/matsen-tool/src/app/core/api/v1/api/mediaObject.service.ts @@ -116,19 +116,24 @@ export class MediaObjectService { * Retrieves the collection of MediaObject resources. * Retrieves the collection of MediaObject resources. * @param page The collection page number + * @param itemsPerPage The number of items per page * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public mediaObjectsGetCollection(page?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext}): Observable; - public mediaObjectsGetCollection(page?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext}): Observable>; - public mediaObjectsGetCollection(page?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext}): Observable>; - public mediaObjectsGetCollection(page?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext}): Observable { + public mediaObjectsGetCollection(page?: number, itemsPerPage?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext}): Observable; + public mediaObjectsGetCollection(page?: number, itemsPerPage?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext}): Observable>; + public mediaObjectsGetCollection(page?: number, itemsPerPage?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext}): Observable>; + public mediaObjectsGetCollection(page?: number, itemsPerPage?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext}): Observable { let localVarQueryParameters = new HttpParams({encoder: this.encoder}); if (page !== undefined && page !== null) { localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, page, 'page'); } + if (itemsPerPage !== undefined && itemsPerPage !== null) { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + itemsPerPage, 'itemsPerPage'); + } let localVarHeaders = this.defaultHeaders; diff --git a/matsen-tool/src/app/core/api/v1/api/partner.service.ts b/matsen-tool/src/app/core/api/v1/api/partner.service.ts index 47e1108..e575786 100644 --- a/matsen-tool/src/app/core/api/v1/api/partner.service.ts +++ b/matsen-tool/src/app/core/api/v1/api/partner.service.ts @@ -103,6 +103,7 @@ export class PartnerService { * Retrieves the collection of Partner resources. * Retrieves the collection of Partner resources. * @param page The collection page number + * @param itemsPerPage The number of items per page * @param type * @param type2 * @param orderName @@ -111,16 +112,20 @@ export class PartnerService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public partnersGetCollection(page?: number, type?: string, type2?: Array, orderName?: 'asc' | 'desc', orderCity?: 'asc' | 'desc', orderWebsite?: 'asc' | 'desc', observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext}): Observable; - public partnersGetCollection(page?: number, type?: string, type2?: Array, orderName?: 'asc' | 'desc', orderCity?: 'asc' | 'desc', orderWebsite?: 'asc' | 'desc', observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext}): Observable>; - public partnersGetCollection(page?: number, type?: string, type2?: Array, orderName?: 'asc' | 'desc', orderCity?: 'asc' | 'desc', orderWebsite?: 'asc' | 'desc', observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext}): Observable>; - public partnersGetCollection(page?: number, type?: string, type2?: Array, orderName?: 'asc' | 'desc', orderCity?: 'asc' | 'desc', orderWebsite?: 'asc' | 'desc', observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext}): Observable { + public partnersGetCollection(page?: number, itemsPerPage?: number, type?: string, type2?: Array, orderName?: 'asc' | 'desc', orderCity?: 'asc' | 'desc', orderWebsite?: 'asc' | 'desc', observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext}): Observable; + public partnersGetCollection(page?: number, itemsPerPage?: number, type?: string, type2?: Array, orderName?: 'asc' | 'desc', orderCity?: 'asc' | 'desc', orderWebsite?: 'asc' | 'desc', observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext}): Observable>; + public partnersGetCollection(page?: number, itemsPerPage?: number, type?: string, type2?: Array, orderName?: 'asc' | 'desc', orderCity?: 'asc' | 'desc', orderWebsite?: 'asc' | 'desc', observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext}): Observable>; + public partnersGetCollection(page?: number, itemsPerPage?: number, type?: string, type2?: Array, orderName?: 'asc' | 'desc', orderCity?: 'asc' | 'desc', orderWebsite?: 'asc' | 'desc', observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext}): Observable { let localVarQueryParameters = new HttpParams({encoder: this.encoder}); if (page !== undefined && page !== null) { localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, page, 'page'); } + if (itemsPerPage !== undefined && itemsPerPage !== null) { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + itemsPerPage, 'itemsPerPage'); + } if (type !== undefined && type !== null) { localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, type, 'type'); diff --git a/matsen-tool/src/app/core/api/v1/api/post.service.ts b/matsen-tool/src/app/core/api/v1/api/post.service.ts index b9db106..82a1826 100644 --- a/matsen-tool/src/app/core/api/v1/api/post.service.ts +++ b/matsen-tool/src/app/core/api/v1/api/post.service.ts @@ -103,19 +103,24 @@ export class PostService { * Retrieves the collection of Post resources. * Retrieves the collection of Post resources. * @param page The collection page number + * @param itemsPerPage The number of items per page * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public postsGetCollection(page?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext}): Observable; - public postsGetCollection(page?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext}): Observable>; - public postsGetCollection(page?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext}): Observable>; - public postsGetCollection(page?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext}): Observable { + public postsGetCollection(page?: number, itemsPerPage?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext}): Observable; + public postsGetCollection(page?: number, itemsPerPage?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext}): Observable>; + public postsGetCollection(page?: number, itemsPerPage?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext}): Observable>; + public postsGetCollection(page?: number, itemsPerPage?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext}): Observable { let localVarQueryParameters = new HttpParams({encoder: this.encoder}); if (page !== undefined && page !== null) { localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, page, 'page'); } + if (itemsPerPage !== undefined && itemsPerPage !== null) { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + itemsPerPage, 'itemsPerPage'); + } let localVarHeaders = this.defaultHeaders; diff --git a/matsen-tool/src/app/core/api/v1/api/user.service.ts b/matsen-tool/src/app/core/api/v1/api/user.service.ts index de18c8b..d1798df 100644 --- a/matsen-tool/src/app/core/api/v1/api/user.service.ts +++ b/matsen-tool/src/app/core/api/v1/api/user.service.ts @@ -103,19 +103,24 @@ export class UserService { * Retrieves the collection of User resources. * Retrieves the collection of User resources. * @param page The collection page number + * @param itemsPerPage The number of items per page * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public usersGetCollection(page?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext}): Observable; - public usersGetCollection(page?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext}): Observable>; - public usersGetCollection(page?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext}): Observable>; - public usersGetCollection(page?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext}): Observable { + public usersGetCollection(page?: number, itemsPerPage?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext}): Observable; + public usersGetCollection(page?: number, itemsPerPage?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext}): Observable>; + public usersGetCollection(page?: number, itemsPerPage?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext}): Observable>; + public usersGetCollection(page?: number, itemsPerPage?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext}): Observable { let localVarQueryParameters = new HttpParams({encoder: this.encoder}); if (page !== undefined && page !== null) { localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, page, 'page'); } + if (itemsPerPage !== undefined && itemsPerPage !== null) { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + itemsPerPage, 'itemsPerPage'); + } let localVarHeaders = this.defaultHeaders;