/
model_user_custom_db_role.go
144 lines (122 loc) · 4.24 KB
/
model_user_custom_db_role.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
// Code based on the AtlasAPI V2 OpenAPI file
package admin
import (
"encoding/json"
)
// UserCustomDBRole struct for UserCustomDBRole
type UserCustomDBRole struct {
// List of the individual privilege actions that the role grants.
Actions *[]DatabasePrivilegeAction `json:"actions,omitempty"`
// List of the built-in roles that this custom role inherits.
InheritedRoles *[]DatabaseInheritedRole `json:"inheritedRoles,omitempty"`
// Human-readable label that identifies the role for the request. This name must be unique for this custom role in this project.
RoleName string `json:"roleName"`
}
// NewUserCustomDBRole instantiates a new UserCustomDBRole object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewUserCustomDBRole(roleName string) *UserCustomDBRole {
this := UserCustomDBRole{}
this.RoleName = roleName
return &this
}
// NewUserCustomDBRoleWithDefaults instantiates a new UserCustomDBRole object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewUserCustomDBRoleWithDefaults() *UserCustomDBRole {
this := UserCustomDBRole{}
return &this
}
// GetActions returns the Actions field value if set, zero value otherwise
func (o *UserCustomDBRole) GetActions() []DatabasePrivilegeAction {
if o == nil || IsNil(o.Actions) {
var ret []DatabasePrivilegeAction
return ret
}
return *o.Actions
}
// GetActionsOk returns a tuple with the Actions field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UserCustomDBRole) GetActionsOk() (*[]DatabasePrivilegeAction, bool) {
if o == nil || IsNil(o.Actions) {
return nil, false
}
return o.Actions, true
}
// HasActions returns a boolean if a field has been set.
func (o *UserCustomDBRole) HasActions() bool {
if o != nil && !IsNil(o.Actions) {
return true
}
return false
}
// SetActions gets a reference to the given []DatabasePrivilegeAction and assigns it to the Actions field.
func (o *UserCustomDBRole) SetActions(v []DatabasePrivilegeAction) {
o.Actions = &v
}
// GetInheritedRoles returns the InheritedRoles field value if set, zero value otherwise
func (o *UserCustomDBRole) GetInheritedRoles() []DatabaseInheritedRole {
if o == nil || IsNil(o.InheritedRoles) {
var ret []DatabaseInheritedRole
return ret
}
return *o.InheritedRoles
}
// GetInheritedRolesOk returns a tuple with the InheritedRoles field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UserCustomDBRole) GetInheritedRolesOk() (*[]DatabaseInheritedRole, bool) {
if o == nil || IsNil(o.InheritedRoles) {
return nil, false
}
return o.InheritedRoles, true
}
// HasInheritedRoles returns a boolean if a field has been set.
func (o *UserCustomDBRole) HasInheritedRoles() bool {
if o != nil && !IsNil(o.InheritedRoles) {
return true
}
return false
}
// SetInheritedRoles gets a reference to the given []DatabaseInheritedRole and assigns it to the InheritedRoles field.
func (o *UserCustomDBRole) SetInheritedRoles(v []DatabaseInheritedRole) {
o.InheritedRoles = &v
}
// GetRoleName returns the RoleName field value
func (o *UserCustomDBRole) GetRoleName() string {
if o == nil {
var ret string
return ret
}
return o.RoleName
}
// GetRoleNameOk returns a tuple with the RoleName field value
// and a boolean to check if the value has been set.
func (o *UserCustomDBRole) GetRoleNameOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.RoleName, true
}
// SetRoleName sets field value
func (o *UserCustomDBRole) SetRoleName(v string) {
o.RoleName = v
}
func (o UserCustomDBRole) MarshalJSONWithoutReadOnly() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o UserCustomDBRole) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Actions) {
toSerialize["actions"] = o.Actions
}
if !IsNil(o.InheritedRoles) {
toSerialize["inheritedRoles"] = o.InheritedRoles
}
toSerialize["roleName"] = o.RoleName
return toSerialize, nil
}