2
2
3
3
import { APIResource } from '../../../resource' ;
4
4
import * as Core from '../../../core' ;
5
- import * as DiscoveryAPI from './discovery' ;
6
- import { DiscoveryOperationsV4PagePaginationArray } from './discovery' ;
7
- import { type V4PagePaginationArrayParams } from '../../../pagination' ;
5
+ import { V4PagePaginationArray , type V4PagePaginationArrayParams } from '../../../pagination' ;
8
6
9
7
export class Operations extends APIResource {
10
8
/**
@@ -13,11 +11,11 @@ export class Operations extends APIResource {
13
11
list (
14
12
params : OperationListParams ,
15
13
options ?: Core . RequestOptions ,
16
- ) : Core . PagePromise < DiscoveryOperationsV4PagePaginationArray , DiscoveryAPI . DiscoveryOperation > {
14
+ ) : Core . PagePromise < OperationListResponsesV4PagePaginationArray , OperationListResponse > {
17
15
const { zone_id, ...query } = params ;
18
16
return this . _client . getAPIList (
19
17
`/zones/${ zone_id } /api_gateway/discovery/operations` ,
20
- DiscoveryOperationsV4PagePaginationArray ,
18
+ OperationListResponsesV4PagePaginationArray ,
21
19
{ query, ...options } ,
22
20
) ;
23
21
}
@@ -56,6 +54,73 @@ export class Operations extends APIResource {
56
54
}
57
55
}
58
56
57
+ export class OperationListResponsesV4PagePaginationArray extends V4PagePaginationArray < OperationListResponse > { }
58
+
59
+ export interface OperationListResponse {
60
+ /**
61
+ * UUID
62
+ */
63
+ id : string ;
64
+
65
+ /**
66
+ * The endpoint which can contain path parameter templates in curly braces, each
67
+ * will be replaced from left to right with {varN}, starting with {var1}, during
68
+ * insertion. This will further be Cloudflare-normalized upon insertion. See:
69
+ * https://developers.cloudflare.com/rules/normalization/how-it-works/.
70
+ */
71
+ endpoint : string ;
72
+
73
+ /**
74
+ * RFC3986-compliant host.
75
+ */
76
+ host : string ;
77
+
78
+ last_updated : string ;
79
+
80
+ /**
81
+ * The HTTP method used to access the endpoint.
82
+ */
83
+ method : 'GET' | 'POST' | 'HEAD' | 'OPTIONS' | 'PUT' | 'DELETE' | 'CONNECT' | 'PATCH' | 'TRACE' ;
84
+
85
+ /**
86
+ * API discovery engine(s) that discovered this operation
87
+ */
88
+ origin : Array < 'ML' | 'SessionIdentifier' > ;
89
+
90
+ /**
91
+ * State of operation in API Discovery
92
+ *
93
+ * - `review` - Operation is not saved into API Shield Endpoint Management
94
+ * - `saved` - Operation is saved into API Shield Endpoint Management
95
+ * - `ignored` - Operation is marked as ignored
96
+ */
97
+ state : 'review' | 'saved' | 'ignored' ;
98
+
99
+ features ?: OperationListResponse . Features ;
100
+ }
101
+
102
+ export namespace OperationListResponse {
103
+ export interface Features {
104
+ traffic_stats ?: Features . TrafficStats ;
105
+ }
106
+
107
+ export namespace Features {
108
+ export interface TrafficStats {
109
+ last_updated : string ;
110
+
111
+ /**
112
+ * The period in seconds these statistics were computed over
113
+ */
114
+ period_seconds : number ;
115
+
116
+ /**
117
+ * The average number of requests seen during this period
118
+ */
119
+ requests : number ;
120
+ }
121
+ }
122
+ }
123
+
59
124
export type OperationBulkEditResponse = Record < string , OperationBulkEditResponse . item > ;
60
125
61
126
export namespace OperationBulkEditResponse {
@@ -186,14 +251,16 @@ export interface OperationEditParams {
186
251
state ?: 'review' | 'ignored' ;
187
252
}
188
253
254
+ Operations . OperationListResponsesV4PagePaginationArray = OperationListResponsesV4PagePaginationArray ;
255
+
189
256
export declare namespace Operations {
190
257
export {
258
+ type OperationListResponse as OperationListResponse ,
191
259
type OperationBulkEditResponse as OperationBulkEditResponse ,
192
260
type OperationEditResponse as OperationEditResponse ,
261
+ OperationListResponsesV4PagePaginationArray as OperationListResponsesV4PagePaginationArray ,
193
262
type OperationListParams as OperationListParams ,
194
263
type OperationBulkEditParams as OperationBulkEditParams ,
195
264
type OperationEditParams as OperationEditParams ,
196
265
} ;
197
266
}
198
-
199
- export { DiscoveryOperationsV4PagePaginationArray } ;
0 commit comments