-
Notifications
You must be signed in to change notification settings - Fork 38
/
Copy pathapp_consent_request.go
211 lines (209 loc) · 7.99 KB
/
app_consent_request.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
package models
import (
i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization"
)
type AppConsentRequest struct {
Entity
}
// NewAppConsentRequest instantiates a new AppConsentRequest and sets the default values.
func NewAppConsentRequest()(*AppConsentRequest) {
m := &AppConsentRequest{
Entity: *NewEntity(),
}
return m
}
// CreateAppConsentRequestFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value
// returns a Parsable when successful
func CreateAppConsentRequestFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) {
return NewAppConsentRequest(), nil
}
// GetAppDisplayName gets the appDisplayName property value. The display name of the app for which consent is requested. Required. Supports $filter (eq only) and $orderby.
// returns a *string when successful
func (m *AppConsentRequest) GetAppDisplayName()(*string) {
val, err := m.GetBackingStore().Get("appDisplayName")
if err != nil {
panic(err)
}
if val != nil {
return val.(*string)
}
return nil
}
// GetAppId gets the appId property value. The identifier of the application. Required. Supports $filter (eq only) and $orderby.
// returns a *string when successful
func (m *AppConsentRequest) GetAppId()(*string) {
val, err := m.GetBackingStore().Get("appId")
if err != nil {
panic(err)
}
if val != nil {
return val.(*string)
}
return nil
}
// GetFieldDeserializers the deserialization information for the current model
// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful
func (m *AppConsentRequest) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) {
res := m.Entity.GetFieldDeserializers()
res["appDisplayName"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetStringValue()
if err != nil {
return err
}
if val != nil {
m.SetAppDisplayName(val)
}
return nil
}
res["appId"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetStringValue()
if err != nil {
return err
}
if val != nil {
m.SetAppId(val)
}
return nil
}
res["pendingScopes"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetCollectionOfObjectValues(CreateAppConsentRequestScopeFromDiscriminatorValue)
if err != nil {
return err
}
if val != nil {
res := make([]AppConsentRequestScopeable, len(val))
for i, v := range val {
if v != nil {
res[i] = v.(AppConsentRequestScopeable)
}
}
m.SetPendingScopes(res)
}
return nil
}
res["userConsentRequests"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetCollectionOfObjectValues(CreateUserConsentRequestFromDiscriminatorValue)
if err != nil {
return err
}
if val != nil {
res := make([]UserConsentRequestable, len(val))
for i, v := range val {
if v != nil {
res[i] = v.(UserConsentRequestable)
}
}
m.SetUserConsentRequests(res)
}
return nil
}
return res
}
// GetPendingScopes gets the pendingScopes property value. A list of pending scopes waiting for approval. Required.
// returns a []AppConsentRequestScopeable when successful
func (m *AppConsentRequest) GetPendingScopes()([]AppConsentRequestScopeable) {
val, err := m.GetBackingStore().Get("pendingScopes")
if err != nil {
panic(err)
}
if val != nil {
return val.([]AppConsentRequestScopeable)
}
return nil
}
// GetUserConsentRequests gets the userConsentRequests property value. A list of pending user consent requests. Supports $filter (eq).
// returns a []UserConsentRequestable when successful
func (m *AppConsentRequest) GetUserConsentRequests()([]UserConsentRequestable) {
val, err := m.GetBackingStore().Get("userConsentRequests")
if err != nil {
panic(err)
}
if val != nil {
return val.([]UserConsentRequestable)
}
return nil
}
// Serialize serializes information the current object
func (m *AppConsentRequest) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) {
err := m.Entity.Serialize(writer)
if err != nil {
return err
}
{
err = writer.WriteStringValue("appDisplayName", m.GetAppDisplayName())
if err != nil {
return err
}
}
{
err = writer.WriteStringValue("appId", m.GetAppId())
if err != nil {
return err
}
}
if m.GetPendingScopes() != nil {
cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetPendingScopes()))
for i, v := range m.GetPendingScopes() {
if v != nil {
cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable)
}
}
err = writer.WriteCollectionOfObjectValues("pendingScopes", cast)
if err != nil {
return err
}
}
if m.GetUserConsentRequests() != nil {
cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetUserConsentRequests()))
for i, v := range m.GetUserConsentRequests() {
if v != nil {
cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable)
}
}
err = writer.WriteCollectionOfObjectValues("userConsentRequests", cast)
if err != nil {
return err
}
}
return nil
}
// SetAppDisplayName sets the appDisplayName property value. The display name of the app for which consent is requested. Required. Supports $filter (eq only) and $orderby.
func (m *AppConsentRequest) SetAppDisplayName(value *string)() {
err := m.GetBackingStore().Set("appDisplayName", value)
if err != nil {
panic(err)
}
}
// SetAppId sets the appId property value. The identifier of the application. Required. Supports $filter (eq only) and $orderby.
func (m *AppConsentRequest) SetAppId(value *string)() {
err := m.GetBackingStore().Set("appId", value)
if err != nil {
panic(err)
}
}
// SetPendingScopes sets the pendingScopes property value. A list of pending scopes waiting for approval. Required.
func (m *AppConsentRequest) SetPendingScopes(value []AppConsentRequestScopeable)() {
err := m.GetBackingStore().Set("pendingScopes", value)
if err != nil {
panic(err)
}
}
// SetUserConsentRequests sets the userConsentRequests property value. A list of pending user consent requests. Supports $filter (eq).
func (m *AppConsentRequest) SetUserConsentRequests(value []UserConsentRequestable)() {
err := m.GetBackingStore().Set("userConsentRequests", value)
if err != nil {
panic(err)
}
}
type AppConsentRequestable interface {
Entityable
i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable
GetAppDisplayName()(*string)
GetAppId()(*string)
GetPendingScopes()([]AppConsentRequestScopeable)
GetUserConsentRequests()([]UserConsentRequestable)
SetAppDisplayName(value *string)()
SetAppId(value *string)()
SetPendingScopes(value []AppConsentRequestScopeable)()
SetUserConsentRequests(value []UserConsentRequestable)()
}