/
sql_firewall_violation_aggregation_dimensions.go
119 lines (93 loc) · 5.42 KB
/
sql_firewall_violation_aggregation_dimensions.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
// Copyright (c) 2016, 2018, 2024, 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.
// Data Safe API
//
// APIs for using Oracle Data Safe.
//
package datasafe
import (
"fmt"
"github.com/oracle/oci-go-sdk/v65/common"
"strings"
)
// SqlFirewallViolationAggregationDimensions The details of the aggregation dimensions used for summarizing SQL violations.
type SqlFirewallViolationAggregationDimensions struct {
// The time of the SQL violation occurrence in the target database.
OperationTime []common.SDKTime `mandatory:"false" json:"operationTime"`
// The name of the database user.
DbUserName []string `mandatory:"false" json:"dbUserName"`
// The OCID of the target database.
TargetId []string `mandatory:"false" json:"targetId"`
// The name of the target database.
TargetName []string `mandatory:"false" json:"targetName"`
// The application from which the SQL violation was generated. Examples SQL Plus or SQL Developer.
ClientProgram []string `mandatory:"false" json:"clientProgram"`
// The name of the action executed by the user on the target database, for example, ALTER, CREATE, DROP.
Operation []string `mandatory:"false" json:"operation"`
// The name of the operating system user for the database session.
ClientOsUserName []string `mandatory:"false" json:"clientOsUserName"`
// Indicates whether SQL or context violation.
ViolationCause []string `mandatory:"false" json:"violationCause"`
// The IP address of the host from which the session was spawned.
ClientIp []string `mandatory:"false" json:"clientIp"`
// The action taken for this SQL violation.
ViolationAction []string `mandatory:"false" json:"violationAction"`
// Specifies the level of SQL included for this SQL Firewall policy.
// USER_ISSUED_SQL - User issued SQL statements only.
// ALL_SQL - Includes all SQL statements including SQL statement issued inside PL/SQL units.
SqlLevel []SqlFirewallViolationAggregationDimensionsSqlLevelEnum `mandatory:"false" json:"sqlLevel,omitempty"`
}
func (m SqlFirewallViolationAggregationDimensions) String() string {
return common.PointerString(m)
}
// 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 (m SqlFirewallViolationAggregationDimensions) ValidateEnumValue() (bool, error) {
errMessage := []string{}
for _, val := range m.SqlLevel {
if _, ok := GetMappingSqlFirewallViolationAggregationDimensionsSqlLevelEnum(string(val)); !ok && val != "" {
errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SqlLevel: %s. Supported values are: %s.", val, strings.Join(GetSqlFirewallViolationAggregationDimensionsSqlLevelEnumStringValues(), ",")))
}
}
if len(errMessage) > 0 {
return true, fmt.Errorf(strings.Join(errMessage, "\n"))
}
return false, nil
}
// SqlFirewallViolationAggregationDimensionsSqlLevelEnum Enum with underlying type: string
type SqlFirewallViolationAggregationDimensionsSqlLevelEnum string
// Set of constants representing the allowable values for SqlFirewallViolationAggregationDimensionsSqlLevelEnum
const (
SqlFirewallViolationAggregationDimensionsSqlLevelUserIssuedSql SqlFirewallViolationAggregationDimensionsSqlLevelEnum = "USER_ISSUED_SQL"
SqlFirewallViolationAggregationDimensionsSqlLevelAllSql SqlFirewallViolationAggregationDimensionsSqlLevelEnum = "ALL_SQL"
)
var mappingSqlFirewallViolationAggregationDimensionsSqlLevelEnum = map[string]SqlFirewallViolationAggregationDimensionsSqlLevelEnum{
"USER_ISSUED_SQL": SqlFirewallViolationAggregationDimensionsSqlLevelUserIssuedSql,
"ALL_SQL": SqlFirewallViolationAggregationDimensionsSqlLevelAllSql,
}
var mappingSqlFirewallViolationAggregationDimensionsSqlLevelEnumLowerCase = map[string]SqlFirewallViolationAggregationDimensionsSqlLevelEnum{
"user_issued_sql": SqlFirewallViolationAggregationDimensionsSqlLevelUserIssuedSql,
"all_sql": SqlFirewallViolationAggregationDimensionsSqlLevelAllSql,
}
// GetSqlFirewallViolationAggregationDimensionsSqlLevelEnumValues Enumerates the set of values for SqlFirewallViolationAggregationDimensionsSqlLevelEnum
func GetSqlFirewallViolationAggregationDimensionsSqlLevelEnumValues() []SqlFirewallViolationAggregationDimensionsSqlLevelEnum {
values := make([]SqlFirewallViolationAggregationDimensionsSqlLevelEnum, 0)
for _, v := range mappingSqlFirewallViolationAggregationDimensionsSqlLevelEnum {
values = append(values, v)
}
return values
}
// GetSqlFirewallViolationAggregationDimensionsSqlLevelEnumStringValues Enumerates the set of values in String for SqlFirewallViolationAggregationDimensionsSqlLevelEnum
func GetSqlFirewallViolationAggregationDimensionsSqlLevelEnumStringValues() []string {
return []string{
"USER_ISSUED_SQL",
"ALL_SQL",
}
}
// GetMappingSqlFirewallViolationAggregationDimensionsSqlLevelEnum performs case Insensitive comparison on enum value and return the desired enum
func GetMappingSqlFirewallViolationAggregationDimensionsSqlLevelEnum(val string) (SqlFirewallViolationAggregationDimensionsSqlLevelEnum, bool) {
enum, ok := mappingSqlFirewallViolationAggregationDimensionsSqlLevelEnumLowerCase[strings.ToLower(val)]
return enum, ok
}