-
Notifications
You must be signed in to change notification settings - Fork 0
/
document_set.go
322 lines (320 loc) · 13.2 KB
/
document_set.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
package models
import (
i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization"
)
// DocumentSet
type DocumentSet struct {
// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.
additionalData map[string]any
// Content types allowed in document set.
allowedContentTypes []ContentTypeInfoable
// Default contents of document set.
defaultContents []DocumentSetContentable
// The OdataType property
odataType *string
// Specifies whether to push welcome page changes to inherited content types.
propagateWelcomePageChanges *bool
// The sharedColumns property
sharedColumns []ColumnDefinitionable
// Indicates whether to add the name of the document set to each file name.
shouldPrefixNameToFile *bool
// The welcomePageColumns property
welcomePageColumns []ColumnDefinitionable
// Welcome page absolute URL.
welcomePageUrl *string
}
// NewDocumentSet instantiates a new documentSet and sets the default values.
func NewDocumentSet()(*DocumentSet) {
m := &DocumentSet{
}
m.SetAdditionalData(make(map[string]any))
return m
}
// CreateDocumentSetFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value
func CreateDocumentSetFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) {
return NewDocumentSet(), nil
}
// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.
func (m *DocumentSet) GetAdditionalData()(map[string]any) {
return m.additionalData
}
// GetAllowedContentTypes gets the allowedContentTypes property value. Content types allowed in document set.
func (m *DocumentSet) GetAllowedContentTypes()([]ContentTypeInfoable) {
return m.allowedContentTypes
}
// GetDefaultContents gets the defaultContents property value. Default contents of document set.
func (m *DocumentSet) GetDefaultContents()([]DocumentSetContentable) {
return m.defaultContents
}
// GetFieldDeserializers the deserialization information for the current model
func (m *DocumentSet) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) {
res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error))
res["allowedContentTypes"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetCollectionOfObjectValues(CreateContentTypeInfoFromDiscriminatorValue)
if err != nil {
return err
}
if val != nil {
res := make([]ContentTypeInfoable, len(val))
for i, v := range val {
if v != nil {
res[i] = v.(ContentTypeInfoable)
}
}
m.SetAllowedContentTypes(res)
}
return nil
}
res["defaultContents"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetCollectionOfObjectValues(CreateDocumentSetContentFromDiscriminatorValue)
if err != nil {
return err
}
if val != nil {
res := make([]DocumentSetContentable, len(val))
for i, v := range val {
if v != nil {
res[i] = v.(DocumentSetContentable)
}
}
m.SetDefaultContents(res)
}
return nil
}
res["@odata.type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetStringValue()
if err != nil {
return err
}
if val != nil {
m.SetOdataType(val)
}
return nil
}
res["propagateWelcomePageChanges"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetBoolValue()
if err != nil {
return err
}
if val != nil {
m.SetPropagateWelcomePageChanges(val)
}
return nil
}
res["sharedColumns"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetCollectionOfObjectValues(CreateColumnDefinitionFromDiscriminatorValue)
if err != nil {
return err
}
if val != nil {
res := make([]ColumnDefinitionable, len(val))
for i, v := range val {
if v != nil {
res[i] = v.(ColumnDefinitionable)
}
}
m.SetSharedColumns(res)
}
return nil
}
res["shouldPrefixNameToFile"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetBoolValue()
if err != nil {
return err
}
if val != nil {
m.SetShouldPrefixNameToFile(val)
}
return nil
}
res["welcomePageColumns"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetCollectionOfObjectValues(CreateColumnDefinitionFromDiscriminatorValue)
if err != nil {
return err
}
if val != nil {
res := make([]ColumnDefinitionable, len(val))
for i, v := range val {
if v != nil {
res[i] = v.(ColumnDefinitionable)
}
}
m.SetWelcomePageColumns(res)
}
return nil
}
res["welcomePageUrl"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetStringValue()
if err != nil {
return err
}
if val != nil {
m.SetWelcomePageUrl(val)
}
return nil
}
return res
}
// GetOdataType gets the @odata.type property value. The OdataType property
func (m *DocumentSet) GetOdataType()(*string) {
return m.odataType
}
// GetPropagateWelcomePageChanges gets the propagateWelcomePageChanges property value. Specifies whether to push welcome page changes to inherited content types.
func (m *DocumentSet) GetPropagateWelcomePageChanges()(*bool) {
return m.propagateWelcomePageChanges
}
// GetSharedColumns gets the sharedColumns property value. The sharedColumns property
func (m *DocumentSet) GetSharedColumns()([]ColumnDefinitionable) {
return m.sharedColumns
}
// GetShouldPrefixNameToFile gets the shouldPrefixNameToFile property value. Indicates whether to add the name of the document set to each file name.
func (m *DocumentSet) GetShouldPrefixNameToFile()(*bool) {
return m.shouldPrefixNameToFile
}
// GetWelcomePageColumns gets the welcomePageColumns property value. The welcomePageColumns property
func (m *DocumentSet) GetWelcomePageColumns()([]ColumnDefinitionable) {
return m.welcomePageColumns
}
// GetWelcomePageUrl gets the welcomePageUrl property value. Welcome page absolute URL.
func (m *DocumentSet) GetWelcomePageUrl()(*string) {
return m.welcomePageUrl
}
// Serialize serializes information the current object
func (m *DocumentSet) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) {
if m.GetAllowedContentTypes() != nil {
cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetAllowedContentTypes()))
for i, v := range m.GetAllowedContentTypes() {
if v != nil {
cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable)
}
}
err := writer.WriteCollectionOfObjectValues("allowedContentTypes", cast)
if err != nil {
return err
}
}
if m.GetDefaultContents() != nil {
cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetDefaultContents()))
for i, v := range m.GetDefaultContents() {
if v != nil {
cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable)
}
}
err := writer.WriteCollectionOfObjectValues("defaultContents", cast)
if err != nil {
return err
}
}
{
err := writer.WriteStringValue("@odata.type", m.GetOdataType())
if err != nil {
return err
}
}
{
err := writer.WriteBoolValue("propagateWelcomePageChanges", m.GetPropagateWelcomePageChanges())
if err != nil {
return err
}
}
if m.GetSharedColumns() != nil {
cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetSharedColumns()))
for i, v := range m.GetSharedColumns() {
if v != nil {
cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable)
}
}
err := writer.WriteCollectionOfObjectValues("sharedColumns", cast)
if err != nil {
return err
}
}
{
err := writer.WriteBoolValue("shouldPrefixNameToFile", m.GetShouldPrefixNameToFile())
if err != nil {
return err
}
}
if m.GetWelcomePageColumns() != nil {
cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetWelcomePageColumns()))
for i, v := range m.GetWelcomePageColumns() {
if v != nil {
cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable)
}
}
err := writer.WriteCollectionOfObjectValues("welcomePageColumns", cast)
if err != nil {
return err
}
}
{
err := writer.WriteStringValue("welcomePageUrl", m.GetWelcomePageUrl())
if err != nil {
return err
}
}
{
err := writer.WriteAdditionalData(m.GetAdditionalData())
if err != nil {
return err
}
}
return nil
}
// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.
func (m *DocumentSet) SetAdditionalData(value map[string]any)() {
m.additionalData = value
}
// SetAllowedContentTypes sets the allowedContentTypes property value. Content types allowed in document set.
func (m *DocumentSet) SetAllowedContentTypes(value []ContentTypeInfoable)() {
m.allowedContentTypes = value
}
// SetDefaultContents sets the defaultContents property value. Default contents of document set.
func (m *DocumentSet) SetDefaultContents(value []DocumentSetContentable)() {
m.defaultContents = value
}
// SetOdataType sets the @odata.type property value. The OdataType property
func (m *DocumentSet) SetOdataType(value *string)() {
m.odataType = value
}
// SetPropagateWelcomePageChanges sets the propagateWelcomePageChanges property value. Specifies whether to push welcome page changes to inherited content types.
func (m *DocumentSet) SetPropagateWelcomePageChanges(value *bool)() {
m.propagateWelcomePageChanges = value
}
// SetSharedColumns sets the sharedColumns property value. The sharedColumns property
func (m *DocumentSet) SetSharedColumns(value []ColumnDefinitionable)() {
m.sharedColumns = value
}
// SetShouldPrefixNameToFile sets the shouldPrefixNameToFile property value. Indicates whether to add the name of the document set to each file name.
func (m *DocumentSet) SetShouldPrefixNameToFile(value *bool)() {
m.shouldPrefixNameToFile = value
}
// SetWelcomePageColumns sets the welcomePageColumns property value. The welcomePageColumns property
func (m *DocumentSet) SetWelcomePageColumns(value []ColumnDefinitionable)() {
m.welcomePageColumns = value
}
// SetWelcomePageUrl sets the welcomePageUrl property value. Welcome page absolute URL.
func (m *DocumentSet) SetWelcomePageUrl(value *string)() {
m.welcomePageUrl = value
}
// DocumentSetable
type DocumentSetable interface {
i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder
i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable
GetAllowedContentTypes()([]ContentTypeInfoable)
GetDefaultContents()([]DocumentSetContentable)
GetOdataType()(*string)
GetPropagateWelcomePageChanges()(*bool)
GetSharedColumns()([]ColumnDefinitionable)
GetShouldPrefixNameToFile()(*bool)
GetWelcomePageColumns()([]ColumnDefinitionable)
GetWelcomePageUrl()(*string)
SetAllowedContentTypes(value []ContentTypeInfoable)()
SetDefaultContents(value []DocumentSetContentable)()
SetOdataType(value *string)()
SetPropagateWelcomePageChanges(value *bool)()
SetSharedColumns(value []ColumnDefinitionable)()
SetShouldPrefixNameToFile(value *bool)()
SetWelcomePageColumns(value []ColumnDefinitionable)()
SetWelcomePageUrl(value *string)()
}