/
githubmirror
/
origin
Обзор
Документация
Войти
/
githubmirror
/
origin
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
vendor/github.com/microsoftgraph/msgraph-sdk-go/models/shift_item.go
183 строки
6 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 ( i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" ) type ShiftItem struct { ScheduleEntity } // NewShiftItem instantiates a new ShiftItem and sets the default values. func NewShiftItem()(*ShiftItem) { m := &ShiftItem{ ScheduleEntity: *NewScheduleEntity(), } return m } // CreateShiftItemFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value // returns a Parsable when successful func CreateShiftItemFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { if parseNode != nil { mappingValueNode, err := parseNode.GetChildNode("@odata.type") if err != nil { return nil, err } if mappingValueNode != nil { mappingValue, err := mappingValueNode.GetStringValue() if err != nil { return nil, err } if mappingValue != nil { switch *mappingValue { case "#microsoft.graph.openShiftItem": return NewOpenShiftItem(), nil } } } } return NewShiftItem(), nil } // GetActivities gets the activities property value. An incremental part of a shift which can cover details of when and where an employee is during their shift. For example, an assignment or a scheduled break or lunch. Required. // returns a []ShiftActivityable when successful func (m *ShiftItem) GetActivities()([]ShiftActivityable) { val, err := m.GetBackingStore().Get("activities") if err != nil { panic(err) } if val != nil { return val.([]ShiftActivityable) } return nil } // GetDisplayName gets the displayName property value. The shift label of the shiftItem. // returns a *string when successful func (m *ShiftItem) GetDisplayName()(*string) { val, err := m.GetBackingStore().Get("displayName") 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 *ShiftItem) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { res := m.ScheduleEntity.GetFieldDeserializers() res["activities"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetCollectionOfObjectValues(CreateShiftActivityFromDiscriminatorValue) if err != nil { return err } if val != nil { res := make([]ShiftActivityable, len(val)) for i, v := range val { if v != nil { res[i] = v.(ShiftActivityable) } } m.SetActivities(res) } return nil } res["displayName"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetStringValue() if err != nil { return err } if val != nil { m.SetDisplayName(val) } return nil } res["notes"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetStringValue() if err != nil { return err } if val != nil { m.SetNotes(val) } return nil } return res } // GetNotes gets the notes property value. The shift notes for the shiftItem. // returns a *string when successful func (m *ShiftItem) GetNotes()(*string) { val, err := m.GetBackingStore().Get("notes") if err != nil { panic(err) } if val != nil { return val.(*string) } return nil } // Serialize serializes information the current object func (m *ShiftItem) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { err := m.ScheduleEntity.Serialize(writer) if err != nil { return err } if m.GetActivities() != nil { cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetActivities())) for i, v := range m.GetActivities() { if v != nil { cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) } } err = writer.WriteCollectionOfObjectValues("activities", cast) if err != nil { return err } } { err = writer.WriteStringValue("displayName", m.GetDisplayName()) if err != nil { return err } } { err = writer.WriteStringValue("notes", m.GetNotes()) if err != nil { return err } } return nil } // SetActivities sets the activities property value. An incremental part of a shift which can cover details of when and where an employee is during their shift. For example, an assignment or a scheduled break or lunch. Required. func (m *ShiftItem) SetActivities(value []ShiftActivityable)() { err := m.GetBackingStore().Set("activities", value) if err != nil { panic(err) } } // SetDisplayName sets the displayName property value. The shift label of the shiftItem. func (m *ShiftItem) SetDisplayName(value *string)() { err := m.GetBackingStore().Set("displayName", value) if err != nil { panic(err) } } // SetNotes sets the notes property value. The shift notes for the shiftItem. func (m *ShiftItem) SetNotes(value *string)() { err := m.GetBackingStore().Set("notes", value) if err != nil { panic(err) } } type ShiftItemable interface { i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable ScheduleEntityable GetActivities()([]ShiftActivityable) GetDisplayName()(*string) GetNotes()(*string) SetActivities(value []ShiftActivityable)() SetDisplayName(value *string)() SetNotes(value *string)() }