/
githubmirror
/
origin
Обзор
Документация
Войти
/
githubmirror
/
origin
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
vendor/github.com/microsoftgraph/msgraph-sdk-go/models/ai_interaction.go
610 строк
21 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 AiInteraction struct { Entity } // NewAiInteraction instantiates a new AiInteraction and sets the default values. func NewAiInteraction()(*AiInteraction) { m := &AiInteraction{ Entity: *NewEntity(), } return m } // CreateAiInteractionFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value // returns a Parsable when successful func CreateAiInteractionFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { return NewAiInteraction(), nil } // GetAppClass gets the appClass property value. The data source for Copilot data. For example, IPM.SkypeTeams.Message.Copilot.Excel or IPM.SkypeTeams.Message.Copilot.Loop. // returns a *string when successful func (m *AiInteraction) GetAppClass()(*string) { val, err := m.GetBackingStore().Get("appClass") if err != nil { panic(err) } if val != nil { return val.(*string) } return nil } // GetAttachments gets the attachments property value. The collection of documents attached to the interaction, such as cards and images. // returns a []AiInteractionAttachmentable when successful func (m *AiInteraction) GetAttachments()([]AiInteractionAttachmentable) { val, err := m.GetBackingStore().Get("attachments") if err != nil { panic(err) } if val != nil { return val.([]AiInteractionAttachmentable) } return nil } // GetBody gets the body property value. The body of the message, including the text of the body and its body type. // returns a ItemBodyable when successful func (m *AiInteraction) GetBody()(ItemBodyable) { val, err := m.GetBackingStore().Get("body") if err != nil { panic(err) } if val != nil { return val.(ItemBodyable) } return nil } // GetContexts gets the contexts property value. The identifer that maps to all contexts associated with an interaction. // returns a []AiInteractionContextable when successful func (m *AiInteraction) GetContexts()([]AiInteractionContextable) { val, err := m.GetBackingStore().Get("contexts") if err != nil { panic(err) } if val != nil { return val.([]AiInteractionContextable) } return nil } // GetConversationType gets the conversationType property value. The type of the conversation. For example, appchat or bizchat. // returns a *string when successful func (m *AiInteraction) GetConversationType()(*string) { val, err := m.GetBackingStore().Get("conversationType") if err != nil { panic(err) } if val != nil { return val.(*string) } return nil } // GetCreatedDateTime gets the createdDateTime property value. The time when the interaction was created. // returns a *Time when successful func (m *AiInteraction) GetCreatedDateTime()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { val, err := m.GetBackingStore().Get("createdDateTime") if err != nil { panic(err) } if val != nil { return val.(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) } return nil } // GetEtag gets the etag property value. The timestamp of when the interaction was last modified. // returns a *string when successful func (m *AiInteraction) GetEtag()(*string) { val, err := m.GetBackingStore().Get("etag") 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 *AiInteraction) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { res := m.Entity.GetFieldDeserializers() res["appClass"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetStringValue() if err != nil { return err } if val != nil { m.SetAppClass(val) } return nil } res["attachments"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetCollectionOfObjectValues(CreateAiInteractionAttachmentFromDiscriminatorValue) if err != nil { return err } if val != nil { res := make([]AiInteractionAttachmentable, len(val)) for i, v := range val { if v != nil { res[i] = v.(AiInteractionAttachmentable) } } 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["contexts"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetCollectionOfObjectValues(CreateAiInteractionContextFromDiscriminatorValue) if err != nil { return err } if val != nil { res := make([]AiInteractionContextable, len(val)) for i, v := range val { if v != nil { res[i] = v.(AiInteractionContextable) } } m.SetContexts(res) } return nil } res["conversationType"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetStringValue() if err != nil { return err } if val != nil { m.SetConversationType(val) } return nil } res["createdDateTime"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetTimeValue() if err != nil { return err } if val != nil { m.SetCreatedDateTime(val) } return nil } res["etag"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetStringValue() if err != nil { return err } if val != nil { m.SetEtag(val) } return nil } res["from"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetObjectValue(CreateIdentitySetFromDiscriminatorValue) if err != nil { return err } if val != nil { m.SetFrom(val.(IdentitySetable)) } return nil } res["interactionType"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetEnumValue(ParseAiInteractionType) if err != nil { return err } if val != nil { m.SetInteractionType(val.(*AiInteractionType)) } return nil } res["links"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetCollectionOfObjectValues(CreateAiInteractionLinkFromDiscriminatorValue) if err != nil { return err } if val != nil { res := make([]AiInteractionLinkable, len(val)) for i, v := range val { if v != nil { res[i] = v.(AiInteractionLinkable) } } m.SetLinks(res) } return nil } res["locale"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetStringValue() if err != nil { return err } if val != nil { m.SetLocale(val) } return nil } res["mentions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetCollectionOfObjectValues(CreateAiInteractionMentionFromDiscriminatorValue) if err != nil { return err } if val != nil { res := make([]AiInteractionMentionable, len(val)) for i, v := range val { if v != nil { res[i] = v.(AiInteractionMentionable) } } m.SetMentions(res) } return nil } res["requestId"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetStringValue() if err != nil { return err } if val != nil { m.SetRequestId(val) } return nil } res["sessionId"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetStringValue() if err != nil { return err } if val != nil { m.SetSessionId(val) } return nil } return res } // GetFrom gets the from property value. The from property // returns a IdentitySetable when successful func (m *AiInteraction) GetFrom()(IdentitySetable) { val, err := m.GetBackingStore().Get("from") if err != nil { panic(err) } if val != nil { return val.(IdentitySetable) } return nil } // GetInteractionType gets the interactionType property value. The interactionType property // returns a *AiInteractionType when successful func (m *AiInteraction) GetInteractionType()(*AiInteractionType) { val, err := m.GetBackingStore().Get("interactionType") if err != nil { panic(err) } if val != nil { return val.(*AiInteractionType) } return nil } // GetLinks gets the links property value. The collection of links that appear in the interaction. // returns a []AiInteractionLinkable when successful func (m *AiInteraction) GetLinks()([]AiInteractionLinkable) { val, err := m.GetBackingStore().Get("links") if err != nil { panic(err) } if val != nil { return val.([]AiInteractionLinkable) } return nil } // GetLocale gets the locale property value. The locale of the sender. // returns a *string when successful func (m *AiInteraction) GetLocale()(*string) { val, err := m.GetBackingStore().Get("locale") if err != nil { panic(err) } if val != nil { return val.(*string) } return nil } // GetMentions gets the mentions property value. The collection of the entities that were mentioned in the interaction, including users, bots, and so on. // returns a []AiInteractionMentionable when successful func (m *AiInteraction) GetMentions()([]AiInteractionMentionable) { val, err := m.GetBackingStore().Get("mentions") if err != nil { panic(err) } if val != nil { return val.([]AiInteractionMentionable) } return nil } // GetRequestId gets the requestId property value. The identifier that groups a user prompt with its Copilot response. // returns a *string when successful func (m *AiInteraction) GetRequestId()(*string) { val, err := m.GetBackingStore().Get("requestId") if err != nil { panic(err) } if val != nil { return val.(*string) } return nil } // GetSessionId gets the sessionId property value. The thread ID or conversation identifier that maps to all Copilot sessions for the user. // returns a *string when successful func (m *AiInteraction) GetSessionId()(*string) { val, err := m.GetBackingStore().Get("sessionId") if err != nil { panic(err) } if val != nil { return val.(*string) } return nil } // Serialize serializes information the current object func (m *AiInteraction) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { err := m.Entity.Serialize(writer) if err != nil { return err } { err = writer.WriteStringValue("appClass", m.GetAppClass()) 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 } } if m.GetContexts() != nil { cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetContexts())) for i, v := range m.GetContexts() { if v != nil { cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) } } err = writer.WriteCollectionOfObjectValues("contexts", cast) if err != nil { return err } } { err = writer.WriteStringValue("conversationType", m.GetConversationType()) if err != nil { return err } } { err = writer.WriteTimeValue("createdDateTime", m.GetCreatedDateTime()) if err != nil { return err } } { err = writer.WriteStringValue("etag", m.GetEtag()) if err != nil { return err } } { err = writer.WriteObjectValue("from", m.GetFrom()) if err != nil { return err } } if m.GetInteractionType() != nil { cast := (*m.GetInteractionType()).String() err = writer.WriteStringValue("interactionType", &cast) if err != nil { return err } } if m.GetLinks() != nil { cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetLinks())) for i, v := range m.GetLinks() { if v != nil { cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) } } err = writer.WriteCollectionOfObjectValues("links", cast) if err != nil { return err } } { err = writer.WriteStringValue("locale", m.GetLocale()) if err != nil { return err } } if m.GetMentions() != nil { cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetMentions())) for i, v := range m.GetMentions() { if v != nil { cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) } } err = writer.WriteCollectionOfObjectValues("mentions", cast) if err != nil { return err } } { err = writer.WriteStringValue("requestId", m.GetRequestId()) if err != nil { return err } } { err = writer.WriteStringValue("sessionId", m.GetSessionId()) if err != nil { return err } } return nil } // SetAppClass sets the appClass property value. The data source for Copilot data. For example, IPM.SkypeTeams.Message.Copilot.Excel or IPM.SkypeTeams.Message.Copilot.Loop. func (m *AiInteraction) SetAppClass(value *string)() { err := m.GetBackingStore().Set("appClass", value) if err != nil { panic(err) } } // SetAttachments sets the attachments property value. The collection of documents attached to the interaction, such as cards and images. func (m *AiInteraction) SetAttachments(value []AiInteractionAttachmentable)() { err := m.GetBackingStore().Set("attachments", value) if err != nil { panic(err) } } // SetBody sets the body property value. The body of the message, including the text of the body and its body type. func (m *AiInteraction) SetBody(value ItemBodyable)() { err := m.GetBackingStore().Set("body", value) if err != nil { panic(err) } } // SetContexts sets the contexts property value. The identifer that maps to all contexts associated with an interaction. func (m *AiInteraction) SetContexts(value []AiInteractionContextable)() { err := m.GetBackingStore().Set("contexts", value) if err != nil { panic(err) } } // SetConversationType sets the conversationType property value. The type of the conversation. For example, appchat or bizchat. func (m *AiInteraction) SetConversationType(value *string)() { err := m.GetBackingStore().Set("conversationType", value) if err != nil { panic(err) } } // SetCreatedDateTime sets the createdDateTime property value. The time when the interaction was created. func (m *AiInteraction) SetCreatedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { err := m.GetBackingStore().Set("createdDateTime", value) if err != nil { panic(err) } } // SetEtag sets the etag property value. The timestamp of when the interaction was last modified. func (m *AiInteraction) SetEtag(value *string)() { err := m.GetBackingStore().Set("etag", value) if err != nil { panic(err) } } // SetFrom sets the from property value. The from property func (m *AiInteraction) SetFrom(value IdentitySetable)() { err := m.GetBackingStore().Set("from", value) if err != nil { panic(err) } } // SetInteractionType sets the interactionType property value. The interactionType property func (m *AiInteraction) SetInteractionType(value *AiInteractionType)() { err := m.GetBackingStore().Set("interactionType", value) if err != nil { panic(err) } } // SetLinks sets the links property value. The collection of links that appear in the interaction. func (m *AiInteraction) SetLinks(value []AiInteractionLinkable)() { err := m.GetBackingStore().Set("links", value) if err != nil { panic(err) } } // SetLocale sets the locale property value. The locale of the sender. func (m *AiInteraction) SetLocale(value *string)() { err := m.GetBackingStore().Set("locale", value) if err != nil { panic(err) } } // SetMentions sets the mentions property value. The collection of the entities that were mentioned in the interaction, including users, bots, and so on. func (m *AiInteraction) SetMentions(value []AiInteractionMentionable)() { err := m.GetBackingStore().Set("mentions", value) if err != nil { panic(err) } } // SetRequestId sets the requestId property value. The identifier that groups a user prompt with its Copilot response. func (m *AiInteraction) SetRequestId(value *string)() { err := m.GetBackingStore().Set("requestId", value) if err != nil { panic(err) } } // SetSessionId sets the sessionId property value. The thread ID or conversation identifier that maps to all Copilot sessions for the user. func (m *AiInteraction) SetSessionId(value *string)() { err := m.GetBackingStore().Set("sessionId", value) if err != nil { panic(err) } } type AiInteractionable interface { Entityable i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable GetAppClass()(*string) GetAttachments()([]AiInteractionAttachmentable) GetBody()(ItemBodyable) GetContexts()([]AiInteractionContextable) GetConversationType()(*string) GetCreatedDateTime()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) GetEtag()(*string) GetFrom()(IdentitySetable) GetInteractionType()(*AiInteractionType) GetLinks()([]AiInteractionLinkable) GetLocale()(*string) GetMentions()([]AiInteractionMentionable) GetRequestId()(*string) GetSessionId()(*string) SetAppClass(value *string)() SetAttachments(value []AiInteractionAttachmentable)() SetBody(value ItemBodyable)() SetContexts(value []AiInteractionContextable)() SetConversationType(value *string)() SetCreatedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() SetEtag(value *string)() SetFrom(value IdentitySetable)() SetInteractionType(value *AiInteractionType)() SetLinks(value []AiInteractionLinkable)() SetLocale(value *string)() SetMentions(value []AiInteractionMentionable)() SetRequestId(value *string)() SetSessionId(value *string)() }