1616 * along with MyCoRe. If not, see <http://www.gnu.org/licenses/>.
1717 */
1818
19- import { HttpClient , HttpResponse } from '../../common/client' ;
20- import {
21- AccessKey ,
22- CreateAccessKeyDto ,
23- UpdateAccessKeyDto ,
24- PartialUpdateAccessKeyDto ,
25- AccessKeySummary ,
26- } from './model' ;
19+ import { HttpClient , HttpResponse } from '../../utils/client' ;
20+ import { AccessKeyDto } from './dtos/access-key.dto' ;
21+ import { CreateAccessKeyDto } from './dtos/create-access-key.dto' ;
22+ import { UpdateAccessKeyDto } from './dtos/update-access-key.dto' ;
23+ import { PartialUpdateAccessKeyDto } from './dtos/partial-update-access-key.dto' ;
24+ import { AccessKeysSummary } from './dtos/access-keys-summary.dto' ;
2725
2826/**
2927 * Extracts the response data and returns the access key summary.
3028 * @param response - The response object containing the data and headers.
3129 * @returns The parsed access keys summary.
3230 */
3331const createSummary = (
34- response : HttpResponse < AccessKey [ ] >
35- ) : AccessKeySummary => {
32+ response : HttpResponse < AccessKeyDto [ ] >
33+ ) : AccessKeysSummary => {
3634 const totalCount = response . headers [ 'x-total-count' ] ;
3735 return {
3836 accessKeys : response . data ,
@@ -91,7 +89,7 @@ export class AccessKeyService {
9189 */
9290 public async getAccessKeys (
9391 options ?: GetAccessKeysOptions
94- ) : Promise < AccessKeySummary > {
92+ ) : Promise < AccessKeysSummary > {
9593 const searchParams = new URLSearchParams ( ) ;
9694 if ( options ?. reference ) {
9795 searchParams . set ( 'reference' , options . reference ) ;
@@ -107,7 +105,7 @@ export class AccessKeyService {
107105 }
108106 try {
109107 return createSummary (
110- await this . client . get < AccessKey [ ] > (
108+ await this . client . get < AccessKeyDto [ ] > (
111109 `${ API_URL } ?${ searchParams . toString ( ) } `
112110 )
113111 ) ;
@@ -121,9 +119,9 @@ export class AccessKeyService {
121119 * @param id - The ID of the access key.
122120 * @returns A promise that resolves with the access key data.
123121 */
124- public async getAccessKey ( id : string ) : Promise < AccessKey > {
122+ public async getAccessKey ( id : string ) : Promise < AccessKeyDto > {
125123 try {
126- return ( await this . client . get < AccessKey > ( `${ API_URL } /${ id } ` ) ) . data ;
124+ return ( await this . client . get < AccessKeyDto > ( `${ API_URL } /${ id } ` ) ) . data ;
127125 } catch ( error ) {
128126 throw new Error ( `Failed to get access key: ${ ( error as Error ) . message } ` ) ;
129127 }
0 commit comments