-
Notifications
You must be signed in to change notification settings - Fork 0
/
shared_insight.go
207 lines (205 loc) · 8.73 KB
/
shared_insight.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
package models
import (
i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization"
)
// SharedInsight
type SharedInsight struct {
Entity
// Details about the shared item. Read only.
lastShared SharingDetailable
// The lastSharedMethod property
lastSharedMethod Entityable
// Used for navigating to the item that was shared. For file attachments, the type is fileAttachment. For linked attachments, the type is driveItem.
resource Entityable
// Reference properties of the shared document, such as the url and type of the document. Read-only
resourceReference ResourceReferenceable
// Properties that you can use to visualize the document in your experience. Read-only
resourceVisualization ResourceVisualizationable
// The sharingHistory property
sharingHistory []SharingDetailable
}
// NewSharedInsight instantiates a new sharedInsight and sets the default values.
func NewSharedInsight()(*SharedInsight) {
m := &SharedInsight{
Entity: *NewEntity(),
}
return m
}
// CreateSharedInsightFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value
func CreateSharedInsightFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) {
return NewSharedInsight(), nil
}
// GetFieldDeserializers the deserialization information for the current model
func (m *SharedInsight) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) {
res := m.Entity.GetFieldDeserializers()
res["lastShared"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetObjectValue(CreateSharingDetailFromDiscriminatorValue)
if err != nil {
return err
}
if val != nil {
m.SetLastShared(val.(SharingDetailable))
}
return nil
}
res["lastSharedMethod"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetObjectValue(CreateEntityFromDiscriminatorValue)
if err != nil {
return err
}
if val != nil {
m.SetLastSharedMethod(val.(Entityable))
}
return nil
}
res["resource"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetObjectValue(CreateEntityFromDiscriminatorValue)
if err != nil {
return err
}
if val != nil {
m.SetResource(val.(Entityable))
}
return nil
}
res["resourceReference"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetObjectValue(CreateResourceReferenceFromDiscriminatorValue)
if err != nil {
return err
}
if val != nil {
m.SetResourceReference(val.(ResourceReferenceable))
}
return nil
}
res["resourceVisualization"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetObjectValue(CreateResourceVisualizationFromDiscriminatorValue)
if err != nil {
return err
}
if val != nil {
m.SetResourceVisualization(val.(ResourceVisualizationable))
}
return nil
}
res["sharingHistory"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetCollectionOfObjectValues(CreateSharingDetailFromDiscriminatorValue)
if err != nil {
return err
}
if val != nil {
res := make([]SharingDetailable, len(val))
for i, v := range val {
if v != nil {
res[i] = v.(SharingDetailable)
}
}
m.SetSharingHistory(res)
}
return nil
}
return res
}
// GetLastShared gets the lastShared property value. Details about the shared item. Read only.
func (m *SharedInsight) GetLastShared()(SharingDetailable) {
return m.lastShared
}
// GetLastSharedMethod gets the lastSharedMethod property value. The lastSharedMethod property
func (m *SharedInsight) GetLastSharedMethod()(Entityable) {
return m.lastSharedMethod
}
// GetResource gets the resource property value. Used for navigating to the item that was shared. For file attachments, the type is fileAttachment. For linked attachments, the type is driveItem.
func (m *SharedInsight) GetResource()(Entityable) {
return m.resource
}
// GetResourceReference gets the resourceReference property value. Reference properties of the shared document, such as the url and type of the document. Read-only
func (m *SharedInsight) GetResourceReference()(ResourceReferenceable) {
return m.resourceReference
}
// GetResourceVisualization gets the resourceVisualization property value. Properties that you can use to visualize the document in your experience. Read-only
func (m *SharedInsight) GetResourceVisualization()(ResourceVisualizationable) {
return m.resourceVisualization
}
// GetSharingHistory gets the sharingHistory property value. The sharingHistory property
func (m *SharedInsight) GetSharingHistory()([]SharingDetailable) {
return m.sharingHistory
}
// Serialize serializes information the current object
func (m *SharedInsight) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) {
err := m.Entity.Serialize(writer)
if err != nil {
return err
}
{
err = writer.WriteObjectValue("lastShared", m.GetLastShared())
if err != nil {
return err
}
}
{
err = writer.WriteObjectValue("lastSharedMethod", m.GetLastSharedMethod())
if err != nil {
return err
}
}
{
err = writer.WriteObjectValue("resource", m.GetResource())
if err != nil {
return err
}
}
if m.GetSharingHistory() != nil {
cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetSharingHistory()))
for i, v := range m.GetSharingHistory() {
if v != nil {
cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable)
}
}
err = writer.WriteCollectionOfObjectValues("sharingHistory", cast)
if err != nil {
return err
}
}
return nil
}
// SetLastShared sets the lastShared property value. Details about the shared item. Read only.
func (m *SharedInsight) SetLastShared(value SharingDetailable)() {
m.lastShared = value
}
// SetLastSharedMethod sets the lastSharedMethod property value. The lastSharedMethod property
func (m *SharedInsight) SetLastSharedMethod(value Entityable)() {
m.lastSharedMethod = value
}
// SetResource sets the resource property value. Used for navigating to the item that was shared. For file attachments, the type is fileAttachment. For linked attachments, the type is driveItem.
func (m *SharedInsight) SetResource(value Entityable)() {
m.resource = value
}
// SetResourceReference sets the resourceReference property value. Reference properties of the shared document, such as the url and type of the document. Read-only
func (m *SharedInsight) SetResourceReference(value ResourceReferenceable)() {
m.resourceReference = value
}
// SetResourceVisualization sets the resourceVisualization property value. Properties that you can use to visualize the document in your experience. Read-only
func (m *SharedInsight) SetResourceVisualization(value ResourceVisualizationable)() {
m.resourceVisualization = value
}
// SetSharingHistory sets the sharingHistory property value. The sharingHistory property
func (m *SharedInsight) SetSharingHistory(value []SharingDetailable)() {
m.sharingHistory = value
}
// SharedInsightable
type SharedInsightable interface {
Entityable
i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable
GetLastShared()(SharingDetailable)
GetLastSharedMethod()(Entityable)
GetResource()(Entityable)
GetResourceReference()(ResourceReferenceable)
GetResourceVisualization()(ResourceVisualizationable)
GetSharingHistory()([]SharingDetailable)
SetLastShared(value SharingDetailable)()
SetLastSharedMethod(value Entityable)()
SetResource(value Entityable)()
SetResourceReference(value ResourceReferenceable)()
SetResourceVisualization(value ResourceVisualizationable)()
SetSharingHistory(value []SharingDetailable)()
}