-
Notifications
You must be signed in to change notification settings - Fork 32
/
temporary_access_pass_authentication_method_configuration.go
275 lines (273 loc) · 11.8 KB
/
temporary_access_pass_authentication_method_configuration.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
package models
import (
i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization"
)
type TemporaryAccessPassAuthenticationMethodConfiguration struct {
AuthenticationMethodConfiguration
}
// NewTemporaryAccessPassAuthenticationMethodConfiguration instantiates a new TemporaryAccessPassAuthenticationMethodConfiguration and sets the default values.
func NewTemporaryAccessPassAuthenticationMethodConfiguration()(*TemporaryAccessPassAuthenticationMethodConfiguration) {
m := &TemporaryAccessPassAuthenticationMethodConfiguration{
AuthenticationMethodConfiguration: *NewAuthenticationMethodConfiguration(),
}
odataTypeValue := "#microsoft.graph.temporaryAccessPassAuthenticationMethodConfiguration"
m.SetOdataType(&odataTypeValue)
return m
}
// CreateTemporaryAccessPassAuthenticationMethodConfigurationFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value
// returns a Parsable when successful
func CreateTemporaryAccessPassAuthenticationMethodConfigurationFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) {
return NewTemporaryAccessPassAuthenticationMethodConfiguration(), nil
}
// GetDefaultLength gets the defaultLength property value. Default length in characters of a Temporary Access Pass object. Must be between 8 and 48 characters.
// returns a *int32 when successful
func (m *TemporaryAccessPassAuthenticationMethodConfiguration) GetDefaultLength()(*int32) {
val, err := m.GetBackingStore().Get("defaultLength")
if err != nil {
panic(err)
}
if val != nil {
return val.(*int32)
}
return nil
}
// GetDefaultLifetimeInMinutes gets the defaultLifetimeInMinutes property value. Default lifetime in minutes for a Temporary Access Pass. Value can be any integer between the minimumLifetimeInMinutes and maximumLifetimeInMinutes.
// returns a *int32 when successful
func (m *TemporaryAccessPassAuthenticationMethodConfiguration) GetDefaultLifetimeInMinutes()(*int32) {
val, err := m.GetBackingStore().Get("defaultLifetimeInMinutes")
if err != nil {
panic(err)
}
if val != nil {
return val.(*int32)
}
return nil
}
// GetFieldDeserializers the deserialization information for the current model
// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful
func (m *TemporaryAccessPassAuthenticationMethodConfiguration) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) {
res := m.AuthenticationMethodConfiguration.GetFieldDeserializers()
res["defaultLength"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetInt32Value()
if err != nil {
return err
}
if val != nil {
m.SetDefaultLength(val)
}
return nil
}
res["defaultLifetimeInMinutes"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetInt32Value()
if err != nil {
return err
}
if val != nil {
m.SetDefaultLifetimeInMinutes(val)
}
return nil
}
res["includeTargets"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetCollectionOfObjectValues(CreateAuthenticationMethodTargetFromDiscriminatorValue)
if err != nil {
return err
}
if val != nil {
res := make([]AuthenticationMethodTargetable, len(val))
for i, v := range val {
if v != nil {
res[i] = v.(AuthenticationMethodTargetable)
}
}
m.SetIncludeTargets(res)
}
return nil
}
res["isUsableOnce"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetBoolValue()
if err != nil {
return err
}
if val != nil {
m.SetIsUsableOnce(val)
}
return nil
}
res["maximumLifetimeInMinutes"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetInt32Value()
if err != nil {
return err
}
if val != nil {
m.SetMaximumLifetimeInMinutes(val)
}
return nil
}
res["minimumLifetimeInMinutes"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetInt32Value()
if err != nil {
return err
}
if val != nil {
m.SetMinimumLifetimeInMinutes(val)
}
return nil
}
return res
}
// GetIncludeTargets gets the includeTargets property value. A collection of groups that are enabled to use the authentication method.
// returns a []AuthenticationMethodTargetable when successful
func (m *TemporaryAccessPassAuthenticationMethodConfiguration) GetIncludeTargets()([]AuthenticationMethodTargetable) {
val, err := m.GetBackingStore().Get("includeTargets")
if err != nil {
panic(err)
}
if val != nil {
return val.([]AuthenticationMethodTargetable)
}
return nil
}
// GetIsUsableOnce gets the isUsableOnce property value. If true, all the passes in the tenant will be restricted to one-time use. If false, passes in the tenant can be created to be either one-time use or reusable.
// returns a *bool when successful
func (m *TemporaryAccessPassAuthenticationMethodConfiguration) GetIsUsableOnce()(*bool) {
val, err := m.GetBackingStore().Get("isUsableOnce")
if err != nil {
panic(err)
}
if val != nil {
return val.(*bool)
}
return nil
}
// GetMaximumLifetimeInMinutes gets the maximumLifetimeInMinutes property value. Maximum lifetime in minutes for any Temporary Access Pass created in the tenant. Value can be between 10 and 43200 minutes (equivalent to 30 days).
// returns a *int32 when successful
func (m *TemporaryAccessPassAuthenticationMethodConfiguration) GetMaximumLifetimeInMinutes()(*int32) {
val, err := m.GetBackingStore().Get("maximumLifetimeInMinutes")
if err != nil {
panic(err)
}
if val != nil {
return val.(*int32)
}
return nil
}
// GetMinimumLifetimeInMinutes gets the minimumLifetimeInMinutes property value. Minimum lifetime in minutes for any Temporary Access Pass created in the tenant. Value can be between 10 and 43200 minutes (equivalent to 30 days).
// returns a *int32 when successful
func (m *TemporaryAccessPassAuthenticationMethodConfiguration) GetMinimumLifetimeInMinutes()(*int32) {
val, err := m.GetBackingStore().Get("minimumLifetimeInMinutes")
if err != nil {
panic(err)
}
if val != nil {
return val.(*int32)
}
return nil
}
// Serialize serializes information the current object
func (m *TemporaryAccessPassAuthenticationMethodConfiguration) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) {
err := m.AuthenticationMethodConfiguration.Serialize(writer)
if err != nil {
return err
}
{
err = writer.WriteInt32Value("defaultLength", m.GetDefaultLength())
if err != nil {
return err
}
}
{
err = writer.WriteInt32Value("defaultLifetimeInMinutes", m.GetDefaultLifetimeInMinutes())
if err != nil {
return err
}
}
if m.GetIncludeTargets() != nil {
cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetIncludeTargets()))
for i, v := range m.GetIncludeTargets() {
if v != nil {
cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable)
}
}
err = writer.WriteCollectionOfObjectValues("includeTargets", cast)
if err != nil {
return err
}
}
{
err = writer.WriteBoolValue("isUsableOnce", m.GetIsUsableOnce())
if err != nil {
return err
}
}
{
err = writer.WriteInt32Value("maximumLifetimeInMinutes", m.GetMaximumLifetimeInMinutes())
if err != nil {
return err
}
}
{
err = writer.WriteInt32Value("minimumLifetimeInMinutes", m.GetMinimumLifetimeInMinutes())
if err != nil {
return err
}
}
return nil
}
// SetDefaultLength sets the defaultLength property value. Default length in characters of a Temporary Access Pass object. Must be between 8 and 48 characters.
func (m *TemporaryAccessPassAuthenticationMethodConfiguration) SetDefaultLength(value *int32)() {
err := m.GetBackingStore().Set("defaultLength", value)
if err != nil {
panic(err)
}
}
// SetDefaultLifetimeInMinutes sets the defaultLifetimeInMinutes property value. Default lifetime in minutes for a Temporary Access Pass. Value can be any integer between the minimumLifetimeInMinutes and maximumLifetimeInMinutes.
func (m *TemporaryAccessPassAuthenticationMethodConfiguration) SetDefaultLifetimeInMinutes(value *int32)() {
err := m.GetBackingStore().Set("defaultLifetimeInMinutes", value)
if err != nil {
panic(err)
}
}
// SetIncludeTargets sets the includeTargets property value. A collection of groups that are enabled to use the authentication method.
func (m *TemporaryAccessPassAuthenticationMethodConfiguration) SetIncludeTargets(value []AuthenticationMethodTargetable)() {
err := m.GetBackingStore().Set("includeTargets", value)
if err != nil {
panic(err)
}
}
// SetIsUsableOnce sets the isUsableOnce property value. If true, all the passes in the tenant will be restricted to one-time use. If false, passes in the tenant can be created to be either one-time use or reusable.
func (m *TemporaryAccessPassAuthenticationMethodConfiguration) SetIsUsableOnce(value *bool)() {
err := m.GetBackingStore().Set("isUsableOnce", value)
if err != nil {
panic(err)
}
}
// SetMaximumLifetimeInMinutes sets the maximumLifetimeInMinutes property value. Maximum lifetime in minutes for any Temporary Access Pass created in the tenant. Value can be between 10 and 43200 minutes (equivalent to 30 days).
func (m *TemporaryAccessPassAuthenticationMethodConfiguration) SetMaximumLifetimeInMinutes(value *int32)() {
err := m.GetBackingStore().Set("maximumLifetimeInMinutes", value)
if err != nil {
panic(err)
}
}
// SetMinimumLifetimeInMinutes sets the minimumLifetimeInMinutes property value. Minimum lifetime in minutes for any Temporary Access Pass created in the tenant. Value can be between 10 and 43200 minutes (equivalent to 30 days).
func (m *TemporaryAccessPassAuthenticationMethodConfiguration) SetMinimumLifetimeInMinutes(value *int32)() {
err := m.GetBackingStore().Set("minimumLifetimeInMinutes", value)
if err != nil {
panic(err)
}
}
type TemporaryAccessPassAuthenticationMethodConfigurationable interface {
AuthenticationMethodConfigurationable
i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable
GetDefaultLength()(*int32)
GetDefaultLifetimeInMinutes()(*int32)
GetIncludeTargets()([]AuthenticationMethodTargetable)
GetIsUsableOnce()(*bool)
GetMaximumLifetimeInMinutes()(*int32)
GetMinimumLifetimeInMinutes()(*int32)
SetDefaultLength(value *int32)()
SetDefaultLifetimeInMinutes(value *int32)()
SetIncludeTargets(value []AuthenticationMethodTargetable)()
SetIsUsableOnce(value *bool)()
SetMaximumLifetimeInMinutes(value *int32)()
SetMinimumLifetimeInMinutes(value *int32)()
}