-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmodel_collection_of_permissions_with_allowed_values.go
198 lines (164 loc) · 9.8 KB
/
model_collection_of_permissions_with_allowed_values.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
/*
Libre Graph API
Libre Graph is a free API for cloud collaboration inspired by the MS Graph API.
API version: v1.0.4
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package libregraph
import (
"encoding/json"
)
// checks if the CollectionOfPermissionsWithAllowedValues type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &CollectionOfPermissionsWithAllowedValues{}
// CollectionOfPermissionsWithAllowedValues struct for CollectionOfPermissionsWithAllowedValues
type CollectionOfPermissionsWithAllowedValues struct {
// A list of role definitions that can be chosen for the resource.
LibreGraphPermissionsRolesAllowedValues []UnifiedRoleDefinition `json:"@libre.graph.permissions.roles.allowedValues,omitempty"`
// A list of actions that can be chosen for a custom role. Following the CS3 API we can represent the CS3 permissions by mapping them to driveItem properties or relations like this: | [CS3 ResourcePermission](https://cs3org.github.io/cs3apis/#cs3.storage.provider.v1beta1.ResourcePermissions) | action | comment | | ------------------------------------------------------------------------------------------------------------ | ------ | ------- | | `stat` | `libre.graph/driveItem/basic/read` | `basic` because it does not include versions or trashed items | | `get_quota` | `libre.graph/driveItem/quota/read` | read only the `quota` property | | `get_path` | `libre.graph/driveItem/path/read` | read only the `path` property | | `move` | `libre.graph/driveItem/path/update` | allows updating the `path` property of a CS3 resource | | `delete` | `libre.graph/driveItem/standard/delete` | `standard` because deleting is a common update operation | | `list_container` | `libre.graph/driveItem/children/read` | | | `create_container` | `libre.graph/driveItem/children/create` | | | `initiate_file_download` | `libre.graph/driveItem/content/read` | `content` is the property read when initiating a download | | `initiate_file_upload` | `libre.graph/driveItem/upload/create` | `uploads` are a separate property. postprocessing creates the `content` | | `add_grant` | `libre.graph/driveItem/permissions/create` | | | `list_grant` | `libre.graph/driveItem/permissions/read` | | | `update_grant` | `libre.graph/driveItem/permissions/update` | | | `remove_grant` | `libre.graph/driveItem/permissions/delete` | | | `deny_grant` | `libre.graph/driveItem/permissions/deny` | uses a non CRUD action `deny` | | `list_file_versions` | `libre.graph/driveItem/versions/read` | `versions` is a `driveItemVersion` collection | | `restore_file_version` | `libre.graph/driveItem/versions/update` | the only `update` action is restore | | `list_recycle` | `libre.graph/driveItem/deleted/read` | reading a driveItem `deleted` property implies listing | | `restore_recycle_item` | `libre.graph/driveItem/deleted/update` | the only `update` action is restore | | `purge_recycle` | `libre.graph/driveItem/deleted/delete` | allows purging deleted `driveItems` |
LibreGraphPermissionsActionsAllowedValues []string `json:"@libre.graph.permissions.actions.allowedValues,omitempty"`
Value []Permission `json:"value,omitempty"`
}
// NewCollectionOfPermissionsWithAllowedValues instantiates a new CollectionOfPermissionsWithAllowedValues 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 NewCollectionOfPermissionsWithAllowedValues() *CollectionOfPermissionsWithAllowedValues {
this := CollectionOfPermissionsWithAllowedValues{}
return &this
}
// NewCollectionOfPermissionsWithAllowedValuesWithDefaults instantiates a new CollectionOfPermissionsWithAllowedValues 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 NewCollectionOfPermissionsWithAllowedValuesWithDefaults() *CollectionOfPermissionsWithAllowedValues {
this := CollectionOfPermissionsWithAllowedValues{}
return &this
}
// GetLibreGraphPermissionsRolesAllowedValues returns the LibreGraphPermissionsRolesAllowedValues field value if set, zero value otherwise.
func (o *CollectionOfPermissionsWithAllowedValues) GetLibreGraphPermissionsRolesAllowedValues() []UnifiedRoleDefinition {
if o == nil || IsNil(o.LibreGraphPermissionsRolesAllowedValues) {
var ret []UnifiedRoleDefinition
return ret
}
return o.LibreGraphPermissionsRolesAllowedValues
}
// GetLibreGraphPermissionsRolesAllowedValuesOk returns a tuple with the LibreGraphPermissionsRolesAllowedValues field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CollectionOfPermissionsWithAllowedValues) GetLibreGraphPermissionsRolesAllowedValuesOk() ([]UnifiedRoleDefinition, bool) {
if o == nil || IsNil(o.LibreGraphPermissionsRolesAllowedValues) {
return nil, false
}
return o.LibreGraphPermissionsRolesAllowedValues, true
}
// HasLibreGraphPermissionsRolesAllowedValues returns a boolean if a field has been set.
func (o *CollectionOfPermissionsWithAllowedValues) HasLibreGraphPermissionsRolesAllowedValues() bool {
if o != nil && !IsNil(o.LibreGraphPermissionsRolesAllowedValues) {
return true
}
return false
}
// SetLibreGraphPermissionsRolesAllowedValues gets a reference to the given []UnifiedRoleDefinition and assigns it to the LibreGraphPermissionsRolesAllowedValues field.
func (o *CollectionOfPermissionsWithAllowedValues) SetLibreGraphPermissionsRolesAllowedValues(v []UnifiedRoleDefinition) {
o.LibreGraphPermissionsRolesAllowedValues = v
}
// GetLibreGraphPermissionsActionsAllowedValues returns the LibreGraphPermissionsActionsAllowedValues field value if set, zero value otherwise.
func (o *CollectionOfPermissionsWithAllowedValues) GetLibreGraphPermissionsActionsAllowedValues() []string {
if o == nil || IsNil(o.LibreGraphPermissionsActionsAllowedValues) {
var ret []string
return ret
}
return o.LibreGraphPermissionsActionsAllowedValues
}
// GetLibreGraphPermissionsActionsAllowedValuesOk returns a tuple with the LibreGraphPermissionsActionsAllowedValues field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CollectionOfPermissionsWithAllowedValues) GetLibreGraphPermissionsActionsAllowedValuesOk() ([]string, bool) {
if o == nil || IsNil(o.LibreGraphPermissionsActionsAllowedValues) {
return nil, false
}
return o.LibreGraphPermissionsActionsAllowedValues, true
}
// HasLibreGraphPermissionsActionsAllowedValues returns a boolean if a field has been set.
func (o *CollectionOfPermissionsWithAllowedValues) HasLibreGraphPermissionsActionsAllowedValues() bool {
if o != nil && !IsNil(o.LibreGraphPermissionsActionsAllowedValues) {
return true
}
return false
}
// SetLibreGraphPermissionsActionsAllowedValues gets a reference to the given []string and assigns it to the LibreGraphPermissionsActionsAllowedValues field.
func (o *CollectionOfPermissionsWithAllowedValues) SetLibreGraphPermissionsActionsAllowedValues(v []string) {
o.LibreGraphPermissionsActionsAllowedValues = v
}
// GetValue returns the Value field value if set, zero value otherwise.
func (o *CollectionOfPermissionsWithAllowedValues) GetValue() []Permission {
if o == nil || IsNil(o.Value) {
var ret []Permission
return ret
}
return o.Value
}
// GetValueOk returns a tuple with the Value field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CollectionOfPermissionsWithAllowedValues) GetValueOk() ([]Permission, bool) {
if o == nil || IsNil(o.Value) {
return nil, false
}
return o.Value, true
}
// HasValue returns a boolean if a field has been set.
func (o *CollectionOfPermissionsWithAllowedValues) HasValue() bool {
if o != nil && !IsNil(o.Value) {
return true
}
return false
}
// SetValue gets a reference to the given []Permission and assigns it to the Value field.
func (o *CollectionOfPermissionsWithAllowedValues) SetValue(v []Permission) {
o.Value = v
}
func (o CollectionOfPermissionsWithAllowedValues) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o CollectionOfPermissionsWithAllowedValues) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.LibreGraphPermissionsRolesAllowedValues) {
toSerialize["@libre.graph.permissions.roles.allowedValues"] = o.LibreGraphPermissionsRolesAllowedValues
}
if !IsNil(o.LibreGraphPermissionsActionsAllowedValues) {
toSerialize["@libre.graph.permissions.actions.allowedValues"] = o.LibreGraphPermissionsActionsAllowedValues
}
if !IsNil(o.Value) {
toSerialize["value"] = o.Value
}
return toSerialize, nil
}
type NullableCollectionOfPermissionsWithAllowedValues struct {
value *CollectionOfPermissionsWithAllowedValues
isSet bool
}
func (v NullableCollectionOfPermissionsWithAllowedValues) Get() *CollectionOfPermissionsWithAllowedValues {
return v.value
}
func (v *NullableCollectionOfPermissionsWithAllowedValues) Set(val *CollectionOfPermissionsWithAllowedValues) {
v.value = val
v.isSet = true
}
func (v NullableCollectionOfPermissionsWithAllowedValues) IsSet() bool {
return v.isSet
}
func (v *NullableCollectionOfPermissionsWithAllowedValues) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableCollectionOfPermissionsWithAllowedValues(val *CollectionOfPermissionsWithAllowedValues) *NullableCollectionOfPermissionsWithAllowedValues {
return &NullableCollectionOfPermissionsWithAllowedValues{value: val, isSet: true}
}
func (v NullableCollectionOfPermissionsWithAllowedValues) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableCollectionOfPermissionsWithAllowedValues) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}