/
githubmirror
/
origin
Обзор
Документация
Войти
/
githubmirror
/
origin
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
vendor/github.com/microsoftgraph/msgraph-sdk-go/models/post.go
586 строк
22 KB
Justin Pierce
Add compat_otp package with openshift-tests-private (OTP) util implementations
11 авг 2025, 18:00
11 авг 2025, 18:00
80ac5c1
Код
Авторство
О чём код?
// Code generated by Microsoft Kiota - DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. package models import ( i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" ) type Post struct { OutlookItem } // NewPost instantiates a new Post and sets the default values. func NewPost()(*Post) { m := &Post{ OutlookItem: *NewOutlookItem(), } odataTypeValue := "#microsoft.graph.post" m.SetOdataType(&odataTypeValue) return m } // CreatePostFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value // returns a Parsable when successful func CreatePostFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { return NewPost(), nil } // GetAttachments gets the attachments property value. Read-only. Nullable. Supports $expand. // returns a []Attachmentable when successful func (m *Post) GetAttachments()([]Attachmentable) { val, err := m.GetBackingStore().Get("attachments") if err != nil { panic(err) } if val != nil { return val.([]Attachmentable) } return nil } // GetBody gets the body property value. The contents of the post. This is a default property. This property can be null. // returns a ItemBodyable when successful func (m *Post) GetBody()(ItemBodyable) { val, err := m.GetBackingStore().Get("body") if err != nil { panic(err) } if val != nil { return val.(ItemBodyable) } return nil } // GetConversationId gets the conversationId property value. Unique ID of the conversation. Read-only. // returns a *string when successful func (m *Post) GetConversationId()(*string) { val, err := m.GetBackingStore().Get("conversationId") if err != nil { panic(err) } if val != nil { return val.(*string) } return nil } // GetConversationThreadId gets the conversationThreadId property value. Unique ID of the conversation thread. Read-only. // returns a *string when successful func (m *Post) GetConversationThreadId()(*string) { val, err := m.GetBackingStore().Get("conversationThreadId") if err != nil { panic(err) } if val != nil { return val.(*string) } return nil } // GetExtensions gets the extensions property value. The collection of open extensions defined for the post. Read-only. Nullable. Supports $expand. // returns a []Extensionable when successful func (m *Post) GetExtensions()([]Extensionable) { val, err := m.GetBackingStore().Get("extensions") if err != nil { panic(err) } if val != nil { return val.([]Extensionable) } return nil } // GetFieldDeserializers the deserialization information for the current model // returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful func (m *Post) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { res := m.OutlookItem.GetFieldDeserializers() res["attachments"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetCollectionOfObjectValues(CreateAttachmentFromDiscriminatorValue) if err != nil { return err } if val != nil { res := make([]Attachmentable, len(val)) for i, v := range val { if v != nil { res[i] = v.(Attachmentable) } } m.SetAttachments(res) } return nil } res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetObjectValue(CreateItemBodyFromDiscriminatorValue) if err != nil { return err } if val != nil { m.SetBody(val.(ItemBodyable)) } return nil } res["conversationId"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetStringValue() if err != nil { return err } if val != nil { m.SetConversationId(val) } return nil } res["conversationThreadId"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetStringValue() if err != nil { return err } if val != nil { m.SetConversationThreadId(val) } return nil } res["extensions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetCollectionOfObjectValues(CreateExtensionFromDiscriminatorValue) if err != nil { return err } if val != nil { res := make([]Extensionable, len(val)) for i, v := range val { if v != nil { res[i] = v.(Extensionable) } } m.SetExtensions(res) } return nil } res["from"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetObjectValue(CreateRecipientFromDiscriminatorValue) if err != nil { return err } if val != nil { m.SetFrom(val.(Recipientable)) } return nil } res["hasAttachments"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetBoolValue() if err != nil { return err } if val != nil { m.SetHasAttachments(val) } return nil } res["inReplyTo"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetObjectValue(CreatePostFromDiscriminatorValue) if err != nil { return err } if val != nil { m.SetInReplyTo(val.(Postable)) } return nil } res["multiValueExtendedProperties"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetCollectionOfObjectValues(CreateMultiValueLegacyExtendedPropertyFromDiscriminatorValue) if err != nil { return err } if val != nil { res := make([]MultiValueLegacyExtendedPropertyable, len(val)) for i, v := range val { if v != nil { res[i] = v.(MultiValueLegacyExtendedPropertyable) } } m.SetMultiValueExtendedProperties(res) } return nil } res["newParticipants"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetCollectionOfObjectValues(CreateRecipientFromDiscriminatorValue) if err != nil { return err } if val != nil { res := make([]Recipientable, len(val)) for i, v := range val { if v != nil { res[i] = v.(Recipientable) } } m.SetNewParticipants(res) } return nil } res["receivedDateTime"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetTimeValue() if err != nil { return err } if val != nil { m.SetReceivedDateTime(val) } return nil } res["sender"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetObjectValue(CreateRecipientFromDiscriminatorValue) if err != nil { return err } if val != nil { m.SetSender(val.(Recipientable)) } return nil } res["singleValueExtendedProperties"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetCollectionOfObjectValues(CreateSingleValueLegacyExtendedPropertyFromDiscriminatorValue) if err != nil { return err } if val != nil { res := make([]SingleValueLegacyExtendedPropertyable, len(val)) for i, v := range val { if v != nil { res[i] = v.(SingleValueLegacyExtendedPropertyable) } } m.SetSingleValueExtendedProperties(res) } return nil } return res } // GetFrom gets the from property value. The from property // returns a Recipientable when successful func (m *Post) GetFrom()(Recipientable) { val, err := m.GetBackingStore().Get("from") if err != nil { panic(err) } if val != nil { return val.(Recipientable) } return nil } // GetHasAttachments gets the hasAttachments property value. Indicates whether the post has at least one attachment. This is a default property. // returns a *bool when successful func (m *Post) GetHasAttachments()(*bool) { val, err := m.GetBackingStore().Get("hasAttachments") if err != nil { panic(err) } if val != nil { return val.(*bool) } return nil } // GetInReplyTo gets the inReplyTo property value. Read-only. Supports $expand. // returns a Postable when successful func (m *Post) GetInReplyTo()(Postable) { val, err := m.GetBackingStore().Get("inReplyTo") if err != nil { panic(err) } if val != nil { return val.(Postable) } return nil } // GetMultiValueExtendedProperties gets the multiValueExtendedProperties property value. The collection of multi-value extended properties defined for the post. Read-only. Nullable. // returns a []MultiValueLegacyExtendedPropertyable when successful func (m *Post) GetMultiValueExtendedProperties()([]MultiValueLegacyExtendedPropertyable) { val, err := m.GetBackingStore().Get("multiValueExtendedProperties") if err != nil { panic(err) } if val != nil { return val.([]MultiValueLegacyExtendedPropertyable) } return nil } // GetNewParticipants gets the newParticipants property value. Conversation participants that were added to the thread as part of this post. // returns a []Recipientable when successful func (m *Post) GetNewParticipants()([]Recipientable) { val, err := m.GetBackingStore().Get("newParticipants") if err != nil { panic(err) } if val != nil { return val.([]Recipientable) } return nil } // GetReceivedDateTime gets the receivedDateTime property value. Specifies when the post was received. The DateTimeOffset type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z // returns a *Time when successful func (m *Post) GetReceivedDateTime()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { val, err := m.GetBackingStore().Get("receivedDateTime") if err != nil { panic(err) } if val != nil { return val.(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) } return nil } // GetSender gets the sender property value. Contains the address of the sender. The value of Sender is assumed to be the address of the authenticated user in the case when Sender is not specified. This is a default property. // returns a Recipientable when successful func (m *Post) GetSender()(Recipientable) { val, err := m.GetBackingStore().Get("sender") if err != nil { panic(err) } if val != nil { return val.(Recipientable) } return nil } // GetSingleValueExtendedProperties gets the singleValueExtendedProperties property value. The collection of single-value extended properties defined for the post. Read-only. Nullable. // returns a []SingleValueLegacyExtendedPropertyable when successful func (m *Post) GetSingleValueExtendedProperties()([]SingleValueLegacyExtendedPropertyable) { val, err := m.GetBackingStore().Get("singleValueExtendedProperties") if err != nil { panic(err) } if val != nil { return val.([]SingleValueLegacyExtendedPropertyable) } return nil } // Serialize serializes information the current object func (m *Post) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { err := m.OutlookItem.Serialize(writer) if err != nil { return err } if m.GetAttachments() != nil { cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetAttachments())) for i, v := range m.GetAttachments() { if v != nil { cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) } } err = writer.WriteCollectionOfObjectValues("attachments", cast) if err != nil { return err } } { err = writer.WriteObjectValue("body", m.GetBody()) if err != nil { return err } } { err = writer.WriteStringValue("conversationId", m.GetConversationId()) if err != nil { return err } } { err = writer.WriteStringValue("conversationThreadId", m.GetConversationThreadId()) if err != nil { return err } } if m.GetExtensions() != nil { cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetExtensions())) for i, v := range m.GetExtensions() { if v != nil { cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) } } err = writer.WriteCollectionOfObjectValues("extensions", cast) if err != nil { return err } } { err = writer.WriteObjectValue("from", m.GetFrom()) if err != nil { return err } } { err = writer.WriteBoolValue("hasAttachments", m.GetHasAttachments()) if err != nil { return err } } { err = writer.WriteObjectValue("inReplyTo", m.GetInReplyTo()) if err != nil { return err } } if m.GetMultiValueExtendedProperties() != nil { cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetMultiValueExtendedProperties())) for i, v := range m.GetMultiValueExtendedProperties() { if v != nil { cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) } } err = writer.WriteCollectionOfObjectValues("multiValueExtendedProperties", cast) if err != nil { return err } } if m.GetNewParticipants() != nil { cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetNewParticipants())) for i, v := range m.GetNewParticipants() { if v != nil { cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) } } err = writer.WriteCollectionOfObjectValues("newParticipants", cast) if err != nil { return err } } { err = writer.WriteTimeValue("receivedDateTime", m.GetReceivedDateTime()) if err != nil { return err } } { err = writer.WriteObjectValue("sender", m.GetSender()) if err != nil { return err } } if m.GetSingleValueExtendedProperties() != nil { cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetSingleValueExtendedProperties())) for i, v := range m.GetSingleValueExtendedProperties() { if v != nil { cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) } } err = writer.WriteCollectionOfObjectValues("singleValueExtendedProperties", cast) if err != nil { return err } } return nil } // SetAttachments sets the attachments property value. Read-only. Nullable. Supports $expand. func (m *Post) SetAttachments(value []Attachmentable)() { err := m.GetBackingStore().Set("attachments", value) if err != nil { panic(err) } } // SetBody sets the body property value. The contents of the post. This is a default property. This property can be null. func (m *Post) SetBody(value ItemBodyable)() { err := m.GetBackingStore().Set("body", value) if err != nil { panic(err) } } // SetConversationId sets the conversationId property value. Unique ID of the conversation. Read-only. func (m *Post) SetConversationId(value *string)() { err := m.GetBackingStore().Set("conversationId", value) if err != nil { panic(err) } } // SetConversationThreadId sets the conversationThreadId property value. Unique ID of the conversation thread. Read-only. func (m *Post) SetConversationThreadId(value *string)() { err := m.GetBackingStore().Set("conversationThreadId", value) if err != nil { panic(err) } } // SetExtensions sets the extensions property value. The collection of open extensions defined for the post. Read-only. Nullable. Supports $expand. func (m *Post) SetExtensions(value []Extensionable)() { err := m.GetBackingStore().Set("extensions", value) if err != nil { panic(err) } } // SetFrom sets the from property value. The from property func (m *Post) SetFrom(value Recipientable)() { err := m.GetBackingStore().Set("from", value) if err != nil { panic(err) } } // SetHasAttachments sets the hasAttachments property value. Indicates whether the post has at least one attachment. This is a default property. func (m *Post) SetHasAttachments(value *bool)() { err := m.GetBackingStore().Set("hasAttachments", value) if err != nil { panic(err) } } // SetInReplyTo sets the inReplyTo property value. Read-only. Supports $expand. func (m *Post) SetInReplyTo(value Postable)() { err := m.GetBackingStore().Set("inReplyTo", value) if err != nil { panic(err) } } // SetMultiValueExtendedProperties sets the multiValueExtendedProperties property value. The collection of multi-value extended properties defined for the post. Read-only. Nullable. func (m *Post) SetMultiValueExtendedProperties(value []MultiValueLegacyExtendedPropertyable)() { err := m.GetBackingStore().Set("multiValueExtendedProperties", value) if err != nil { panic(err) } } // SetNewParticipants sets the newParticipants property value. Conversation participants that were added to the thread as part of this post. func (m *Post) SetNewParticipants(value []Recipientable)() { err := m.GetBackingStore().Set("newParticipants", value) if err != nil { panic(err) } } // SetReceivedDateTime sets the receivedDateTime property value. Specifies when the post was received. The DateTimeOffset type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z func (m *Post) SetReceivedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { err := m.GetBackingStore().Set("receivedDateTime", value) if err != nil { panic(err) } } // SetSender sets the sender property value. Contains the address of the sender. The value of Sender is assumed to be the address of the authenticated user in the case when Sender is not specified. This is a default property. func (m *Post) SetSender(value Recipientable)() { err := m.GetBackingStore().Set("sender", value) if err != nil { panic(err) } } // SetSingleValueExtendedProperties sets the singleValueExtendedProperties property value. The collection of single-value extended properties defined for the post. Read-only. Nullable. func (m *Post) SetSingleValueExtendedProperties(value []SingleValueLegacyExtendedPropertyable)() { err := m.GetBackingStore().Set("singleValueExtendedProperties", value) if err != nil { panic(err) } } type Postable interface { OutlookItemable i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable GetAttachments()([]Attachmentable) GetBody()(ItemBodyable) GetConversationId()(*string) GetConversationThreadId()(*string) GetExtensions()([]Extensionable) GetFrom()(Recipientable) GetHasAttachments()(*bool) GetInReplyTo()(Postable) GetMultiValueExtendedProperties()([]MultiValueLegacyExtendedPropertyable) GetNewParticipants()([]Recipientable) GetReceivedDateTime()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) GetSender()(Recipientable) GetSingleValueExtendedProperties()([]SingleValueLegacyExtendedPropertyable) SetAttachments(value []Attachmentable)() SetBody(value ItemBodyable)() SetConversationId(value *string)() SetConversationThreadId(value *string)() SetExtensions(value []Extensionable)() SetFrom(value Recipientable)() SetHasAttachments(value *bool)() SetInReplyTo(value Postable)() SetMultiValueExtendedProperties(value []MultiValueLegacyExtendedPropertyable)() SetNewParticipants(value []Recipientable)() SetReceivedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() SetSender(value Recipientable)() SetSingleValueExtendedProperties(value []SingleValueLegacyExtendedPropertyable)() }