-
Notifications
You must be signed in to change notification settings - Fork 0
/
presence.go
123 lines (121 loc) · 5.32 KB
/
presence.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
package models
import (
i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization"
)
// Presence
type Presence struct {
Entity
// The supplemental information to a user's availability. Possible values are Available, Away, BeRightBack, Busy, DoNotDisturb, InACall, InAConferenceCall, Inactive, InAMeeting, Offline, OffWork, OutOfOffice, PresenceUnknown, Presenting, UrgentInterruptionsOnly.
activity *string
// The base presence information for a user. Possible values are Available, AvailableIdle, Away, BeRightBack, Busy, BusyIdle, DoNotDisturb, Offline, PresenceUnknown
availability *string
// The presence status message of a user.
statusMessage PresenceStatusMessageable
}
// NewPresence instantiates a new presence and sets the default values.
func NewPresence()(*Presence) {
m := &Presence{
Entity: *NewEntity(),
}
return m
}
// CreatePresenceFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value
func CreatePresenceFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) {
return NewPresence(), nil
}
// GetActivity gets the activity property value. The supplemental information to a user's availability. Possible values are Available, Away, BeRightBack, Busy, DoNotDisturb, InACall, InAConferenceCall, Inactive, InAMeeting, Offline, OffWork, OutOfOffice, PresenceUnknown, Presenting, UrgentInterruptionsOnly.
func (m *Presence) GetActivity()(*string) {
return m.activity
}
// GetAvailability gets the availability property value. The base presence information for a user. Possible values are Available, AvailableIdle, Away, BeRightBack, Busy, BusyIdle, DoNotDisturb, Offline, PresenceUnknown
func (m *Presence) GetAvailability()(*string) {
return m.availability
}
// GetFieldDeserializers the deserialization information for the current model
func (m *Presence) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) {
res := m.Entity.GetFieldDeserializers()
res["activity"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetStringValue()
if err != nil {
return err
}
if val != nil {
m.SetActivity(val)
}
return nil
}
res["availability"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetStringValue()
if err != nil {
return err
}
if val != nil {
m.SetAvailability(val)
}
return nil
}
res["statusMessage"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetObjectValue(CreatePresenceStatusMessageFromDiscriminatorValue)
if err != nil {
return err
}
if val != nil {
m.SetStatusMessage(val.(PresenceStatusMessageable))
}
return nil
}
return res
}
// GetStatusMessage gets the statusMessage property value. The presence status message of a user.
func (m *Presence) GetStatusMessage()(PresenceStatusMessageable) {
return m.statusMessage
}
// Serialize serializes information the current object
func (m *Presence) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) {
err := m.Entity.Serialize(writer)
if err != nil {
return err
}
{
err = writer.WriteStringValue("activity", m.GetActivity())
if err != nil {
return err
}
}
{
err = writer.WriteStringValue("availability", m.GetAvailability())
if err != nil {
return err
}
}
{
err = writer.WriteObjectValue("statusMessage", m.GetStatusMessage())
if err != nil {
return err
}
}
return nil
}
// SetActivity sets the activity property value. The supplemental information to a user's availability. Possible values are Available, Away, BeRightBack, Busy, DoNotDisturb, InACall, InAConferenceCall, Inactive, InAMeeting, Offline, OffWork, OutOfOffice, PresenceUnknown, Presenting, UrgentInterruptionsOnly.
func (m *Presence) SetActivity(value *string)() {
m.activity = value
}
// SetAvailability sets the availability property value. The base presence information for a user. Possible values are Available, AvailableIdle, Away, BeRightBack, Busy, BusyIdle, DoNotDisturb, Offline, PresenceUnknown
func (m *Presence) SetAvailability(value *string)() {
m.availability = value
}
// SetStatusMessage sets the statusMessage property value. The presence status message of a user.
func (m *Presence) SetStatusMessage(value PresenceStatusMessageable)() {
m.statusMessage = value
}
// Presenceable
type Presenceable interface {
Entityable
i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable
GetActivity()(*string)
GetAvailability()(*string)
GetStatusMessage()(PresenceStatusMessageable)
SetActivity(value *string)()
SetAvailability(value *string)()
SetStatusMessage(value PresenceStatusMessageable)()
}