1
0
mirror of https://github.com/openshift/installer.git synced 2026-02-06 00:48:45 +01:00
Files
2024-04-04 21:23:02 +02:00

151 lines
6.1 KiB
Go

package models
import (
i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time"
i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization"
)
// TimeOffRequest
type TimeOffRequest struct {
ScheduleChangeRequest
}
// NewTimeOffRequest instantiates a new TimeOffRequest and sets the default values.
func NewTimeOffRequest()(*TimeOffRequest) {
m := &TimeOffRequest{
ScheduleChangeRequest: *NewScheduleChangeRequest(),
}
odataTypeValue := "#microsoft.graph.timeOffRequest"
m.SetOdataType(&odataTypeValue)
return m
}
// CreateTimeOffRequestFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value
func CreateTimeOffRequestFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) {
return NewTimeOffRequest(), nil
}
// GetEndDateTime gets the endDateTime 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 *TimeOffRequest) GetEndDateTime()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) {
val, err := m.GetBackingStore().Get("endDateTime")
if err != nil {
panic(err)
}
if val != nil {
return val.(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)
}
return nil
}
// GetFieldDeserializers the deserialization information for the current model
func (m *TimeOffRequest) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) {
res := m.ScheduleChangeRequest.GetFieldDeserializers()
res["endDateTime"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetTimeValue()
if err != nil {
return err
}
if val != nil {
m.SetEndDateTime(val)
}
return nil
}
res["startDateTime"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetTimeValue()
if err != nil {
return err
}
if val != nil {
m.SetStartDateTime(val)
}
return nil
}
res["timeOffReasonId"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetStringValue()
if err != nil {
return err
}
if val != nil {
m.SetTimeOffReasonId(val)
}
return nil
}
return res
}
// GetStartDateTime gets the startDateTime 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 *TimeOffRequest) GetStartDateTime()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) {
val, err := m.GetBackingStore().Get("startDateTime")
if err != nil {
panic(err)
}
if val != nil {
return val.(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)
}
return nil
}
// GetTimeOffReasonId gets the timeOffReasonId property value. The reason for the time off.
func (m *TimeOffRequest) GetTimeOffReasonId()(*string) {
val, err := m.GetBackingStore().Get("timeOffReasonId")
if err != nil {
panic(err)
}
if val != nil {
return val.(*string)
}
return nil
}
// Serialize serializes information the current object
func (m *TimeOffRequest) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) {
err := m.ScheduleChangeRequest.Serialize(writer)
if err != nil {
return err
}
{
err = writer.WriteTimeValue("endDateTime", m.GetEndDateTime())
if err != nil {
return err
}
}
{
err = writer.WriteTimeValue("startDateTime", m.GetStartDateTime())
if err != nil {
return err
}
}
{
err = writer.WriteStringValue("timeOffReasonId", m.GetTimeOffReasonId())
if err != nil {
return err
}
}
return nil
}
// SetEndDateTime sets the endDateTime 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 *TimeOffRequest) SetEndDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() {
err := m.GetBackingStore().Set("endDateTime", value)
if err != nil {
panic(err)
}
}
// SetStartDateTime sets the startDateTime 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 *TimeOffRequest) SetStartDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() {
err := m.GetBackingStore().Set("startDateTime", value)
if err != nil {
panic(err)
}
}
// SetTimeOffReasonId sets the timeOffReasonId property value. The reason for the time off.
func (m *TimeOffRequest) SetTimeOffReasonId(value *string)() {
err := m.GetBackingStore().Set("timeOffReasonId", value)
if err != nil {
panic(err)
}
}
// TimeOffRequestable
type TimeOffRequestable interface {
i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable
ScheduleChangeRequestable
GetEndDateTime()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)
GetStartDateTime()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)
GetTimeOffReasonId()(*string)
SetEndDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)()
SetStartDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)()
SetTimeOffReasonId(value *string)()
}