mirror of
https://github.com/openshift/installer.git
synced 2026-02-06 09:47:02 +01:00
279 lines
9.9 KiB
Go
279 lines
9.9 KiB
Go
package models
|
|
|
|
import (
|
|
i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time"
|
|
i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization"
|
|
)
|
|
|
|
// Request
|
|
type Request struct {
|
|
Entity
|
|
}
|
|
// NewRequest instantiates a new request and sets the default values.
|
|
func NewRequest()(*Request) {
|
|
m := &Request{
|
|
Entity: *NewEntity(),
|
|
}
|
|
return m
|
|
}
|
|
// CreateRequestFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value
|
|
func CreateRequestFromDiscriminatorValue(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.unifiedRoleAssignmentScheduleRequest":
|
|
return NewUnifiedRoleAssignmentScheduleRequest(), nil
|
|
case "#microsoft.graph.unifiedRoleEligibilityScheduleRequest":
|
|
return NewUnifiedRoleEligibilityScheduleRequest(), nil
|
|
case "#microsoft.graph.userConsentRequest":
|
|
return NewUserConsentRequest(), nil
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return NewRequest(), nil
|
|
}
|
|
// GetApprovalId gets the approvalId property value. The identifier of the approval of the request.
|
|
func (m *Request) GetApprovalId()(*string) {
|
|
val, err := m.GetBackingStore().Get("approvalId")
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
if val != nil {
|
|
return val.(*string)
|
|
}
|
|
return nil
|
|
}
|
|
// GetCompletedDateTime gets the completedDateTime property value. The request completion date time.
|
|
func (m *Request) GetCompletedDateTime()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) {
|
|
val, err := m.GetBackingStore().Get("completedDateTime")
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
if val != nil {
|
|
return val.(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)
|
|
}
|
|
return nil
|
|
}
|
|
// GetCreatedBy gets the createdBy property value. The principal that created the request.
|
|
func (m *Request) GetCreatedBy()(IdentitySetable) {
|
|
val, err := m.GetBackingStore().Get("createdBy")
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
if val != nil {
|
|
return val.(IdentitySetable)
|
|
}
|
|
return nil
|
|
}
|
|
// GetCreatedDateTime gets the createdDateTime property value. The request creation date time.
|
|
func (m *Request) GetCreatedDateTime()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) {
|
|
val, err := m.GetBackingStore().Get("createdDateTime")
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
if val != nil {
|
|
return val.(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)
|
|
}
|
|
return nil
|
|
}
|
|
// GetCustomData gets the customData property value. Free text field to define any custom data for the request. Not used.
|
|
func (m *Request) GetCustomData()(*string) {
|
|
val, err := m.GetBackingStore().Get("customData")
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
if val != nil {
|
|
return val.(*string)
|
|
}
|
|
return nil
|
|
}
|
|
// GetFieldDeserializers the deserialization information for the current model
|
|
func (m *Request) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) {
|
|
res := m.Entity.GetFieldDeserializers()
|
|
res["approvalId"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
|
|
val, err := n.GetStringValue()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val != nil {
|
|
m.SetApprovalId(val)
|
|
}
|
|
return nil
|
|
}
|
|
res["completedDateTime"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
|
|
val, err := n.GetTimeValue()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val != nil {
|
|
m.SetCompletedDateTime(val)
|
|
}
|
|
return nil
|
|
}
|
|
res["createdBy"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
|
|
val, err := n.GetObjectValue(CreateIdentitySetFromDiscriminatorValue)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val != nil {
|
|
m.SetCreatedBy(val.(IdentitySetable))
|
|
}
|
|
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["customData"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
|
|
val, err := n.GetStringValue()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val != nil {
|
|
m.SetCustomData(val)
|
|
}
|
|
return nil
|
|
}
|
|
res["status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
|
|
val, err := n.GetStringValue()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val != nil {
|
|
m.SetStatus(val)
|
|
}
|
|
return nil
|
|
}
|
|
return res
|
|
}
|
|
// GetStatus gets the status property value. The status of the request. Not nullable. The possible values are: Canceled, Denied, Failed, Granted, PendingAdminDecision, PendingApproval, PendingProvisioning, PendingScheduleCreation, Provisioned, Revoked, and ScheduleCreated. Not nullable.
|
|
func (m *Request) GetStatus()(*string) {
|
|
val, err := m.GetBackingStore().Get("status")
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
if val != nil {
|
|
return val.(*string)
|
|
}
|
|
return nil
|
|
}
|
|
// Serialize serializes information the current object
|
|
func (m *Request) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) {
|
|
err := m.Entity.Serialize(writer)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
{
|
|
err = writer.WriteStringValue("approvalId", m.GetApprovalId())
|
|
if err != nil {
|
|
return err
|
|
}
|
|
}
|
|
{
|
|
err = writer.WriteTimeValue("completedDateTime", m.GetCompletedDateTime())
|
|
if err != nil {
|
|
return err
|
|
}
|
|
}
|
|
{
|
|
err = writer.WriteObjectValue("createdBy", m.GetCreatedBy())
|
|
if err != nil {
|
|
return err
|
|
}
|
|
}
|
|
{
|
|
err = writer.WriteTimeValue("createdDateTime", m.GetCreatedDateTime())
|
|
if err != nil {
|
|
return err
|
|
}
|
|
}
|
|
{
|
|
err = writer.WriteStringValue("customData", m.GetCustomData())
|
|
if err != nil {
|
|
return err
|
|
}
|
|
}
|
|
{
|
|
err = writer.WriteStringValue("status", m.GetStatus())
|
|
if err != nil {
|
|
return err
|
|
}
|
|
}
|
|
return nil
|
|
}
|
|
// SetApprovalId sets the approvalId property value. The identifier of the approval of the request.
|
|
func (m *Request) SetApprovalId(value *string)() {
|
|
err := m.GetBackingStore().Set("approvalId", value)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
}
|
|
// SetCompletedDateTime sets the completedDateTime property value. The request completion date time.
|
|
func (m *Request) SetCompletedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() {
|
|
err := m.GetBackingStore().Set("completedDateTime", value)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
}
|
|
// SetCreatedBy sets the createdBy property value. The principal that created the request.
|
|
func (m *Request) SetCreatedBy(value IdentitySetable)() {
|
|
err := m.GetBackingStore().Set("createdBy", value)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
}
|
|
// SetCreatedDateTime sets the createdDateTime property value. The request creation date time.
|
|
func (m *Request) SetCreatedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() {
|
|
err := m.GetBackingStore().Set("createdDateTime", value)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
}
|
|
// SetCustomData sets the customData property value. Free text field to define any custom data for the request. Not used.
|
|
func (m *Request) SetCustomData(value *string)() {
|
|
err := m.GetBackingStore().Set("customData", value)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
}
|
|
// SetStatus sets the status property value. The status of the request. Not nullable. The possible values are: Canceled, Denied, Failed, Granted, PendingAdminDecision, PendingApproval, PendingProvisioning, PendingScheduleCreation, Provisioned, Revoked, and ScheduleCreated. Not nullable.
|
|
func (m *Request) SetStatus(value *string)() {
|
|
err := m.GetBackingStore().Set("status", value)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
}
|
|
// Requestable
|
|
type Requestable interface {
|
|
Entityable
|
|
i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable
|
|
GetApprovalId()(*string)
|
|
GetCompletedDateTime()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)
|
|
GetCreatedBy()(IdentitySetable)
|
|
GetCreatedDateTime()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)
|
|
GetCustomData()(*string)
|
|
GetStatus()(*string)
|
|
SetApprovalId(value *string)()
|
|
SetCompletedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)()
|
|
SetCreatedBy(value IdentitySetable)()
|
|
SetCreatedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)()
|
|
SetCustomData(value *string)()
|
|
SetStatus(value *string)()
|
|
}
|