-
Notifications
You must be signed in to change notification settings - Fork 5
/
model_update_custom_db_role.go
116 lines (98 loc) · 3.54 KB
/
model_update_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
// Code based on the AtlasAPI V2 OpenAPI file
package admin
import (
"encoding/json"
)
// UpdateCustomDBRole struct for UpdateCustomDBRole
type UpdateCustomDBRole 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"`
}
// NewUpdateCustomDBRole instantiates a new UpdateCustomDBRole 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 NewUpdateCustomDBRole() *UpdateCustomDBRole {
this := UpdateCustomDBRole{}
return &this
}
// NewUpdateCustomDBRoleWithDefaults instantiates a new UpdateCustomDBRole 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 NewUpdateCustomDBRoleWithDefaults() *UpdateCustomDBRole {
this := UpdateCustomDBRole{}
return &this
}
// GetActions returns the Actions field value if set, zero value otherwise
func (o *UpdateCustomDBRole) 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 *UpdateCustomDBRole) 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 *UpdateCustomDBRole) 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 *UpdateCustomDBRole) SetActions(v []DatabasePrivilegeAction) {
o.Actions = &v
}
// GetInheritedRoles returns the InheritedRoles field value if set, zero value otherwise
func (o *UpdateCustomDBRole) 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 *UpdateCustomDBRole) 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 *UpdateCustomDBRole) 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 *UpdateCustomDBRole) SetInheritedRoles(v []DatabaseInheritedRole) {
o.InheritedRoles = &v
}
func (o UpdateCustomDBRole) MarshalJSONWithoutReadOnly() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o UpdateCustomDBRole) 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
}
return toSerialize, nil
}