1
1
import { useCallback } from "react" ;
2
- import type { AxiosRequestConfig , AxiosResponse } from "axios" ;
3
2
import {
4
3
putApiV1ManagementTargetsResourcesConfigureService ,
5
4
putApiV1ManagementTargetsResourcesLink ,
@@ -8,8 +7,13 @@ import {
8
7
postApiV1ResourcesExpose ,
9
8
getApiV1ResourcesList ,
10
9
putApiV1ResourcesRemove ,
11
- GetApiV1ResourcesListResult ,
12
- GetApiV1ManagementTargetsResourcesListResult ,
10
+ putApiV1ManagementTargetsResourcesConfigureServiceResponse ,
11
+ putApiV1ManagementTargetsResourcesLinkResponse ,
12
+ getApiV1ManagementTargetsResourcesListResponse ,
13
+ putApiV1ManagementTargetsResourcesUnlinkResponse ,
14
+ postApiV1ResourcesExposeResponse ,
15
+ getApiV1ResourcesListResponse ,
16
+ putApiV1ResourcesRemoveResponse
13
17
} from "../../api/wanaku-router-api" ;
14
18
import {
15
19
PutApiV1ManagementTargetsResourcesConfigureServiceParams ,
@@ -27,8 +31,8 @@ export const useResources = () => {
27
31
(
28
32
service : string ,
29
33
params ?: PutApiV1ManagementTargetsResourcesConfigureServiceParams ,
30
- options ?: AxiosRequestConfig
31
- ) : Promise < AxiosResponse < void > > => {
34
+ options ?: RequestInit
35
+ ) : Promise < putApiV1ManagementTargetsResourcesConfigureServiceResponse > => {
32
36
return putApiV1ManagementTargetsResourcesConfigureService ( service , params , options ) ;
33
37
} ,
34
38
[ ]
@@ -40,8 +44,8 @@ export const useResources = () => {
40
44
const linkResource = useCallback (
41
45
(
42
46
params ?: PutApiV1ManagementTargetsResourcesLinkParams ,
43
- options ?: AxiosRequestConfig
44
- ) : Promise < AxiosResponse < void > > => {
47
+ options ?: RequestInit
48
+ ) : Promise < putApiV1ManagementTargetsResourcesLinkResponse > => {
45
49
return putApiV1ManagementTargetsResourcesLink ( params , options ) ;
46
50
} ,
47
51
[ ]
@@ -52,8 +56,8 @@ export const useResources = () => {
52
56
*/
53
57
const listManagementResources = useCallback (
54
58
(
55
- options ?: AxiosRequestConfig
56
- ) : Promise < GetApiV1ManagementTargetsResourcesListResult > => {
59
+ options ?: RequestInit
60
+ ) : Promise < getApiV1ManagementTargetsResourcesListResponse > => {
57
61
return getApiV1ManagementTargetsResourcesList ( options ) ;
58
62
} ,
59
63
[ ]
@@ -65,8 +69,8 @@ export const useResources = () => {
65
69
const unlinkResource = useCallback (
66
70
(
67
71
params ?: PutApiV1ManagementTargetsResourcesUnlinkParams ,
68
- options ?: AxiosRequestConfig
69
- ) : Promise < AxiosResponse < void > > => {
72
+ options ?: RequestInit
73
+ ) : Promise < putApiV1ManagementTargetsResourcesUnlinkResponse > => {
70
74
return putApiV1ManagementTargetsResourcesUnlink ( params , options ) ;
71
75
} ,
72
76
[ ]
@@ -78,8 +82,8 @@ export const useResources = () => {
78
82
const exposeResource = useCallback (
79
83
(
80
84
resourceReference : ResourceReference , // Define the proper type from your models if available.
81
- options ?: AxiosRequestConfig
82
- ) : Promise < AxiosResponse < void > > => {
85
+ options ?: RequestInit
86
+ ) : Promise < postApiV1ResourcesExposeResponse > => {
83
87
return postApiV1ResourcesExpose ( resourceReference , options ) ;
84
88
} ,
85
89
[ ]
@@ -90,8 +94,8 @@ export const useResources = () => {
90
94
*/
91
95
const listResources = useCallback (
92
96
(
93
- options ?: AxiosRequestConfig
94
- ) : Promise < GetApiV1ResourcesListResult > => {
97
+ options ?: RequestInit
98
+ ) : Promise < getApiV1ResourcesListResponse > => {
95
99
return getApiV1ResourcesList ( options ) ;
96
100
} ,
97
101
[ ]
@@ -103,8 +107,8 @@ export const useResources = () => {
103
107
const removeResource = useCallback (
104
108
(
105
109
params ?: PutApiV1ResourcesRemoveParams , // Replace with the actual type if available from models.
106
- options ?: AxiosRequestConfig
107
- ) : Promise < AxiosResponse < void > > => {
110
+ options ?: RequestInit
111
+ ) : Promise < putApiV1ResourcesRemoveResponse > => {
108
112
return putApiV1ResourcesRemove ( params , options ) ;
109
113
} ,
110
114
[ ]
0 commit comments