-
Notifications
You must be signed in to change notification settings - Fork 82
/
list_waf_logs_request_response.go
363 lines (297 loc) · 15.3 KB
/
list_waf_logs_request_response.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved.
// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
// Code generated. DO NOT EDIT.
package waas
import (
"fmt"
"github.com/oracle/oci-go-sdk/v65/common"
"net/http"
"strings"
)
// ListWafLogsRequest wrapper for the ListWafLogs operation
//
// # See also
//
// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/waas/ListWafLogs.go.html to see an example of how to use ListWafLogsRequest.
type ListWafLogsRequest struct {
// The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the WAAS policy.
WaasPolicyId *string `mandatory:"true" contributesTo:"path" name:"waasPolicyId"`
// The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"`
// The maximum number of items to return in a paginated call. If unspecified, defaults to `20`.
Limit *int `mandatory:"false" contributesTo:"query" name:"limit"`
// The value of the `opc-next-page` response header from the previous paginated call.
Page *string `mandatory:"false" contributesTo:"query" name:"page"`
// A filter that matches log entries where the observed event occurred on or after a date and time specified in RFC 3339 format. If unspecified, defaults to two hours before receipt of the request.
TimeObservedGreaterThanOrEqualTo *common.SDKTime `mandatory:"false" contributesTo:"query" name:"timeObservedGreaterThanOrEqualTo"`
// A filter that matches log entries where the observed event occurred before a date and time, specified in RFC 3339 format.
TimeObservedLessThan *common.SDKTime `mandatory:"false" contributesTo:"query" name:"timeObservedLessThan"`
// A full text search for logs.
TextContains *string `mandatory:"false" contributesTo:"query" name:"textContains"`
// Filters logs by access rule key.
AccessRuleKey []string `contributesTo:"query" name:"accessRuleKey" collectionFormat:"multi"`
// Filters logs by Web Application Firewall action.
Action []ListWafLogsActionEnum `contributesTo:"query" name:"action" omitEmpty:"true" collectionFormat:"multi"`
// Filters logs by client IP address.
ClientAddress []string `contributesTo:"query" name:"clientAddress" collectionFormat:"multi"`
// Filters logs by country code. Country codes are in ISO 3166-1 alpha-2 format. For a list of codes, see ISO's website (https://www.iso.org/obp/ui/#search/code/).
CountryCode []string `contributesTo:"query" name:"countryCode" collectionFormat:"multi"`
// Filter logs by country name.
CountryName []string `contributesTo:"query" name:"countryName" collectionFormat:"multi"`
// Filter logs by device fingerprint.
Fingerprint []string `contributesTo:"query" name:"fingerprint" collectionFormat:"multi"`
// Filter logs by HTTP method.
HttpMethod []ListWafLogsHttpMethodEnum `contributesTo:"query" name:"httpMethod" omitEmpty:"true" collectionFormat:"multi"`
// Filter logs by incident key.
IncidentKey []string `contributesTo:"query" name:"incidentKey" collectionFormat:"multi"`
// Filter by log type. For more information about WAF logs, see Logs (https://docs.cloud.oracle.com/iaas/Content/WAF/Tasks/logs.htm).
LogType []ListWafLogsLogTypeEnum `contributesTo:"query" name:"logType" omitEmpty:"true" collectionFormat:"multi"`
// Filter by origin IP address.
OriginAddress []string `contributesTo:"query" name:"originAddress" collectionFormat:"multi"`
// Filter by referrer.
Referrer []string `contributesTo:"query" name:"referrer" collectionFormat:"multi"`
// Filter by request URL.
RequestUrl []string `contributesTo:"query" name:"requestUrl" collectionFormat:"multi"`
// Filter by response code.
ResponseCode []int `contributesTo:"query" name:"responseCode" collectionFormat:"multi"`
// Filter by threat feed key.
ThreatFeedKey []string `contributesTo:"query" name:"threatFeedKey" collectionFormat:"multi"`
// Filter by user agent.
UserAgent []string `contributesTo:"query" name:"userAgent" collectionFormat:"multi"`
// Filter by protection rule key.
ProtectionRuleKey []string `contributesTo:"query" name:"protectionRuleKey" collectionFormat:"multi"`
// Metadata about the request. This information will not be transmitted to the service, but
// represents information that the SDK will consume to drive retry behavior.
RequestMetadata common.RequestMetadata
}
func (request ListWafLogsRequest) String() string {
return common.PointerString(request)
}
// HTTPRequest implements the OCIRequest interface
func (request ListWafLogsRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) {
_, err := request.ValidateEnumValue()
if err != nil {
return http.Request{}, err
}
return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders)
}
// BinaryRequestBody implements the OCIRequest interface
func (request ListWafLogsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) {
return nil, false
}
// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy.
func (request ListWafLogsRequest) RetryPolicy() *common.RetryPolicy {
return request.RequestMetadata.RetryPolicy
}
// ValidateEnumValue returns an error when providing an unsupported enum value
// This function is being called during constructing API request process
// Not recommended for calling this function directly
func (request ListWafLogsRequest) ValidateEnumValue() (bool, error) {
errMessage := []string{}
for _, val := range request.Action {
if _, ok := GetMappingListWafLogsActionEnum(string(val)); !ok && val != "" {
errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Action: %s. Supported values are: %s.", val, strings.Join(GetListWafLogsActionEnumStringValues(), ",")))
}
}
for _, val := range request.HttpMethod {
if _, ok := GetMappingListWafLogsHttpMethodEnum(string(val)); !ok && val != "" {
errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for HttpMethod: %s. Supported values are: %s.", val, strings.Join(GetListWafLogsHttpMethodEnumStringValues(), ",")))
}
}
for _, val := range request.LogType {
if _, ok := GetMappingListWafLogsLogTypeEnum(string(val)); !ok && val != "" {
errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LogType: %s. Supported values are: %s.", val, strings.Join(GetListWafLogsLogTypeEnumStringValues(), ",")))
}
}
if len(errMessage) > 0 {
return true, fmt.Errorf(strings.Join(errMessage, "\n"))
}
return false, nil
}
// ListWafLogsResponse wrapper for the ListWafLogs operation
type ListWafLogsResponse struct {
// The underlying http response
RawResponse *http.Response
// A list of []WafLog instances
Items []WafLog `presentIn:"body"`
// A unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
OpcRequestId *string `presentIn:"header" name:"opc-request-id"`
// For list pagination. When this header appears in the response, additional pages of results may remain. For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine).
OpcNextPage *string `presentIn:"header" name:"opc-next-page"`
}
func (response ListWafLogsResponse) String() string {
return common.PointerString(response)
}
// HTTPResponse implements the OCIResponse interface
func (response ListWafLogsResponse) HTTPResponse() *http.Response {
return response.RawResponse
}
// ListWafLogsActionEnum Enum with underlying type: string
type ListWafLogsActionEnum string
// Set of constants representing the allowable values for ListWafLogsActionEnum
const (
ListWafLogsActionBlock ListWafLogsActionEnum = "BLOCK"
ListWafLogsActionDetect ListWafLogsActionEnum = "DETECT"
ListWafLogsActionBypass ListWafLogsActionEnum = "BYPASS"
ListWafLogsActionLog ListWafLogsActionEnum = "LOG"
ListWafLogsActionRedirected ListWafLogsActionEnum = "REDIRECTED"
)
var mappingListWafLogsActionEnum = map[string]ListWafLogsActionEnum{
"BLOCK": ListWafLogsActionBlock,
"DETECT": ListWafLogsActionDetect,
"BYPASS": ListWafLogsActionBypass,
"LOG": ListWafLogsActionLog,
"REDIRECTED": ListWafLogsActionRedirected,
}
var mappingListWafLogsActionEnumLowerCase = map[string]ListWafLogsActionEnum{
"block": ListWafLogsActionBlock,
"detect": ListWafLogsActionDetect,
"bypass": ListWafLogsActionBypass,
"log": ListWafLogsActionLog,
"redirected": ListWafLogsActionRedirected,
}
// GetListWafLogsActionEnumValues Enumerates the set of values for ListWafLogsActionEnum
func GetListWafLogsActionEnumValues() []ListWafLogsActionEnum {
values := make([]ListWafLogsActionEnum, 0)
for _, v := range mappingListWafLogsActionEnum {
values = append(values, v)
}
return values
}
// GetListWafLogsActionEnumStringValues Enumerates the set of values in String for ListWafLogsActionEnum
func GetListWafLogsActionEnumStringValues() []string {
return []string{
"BLOCK",
"DETECT",
"BYPASS",
"LOG",
"REDIRECTED",
}
}
// GetMappingListWafLogsActionEnum performs case Insensitive comparison on enum value and return the desired enum
func GetMappingListWafLogsActionEnum(val string) (ListWafLogsActionEnum, bool) {
enum, ok := mappingListWafLogsActionEnumLowerCase[strings.ToLower(val)]
return enum, ok
}
// ListWafLogsHttpMethodEnum Enum with underlying type: string
type ListWafLogsHttpMethodEnum string
// Set of constants representing the allowable values for ListWafLogsHttpMethodEnum
const (
ListWafLogsHttpMethodOptions ListWafLogsHttpMethodEnum = "OPTIONS"
ListWafLogsHttpMethodGet ListWafLogsHttpMethodEnum = "GET"
ListWafLogsHttpMethodHead ListWafLogsHttpMethodEnum = "HEAD"
ListWafLogsHttpMethodPost ListWafLogsHttpMethodEnum = "POST"
ListWafLogsHttpMethodPut ListWafLogsHttpMethodEnum = "PUT"
ListWafLogsHttpMethodDelete ListWafLogsHttpMethodEnum = "DELETE"
ListWafLogsHttpMethodTrace ListWafLogsHttpMethodEnum = "TRACE"
ListWafLogsHttpMethodConnect ListWafLogsHttpMethodEnum = "CONNECT"
)
var mappingListWafLogsHttpMethodEnum = map[string]ListWafLogsHttpMethodEnum{
"OPTIONS": ListWafLogsHttpMethodOptions,
"GET": ListWafLogsHttpMethodGet,
"HEAD": ListWafLogsHttpMethodHead,
"POST": ListWafLogsHttpMethodPost,
"PUT": ListWafLogsHttpMethodPut,
"DELETE": ListWafLogsHttpMethodDelete,
"TRACE": ListWafLogsHttpMethodTrace,
"CONNECT": ListWafLogsHttpMethodConnect,
}
var mappingListWafLogsHttpMethodEnumLowerCase = map[string]ListWafLogsHttpMethodEnum{
"options": ListWafLogsHttpMethodOptions,
"get": ListWafLogsHttpMethodGet,
"head": ListWafLogsHttpMethodHead,
"post": ListWafLogsHttpMethodPost,
"put": ListWafLogsHttpMethodPut,
"delete": ListWafLogsHttpMethodDelete,
"trace": ListWafLogsHttpMethodTrace,
"connect": ListWafLogsHttpMethodConnect,
}
// GetListWafLogsHttpMethodEnumValues Enumerates the set of values for ListWafLogsHttpMethodEnum
func GetListWafLogsHttpMethodEnumValues() []ListWafLogsHttpMethodEnum {
values := make([]ListWafLogsHttpMethodEnum, 0)
for _, v := range mappingListWafLogsHttpMethodEnum {
values = append(values, v)
}
return values
}
// GetListWafLogsHttpMethodEnumStringValues Enumerates the set of values in String for ListWafLogsHttpMethodEnum
func GetListWafLogsHttpMethodEnumStringValues() []string {
return []string{
"OPTIONS",
"GET",
"HEAD",
"POST",
"PUT",
"DELETE",
"TRACE",
"CONNECT",
}
}
// GetMappingListWafLogsHttpMethodEnum performs case Insensitive comparison on enum value and return the desired enum
func GetMappingListWafLogsHttpMethodEnum(val string) (ListWafLogsHttpMethodEnum, bool) {
enum, ok := mappingListWafLogsHttpMethodEnumLowerCase[strings.ToLower(val)]
return enum, ok
}
// ListWafLogsLogTypeEnum Enum with underlying type: string
type ListWafLogsLogTypeEnum string
// Set of constants representing the allowable values for ListWafLogsLogTypeEnum
const (
ListWafLogsLogTypeAccess ListWafLogsLogTypeEnum = "ACCESS"
ListWafLogsLogTypeProtectionRules ListWafLogsLogTypeEnum = "PROTECTION_RULES"
ListWafLogsLogTypeJsChallenge ListWafLogsLogTypeEnum = "JS_CHALLENGE"
ListWafLogsLogTypeCaptcha ListWafLogsLogTypeEnum = "CAPTCHA"
ListWafLogsLogTypeAccessRules ListWafLogsLogTypeEnum = "ACCESS_RULES"
ListWafLogsLogTypeThreatFeeds ListWafLogsLogTypeEnum = "THREAT_FEEDS"
ListWafLogsLogTypeHumanInteractionChallenge ListWafLogsLogTypeEnum = "HUMAN_INTERACTION_CHALLENGE"
ListWafLogsLogTypeDeviceFingerprintChallenge ListWafLogsLogTypeEnum = "DEVICE_FINGERPRINT_CHALLENGE"
ListWafLogsLogTypeAddressRateLimiting ListWafLogsLogTypeEnum = "ADDRESS_RATE_LIMITING"
)
var mappingListWafLogsLogTypeEnum = map[string]ListWafLogsLogTypeEnum{
"ACCESS": ListWafLogsLogTypeAccess,
"PROTECTION_RULES": ListWafLogsLogTypeProtectionRules,
"JS_CHALLENGE": ListWafLogsLogTypeJsChallenge,
"CAPTCHA": ListWafLogsLogTypeCaptcha,
"ACCESS_RULES": ListWafLogsLogTypeAccessRules,
"THREAT_FEEDS": ListWafLogsLogTypeThreatFeeds,
"HUMAN_INTERACTION_CHALLENGE": ListWafLogsLogTypeHumanInteractionChallenge,
"DEVICE_FINGERPRINT_CHALLENGE": ListWafLogsLogTypeDeviceFingerprintChallenge,
"ADDRESS_RATE_LIMITING": ListWafLogsLogTypeAddressRateLimiting,
}
var mappingListWafLogsLogTypeEnumLowerCase = map[string]ListWafLogsLogTypeEnum{
"access": ListWafLogsLogTypeAccess,
"protection_rules": ListWafLogsLogTypeProtectionRules,
"js_challenge": ListWafLogsLogTypeJsChallenge,
"captcha": ListWafLogsLogTypeCaptcha,
"access_rules": ListWafLogsLogTypeAccessRules,
"threat_feeds": ListWafLogsLogTypeThreatFeeds,
"human_interaction_challenge": ListWafLogsLogTypeHumanInteractionChallenge,
"device_fingerprint_challenge": ListWafLogsLogTypeDeviceFingerprintChallenge,
"address_rate_limiting": ListWafLogsLogTypeAddressRateLimiting,
}
// GetListWafLogsLogTypeEnumValues Enumerates the set of values for ListWafLogsLogTypeEnum
func GetListWafLogsLogTypeEnumValues() []ListWafLogsLogTypeEnum {
values := make([]ListWafLogsLogTypeEnum, 0)
for _, v := range mappingListWafLogsLogTypeEnum {
values = append(values, v)
}
return values
}
// GetListWafLogsLogTypeEnumStringValues Enumerates the set of values in String for ListWafLogsLogTypeEnum
func GetListWafLogsLogTypeEnumStringValues() []string {
return []string{
"ACCESS",
"PROTECTION_RULES",
"JS_CHALLENGE",
"CAPTCHA",
"ACCESS_RULES",
"THREAT_FEEDS",
"HUMAN_INTERACTION_CHALLENGE",
"DEVICE_FINGERPRINT_CHALLENGE",
"ADDRESS_RATE_LIMITING",
}
}
// GetMappingListWafLogsLogTypeEnum performs case Insensitive comparison on enum value and return the desired enum
func GetMappingListWafLogsLogTypeEnum(val string) (ListWafLogsLogTypeEnum, bool) {
enum, ok := mappingListWafLogsLogTypeEnumLowerCase[strings.ToLower(val)]
return enum, ok
}