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

168 lines
6.2 KiB
Go

package models
import (
i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time"
i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization"
)
// Operation
type Operation struct {
Entity
}
// NewOperation instantiates a new operation and sets the default values.
func NewOperation()(*Operation) {
m := &Operation{
Entity: *NewEntity(),
}
return m
}
// CreateOperationFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value
func CreateOperationFromDiscriminatorValue(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.onenoteOperation":
return NewOnenoteOperation(), nil
}
}
}
}
return NewOperation(), nil
}
// GetCreatedDateTime gets the createdDateTime property value. The start time of the operation.
func (m *Operation) GetCreatedDateTime()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) {
val, err := m.GetBackingStore().Get("createdDateTime")
if err != nil {
panic(err)
}
if val != nil {
return val.(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)
}
return nil
}
// GetFieldDeserializers the deserialization information for the current model
func (m *Operation) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) {
res := m.Entity.GetFieldDeserializers()
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["lastActionDateTime"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetTimeValue()
if err != nil {
return err
}
if val != nil {
m.SetLastActionDateTime(val)
}
return nil
}
res["status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetEnumValue(ParseOperationStatus)
if err != nil {
return err
}
if val != nil {
m.SetStatus(val.(*OperationStatus))
}
return nil
}
return res
}
// GetLastActionDateTime gets the lastActionDateTime property value. The time of the last action of the operation.
func (m *Operation) GetLastActionDateTime()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) {
val, err := m.GetBackingStore().Get("lastActionDateTime")
if err != nil {
panic(err)
}
if val != nil {
return val.(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)
}
return nil
}
// GetStatus gets the status property value. The current status of the operation: notStarted, running, completed, failed
func (m *Operation) GetStatus()(*OperationStatus) {
val, err := m.GetBackingStore().Get("status")
if err != nil {
panic(err)
}
if val != nil {
return val.(*OperationStatus)
}
return nil
}
// Serialize serializes information the current object
func (m *Operation) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) {
err := m.Entity.Serialize(writer)
if err != nil {
return err
}
{
err = writer.WriteTimeValue("createdDateTime", m.GetCreatedDateTime())
if err != nil {
return err
}
}
{
err = writer.WriteTimeValue("lastActionDateTime", m.GetLastActionDateTime())
if err != nil {
return err
}
}
if m.GetStatus() != nil {
cast := (*m.GetStatus()).String()
err = writer.WriteStringValue("status", &cast)
if err != nil {
return err
}
}
return nil
}
// SetCreatedDateTime sets the createdDateTime property value. The start time of the operation.
func (m *Operation) SetCreatedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() {
err := m.GetBackingStore().Set("createdDateTime", value)
if err != nil {
panic(err)
}
}
// SetLastActionDateTime sets the lastActionDateTime property value. The time of the last action of the operation.
func (m *Operation) SetLastActionDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() {
err := m.GetBackingStore().Set("lastActionDateTime", value)
if err != nil {
panic(err)
}
}
// SetStatus sets the status property value. The current status of the operation: notStarted, running, completed, failed
func (m *Operation) SetStatus(value *OperationStatus)() {
err := m.GetBackingStore().Set("status", value)
if err != nil {
panic(err)
}
}
// Operationable
type Operationable interface {
Entityable
i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable
GetCreatedDateTime()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)
GetLastActionDateTime()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)
GetStatus()(*OperationStatus)
SetCreatedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)()
SetLastActionDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)()
SetStatus(value *OperationStatus)()
}