/
githubmirror
/
origin
Обзор
Документация
Войти
/
githubmirror
/
origin
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
vendor/github.com/microsoftgraph/msgraph-sdk-go/models/trending.go
216 строк
9 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 Trending struct { Entity } // NewTrending instantiates a new Trending and sets the default values. func NewTrending()(*Trending) { m := &Trending{ Entity: *NewEntity(), } return m } // CreateTrendingFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value // returns a Parsable when successful func CreateTrendingFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { return NewTrending(), nil } // GetFieldDeserializers the deserialization information for the current model // returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful func (m *Trending) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { res := m.Entity.GetFieldDeserializers() res["lastModifiedDateTime"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetTimeValue() if err != nil { return err } if val != nil { m.SetLastModifiedDateTime(val) } return nil } res["resource"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetObjectValue(CreateEntityFromDiscriminatorValue) if err != nil { return err } if val != nil { m.SetResource(val.(Entityable)) } return nil } res["resourceReference"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetObjectValue(CreateResourceReferenceFromDiscriminatorValue) if err != nil { return err } if val != nil { m.SetResourceReference(val.(ResourceReferenceable)) } return nil } res["resourceVisualization"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetObjectValue(CreateResourceVisualizationFromDiscriminatorValue) if err != nil { return err } if val != nil { m.SetResourceVisualization(val.(ResourceVisualizationable)) } return nil } res["weight"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetFloat64Value() if err != nil { return err } if val != nil { m.SetWeight(val) } return nil } return res } // GetLastModifiedDateTime gets the lastModifiedDateTime property value. The Timestamp 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 *Trending) GetLastModifiedDateTime()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { val, err := m.GetBackingStore().Get("lastModifiedDateTime") if err != nil { panic(err) } if val != nil { return val.(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) } return nil } // GetResource gets the resource property value. Used for navigating to the trending document. // returns a Entityable when successful func (m *Trending) GetResource()(Entityable) { val, err := m.GetBackingStore().Get("resource") if err != nil { panic(err) } if val != nil { return val.(Entityable) } return nil } // GetResourceReference gets the resourceReference property value. Reference properties of the trending document, such as the url and type of the document. // returns a ResourceReferenceable when successful func (m *Trending) GetResourceReference()(ResourceReferenceable) { val, err := m.GetBackingStore().Get("resourceReference") if err != nil { panic(err) } if val != nil { return val.(ResourceReferenceable) } return nil } // GetResourceVisualization gets the resourceVisualization property value. Properties that you can use to visualize the document in your experience. // returns a ResourceVisualizationable when successful func (m *Trending) GetResourceVisualization()(ResourceVisualizationable) { val, err := m.GetBackingStore().Get("resourceVisualization") if err != nil { panic(err) } if val != nil { return val.(ResourceVisualizationable) } return nil } // GetWeight gets the weight property value. Value indicating how much the document is currently trending. The larger the number, the more the document is currently trending around the user (the more relevant it is). Returned documents are sorted by this value. // returns a *float64 when successful func (m *Trending) GetWeight()(*float64) { val, err := m.GetBackingStore().Get("weight") if err != nil { panic(err) } if val != nil { return val.(*float64) } return nil } // Serialize serializes information the current object func (m *Trending) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { err := m.Entity.Serialize(writer) if err != nil { return err } { err = writer.WriteTimeValue("lastModifiedDateTime", m.GetLastModifiedDateTime()) if err != nil { return err } } { err = writer.WriteObjectValue("resource", m.GetResource()) if err != nil { return err } } { err = writer.WriteFloat64Value("weight", m.GetWeight()) if err != nil { return err } } return nil } // SetLastModifiedDateTime sets the lastModifiedDateTime property value. The Timestamp 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 *Trending) SetLastModifiedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { err := m.GetBackingStore().Set("lastModifiedDateTime", value) if err != nil { panic(err) } } // SetResource sets the resource property value. Used for navigating to the trending document. func (m *Trending) SetResource(value Entityable)() { err := m.GetBackingStore().Set("resource", value) if err != nil { panic(err) } } // SetResourceReference sets the resourceReference property value. Reference properties of the trending document, such as the url and type of the document. func (m *Trending) SetResourceReference(value ResourceReferenceable)() { err := m.GetBackingStore().Set("resourceReference", value) if err != nil { panic(err) } } // SetResourceVisualization sets the resourceVisualization property value. Properties that you can use to visualize the document in your experience. func (m *Trending) SetResourceVisualization(value ResourceVisualizationable)() { err := m.GetBackingStore().Set("resourceVisualization", value) if err != nil { panic(err) } } // SetWeight sets the weight property value. Value indicating how much the document is currently trending. The larger the number, the more the document is currently trending around the user (the more relevant it is). Returned documents are sorted by this value. func (m *Trending) SetWeight(value *float64)() { err := m.GetBackingStore().Set("weight", value) if err != nil { panic(err) } } type Trendingable interface { Entityable i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable GetLastModifiedDateTime()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) GetResource()(Entityable) GetResourceReference()(ResourceReferenceable) GetResourceVisualization()(ResourceVisualizationable) GetWeight()(*float64) SetLastModifiedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() SetResource(value Entityable)() SetResourceReference(value ResourceReferenceable)() SetResourceVisualization(value ResourceVisualizationable)() SetWeight(value *float64)() }