1
0
mirror of https://github.com/openshift/installer.git synced 2026-02-05 15:47:14 +01:00
Files
2024-04-04 21:23:02 +02:00

585 lines
23 KiB
Go

package models
import (
i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time"
i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization"
)
// Simulation
type Simulation struct {
Entity
}
// NewSimulation instantiates a new simulation and sets the default values.
func NewSimulation()(*Simulation) {
m := &Simulation{
Entity: *NewEntity(),
}
return m
}
// CreateSimulationFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value
func CreateSimulationFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) {
return NewSimulation(), nil
}
// GetAttackTechnique gets the attackTechnique property value. The social engineering technique used in the attack simulation and training campaign. Supports $filter and $orderby. Possible values are: unknown, credentialHarvesting, attachmentMalware, driveByUrl, linkInAttachment, linkToMalwareFile, unknownFutureValue. For more information on the types of social engineering attack techniques, see simulations.
func (m *Simulation) GetAttackTechnique()(*SimulationAttackTechnique) {
val, err := m.GetBackingStore().Get("attackTechnique")
if err != nil {
panic(err)
}
if val != nil {
return val.(*SimulationAttackTechnique)
}
return nil
}
// GetAttackType gets the attackType property value. Attack type of the attack simulation and training campaign. Supports $filter and $orderby. Possible values are: unknown, social, cloud, endpoint, unknownFutureValue.
func (m *Simulation) GetAttackType()(*SimulationAttackType) {
val, err := m.GetBackingStore().Get("attackType")
if err != nil {
panic(err)
}
if val != nil {
return val.(*SimulationAttackType)
}
return nil
}
// GetAutomationId gets the automationId property value. Unique identifier for the attack simulation automation.
func (m *Simulation) GetAutomationId()(*string) {
val, err := m.GetBackingStore().Get("automationId")
if err != nil {
panic(err)
}
if val != nil {
return val.(*string)
}
return nil
}
// GetCompletionDateTime gets the completionDateTime property value. Date and time of completion of the attack simulation and training campaign. Supports $filter and $orderby.
func (m *Simulation) GetCompletionDateTime()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) {
val, err := m.GetBackingStore().Get("completionDateTime")
if err != nil {
panic(err)
}
if val != nil {
return val.(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)
}
return nil
}
// GetCreatedBy gets the createdBy property value. Identity of the user who created the attack simulation and training campaign.
func (m *Simulation) GetCreatedBy()(EmailIdentityable) {
val, err := m.GetBackingStore().Get("createdBy")
if err != nil {
panic(err)
}
if val != nil {
return val.(EmailIdentityable)
}
return nil
}
// GetCreatedDateTime gets the createdDateTime property value. Date and time of creation of the attack simulation and training campaign.
func (m *Simulation) GetCreatedDateTime()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) {
val, err := m.GetBackingStore().Get("createdDateTime")
if err != nil {
panic(err)
}
if val != nil {
return val.(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)
}
return nil
}
// GetDescription gets the description property value. Description of the attack simulation and training campaign.
func (m *Simulation) GetDescription()(*string) {
val, err := m.GetBackingStore().Get("description")
if err != nil {
panic(err)
}
if val != nil {
return val.(*string)
}
return nil
}
// GetDisplayName gets the displayName property value. Display name of the attack simulation and training campaign. Supports $filter and $orderby.
func (m *Simulation) 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
func (m *Simulation) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) {
res := m.Entity.GetFieldDeserializers()
res["attackTechnique"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetEnumValue(ParseSimulationAttackTechnique)
if err != nil {
return err
}
if val != nil {
m.SetAttackTechnique(val.(*SimulationAttackTechnique))
}
return nil
}
res["attackType"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetEnumValue(ParseSimulationAttackType)
if err != nil {
return err
}
if val != nil {
m.SetAttackType(val.(*SimulationAttackType))
}
return nil
}
res["automationId"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetStringValue()
if err != nil {
return err
}
if val != nil {
m.SetAutomationId(val)
}
return nil
}
res["completionDateTime"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetTimeValue()
if err != nil {
return err
}
if val != nil {
m.SetCompletionDateTime(val)
}
return nil
}
res["createdBy"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetObjectValue(CreateEmailIdentityFromDiscriminatorValue)
if err != nil {
return err
}
if val != nil {
m.SetCreatedBy(val.(EmailIdentityable))
}
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["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetStringValue()
if err != nil {
return err
}
if val != nil {
m.SetDescription(val)
}
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["isAutomated"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetBoolValue()
if err != nil {
return err
}
if val != nil {
m.SetIsAutomated(val)
}
return nil
}
res["lastModifiedBy"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetObjectValue(CreateEmailIdentityFromDiscriminatorValue)
if err != nil {
return err
}
if val != nil {
m.SetLastModifiedBy(val.(EmailIdentityable))
}
return nil
}
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["launchDateTime"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetTimeValue()
if err != nil {
return err
}
if val != nil {
m.SetLaunchDateTime(val)
}
return nil
}
res["payloadDeliveryPlatform"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetEnumValue(ParsePayloadDeliveryPlatform)
if err != nil {
return err
}
if val != nil {
m.SetPayloadDeliveryPlatform(val.(*PayloadDeliveryPlatform))
}
return nil
}
res["report"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetObjectValue(CreateSimulationReportFromDiscriminatorValue)
if err != nil {
return err
}
if val != nil {
m.SetReport(val.(SimulationReportable))
}
return nil
}
res["status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetEnumValue(ParseSimulationStatus)
if err != nil {
return err
}
if val != nil {
m.SetStatus(val.(*SimulationStatus))
}
return nil
}
return res
}
// GetIsAutomated gets the isAutomated property value. Flag that represents if the attack simulation and training campaign was created from a simulation automation flow. Supports $filter and $orderby.
func (m *Simulation) GetIsAutomated()(*bool) {
val, err := m.GetBackingStore().Get("isAutomated")
if err != nil {
panic(err)
}
if val != nil {
return val.(*bool)
}
return nil
}
// GetLastModifiedBy gets the lastModifiedBy property value. Identity of the user who most recently modified the attack simulation and training campaign.
func (m *Simulation) GetLastModifiedBy()(EmailIdentityable) {
val, err := m.GetBackingStore().Get("lastModifiedBy")
if err != nil {
panic(err)
}
if val != nil {
return val.(EmailIdentityable)
}
return nil
}
// GetLastModifiedDateTime gets the lastModifiedDateTime property value. Date and time of the most recent modification of the attack simulation and training campaign.
func (m *Simulation) GetLastModifiedDateTime()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) {
val, err := m.GetBackingStore().Get("lastModifiedDateTime")
if err != nil {
panic(err)
}
if val != nil {
return val.(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)
}
return nil
}
// GetLaunchDateTime gets the launchDateTime property value. Date and time of the launch/start of the attack simulation and training campaign. Supports $filter and $orderby.
func (m *Simulation) GetLaunchDateTime()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) {
val, err := m.GetBackingStore().Get("launchDateTime")
if err != nil {
panic(err)
}
if val != nil {
return val.(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)
}
return nil
}
// GetPayloadDeliveryPlatform gets the payloadDeliveryPlatform property value. Method of delivery of the phishing payload used in the attack simulation and training campaign. Possible values are: unknown, sms, email, teams, unknownFutureValue.
func (m *Simulation) GetPayloadDeliveryPlatform()(*PayloadDeliveryPlatform) {
val, err := m.GetBackingStore().Get("payloadDeliveryPlatform")
if err != nil {
panic(err)
}
if val != nil {
return val.(*PayloadDeliveryPlatform)
}
return nil
}
// GetReport gets the report property value. Report of the attack simulation and training campaign.
func (m *Simulation) GetReport()(SimulationReportable) {
val, err := m.GetBackingStore().Get("report")
if err != nil {
panic(err)
}
if val != nil {
return val.(SimulationReportable)
}
return nil
}
// GetStatus gets the status property value. Status of the attack simulation and training campaign. Supports $filter and $orderby. Possible values are: unknown, draft, running, scheduled, succeeded, failed, cancelled, excluded, unknownFutureValue.
func (m *Simulation) GetStatus()(*SimulationStatus) {
val, err := m.GetBackingStore().Get("status")
if err != nil {
panic(err)
}
if val != nil {
return val.(*SimulationStatus)
}
return nil
}
// Serialize serializes information the current object
func (m *Simulation) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) {
err := m.Entity.Serialize(writer)
if err != nil {
return err
}
if m.GetAttackTechnique() != nil {
cast := (*m.GetAttackTechnique()).String()
err = writer.WriteStringValue("attackTechnique", &cast)
if err != nil {
return err
}
}
if m.GetAttackType() != nil {
cast := (*m.GetAttackType()).String()
err = writer.WriteStringValue("attackType", &cast)
if err != nil {
return err
}
}
{
err = writer.WriteStringValue("automationId", m.GetAutomationId())
if err != nil {
return err
}
}
{
err = writer.WriteTimeValue("completionDateTime", m.GetCompletionDateTime())
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("description", m.GetDescription())
if err != nil {
return err
}
}
{
err = writer.WriteStringValue("displayName", m.GetDisplayName())
if err != nil {
return err
}
}
{
err = writer.WriteBoolValue("isAutomated", m.GetIsAutomated())
if err != nil {
return err
}
}
{
err = writer.WriteObjectValue("lastModifiedBy", m.GetLastModifiedBy())
if err != nil {
return err
}
}
{
err = writer.WriteTimeValue("lastModifiedDateTime", m.GetLastModifiedDateTime())
if err != nil {
return err
}
}
{
err = writer.WriteTimeValue("launchDateTime", m.GetLaunchDateTime())
if err != nil {
return err
}
}
if m.GetPayloadDeliveryPlatform() != nil {
cast := (*m.GetPayloadDeliveryPlatform()).String()
err = writer.WriteStringValue("payloadDeliveryPlatform", &cast)
if err != nil {
return err
}
}
{
err = writer.WriteObjectValue("report", m.GetReport())
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
}
// SetAttackTechnique sets the attackTechnique property value. The social engineering technique used in the attack simulation and training campaign. Supports $filter and $orderby. Possible values are: unknown, credentialHarvesting, attachmentMalware, driveByUrl, linkInAttachment, linkToMalwareFile, unknownFutureValue. For more information on the types of social engineering attack techniques, see simulations.
func (m *Simulation) SetAttackTechnique(value *SimulationAttackTechnique)() {
err := m.GetBackingStore().Set("attackTechnique", value)
if err != nil {
panic(err)
}
}
// SetAttackType sets the attackType property value. Attack type of the attack simulation and training campaign. Supports $filter and $orderby. Possible values are: unknown, social, cloud, endpoint, unknownFutureValue.
func (m *Simulation) SetAttackType(value *SimulationAttackType)() {
err := m.GetBackingStore().Set("attackType", value)
if err != nil {
panic(err)
}
}
// SetAutomationId sets the automationId property value. Unique identifier for the attack simulation automation.
func (m *Simulation) SetAutomationId(value *string)() {
err := m.GetBackingStore().Set("automationId", value)
if err != nil {
panic(err)
}
}
// SetCompletionDateTime sets the completionDateTime property value. Date and time of completion of the attack simulation and training campaign. Supports $filter and $orderby.
func (m *Simulation) SetCompletionDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() {
err := m.GetBackingStore().Set("completionDateTime", value)
if err != nil {
panic(err)
}
}
// SetCreatedBy sets the createdBy property value. Identity of the user who created the attack simulation and training campaign.
func (m *Simulation) SetCreatedBy(value EmailIdentityable)() {
err := m.GetBackingStore().Set("createdBy", value)
if err != nil {
panic(err)
}
}
// SetCreatedDateTime sets the createdDateTime property value. Date and time of creation of the attack simulation and training campaign.
func (m *Simulation) SetCreatedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() {
err := m.GetBackingStore().Set("createdDateTime", value)
if err != nil {
panic(err)
}
}
// SetDescription sets the description property value. Description of the attack simulation and training campaign.
func (m *Simulation) SetDescription(value *string)() {
err := m.GetBackingStore().Set("description", value)
if err != nil {
panic(err)
}
}
// SetDisplayName sets the displayName property value. Display name of the attack simulation and training campaign. Supports $filter and $orderby.
func (m *Simulation) SetDisplayName(value *string)() {
err := m.GetBackingStore().Set("displayName", value)
if err != nil {
panic(err)
}
}
// SetIsAutomated sets the isAutomated property value. Flag that represents if the attack simulation and training campaign was created from a simulation automation flow. Supports $filter and $orderby.
func (m *Simulation) SetIsAutomated(value *bool)() {
err := m.GetBackingStore().Set("isAutomated", value)
if err != nil {
panic(err)
}
}
// SetLastModifiedBy sets the lastModifiedBy property value. Identity of the user who most recently modified the attack simulation and training campaign.
func (m *Simulation) SetLastModifiedBy(value EmailIdentityable)() {
err := m.GetBackingStore().Set("lastModifiedBy", value)
if err != nil {
panic(err)
}
}
// SetLastModifiedDateTime sets the lastModifiedDateTime property value. Date and time of the most recent modification of the attack simulation and training campaign.
func (m *Simulation) SetLastModifiedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() {
err := m.GetBackingStore().Set("lastModifiedDateTime", value)
if err != nil {
panic(err)
}
}
// SetLaunchDateTime sets the launchDateTime property value. Date and time of the launch/start of the attack simulation and training campaign. Supports $filter and $orderby.
func (m *Simulation) SetLaunchDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() {
err := m.GetBackingStore().Set("launchDateTime", value)
if err != nil {
panic(err)
}
}
// SetPayloadDeliveryPlatform sets the payloadDeliveryPlatform property value. Method of delivery of the phishing payload used in the attack simulation and training campaign. Possible values are: unknown, sms, email, teams, unknownFutureValue.
func (m *Simulation) SetPayloadDeliveryPlatform(value *PayloadDeliveryPlatform)() {
err := m.GetBackingStore().Set("payloadDeliveryPlatform", value)
if err != nil {
panic(err)
}
}
// SetReport sets the report property value. Report of the attack simulation and training campaign.
func (m *Simulation) SetReport(value SimulationReportable)() {
err := m.GetBackingStore().Set("report", value)
if err != nil {
panic(err)
}
}
// SetStatus sets the status property value. Status of the attack simulation and training campaign. Supports $filter and $orderby. Possible values are: unknown, draft, running, scheduled, succeeded, failed, cancelled, excluded, unknownFutureValue.
func (m *Simulation) SetStatus(value *SimulationStatus)() {
err := m.GetBackingStore().Set("status", value)
if err != nil {
panic(err)
}
}
// Simulationable
type Simulationable interface {
Entityable
i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable
GetAttackTechnique()(*SimulationAttackTechnique)
GetAttackType()(*SimulationAttackType)
GetAutomationId()(*string)
GetCompletionDateTime()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)
GetCreatedBy()(EmailIdentityable)
GetCreatedDateTime()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)
GetDescription()(*string)
GetDisplayName()(*string)
GetIsAutomated()(*bool)
GetLastModifiedBy()(EmailIdentityable)
GetLastModifiedDateTime()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)
GetLaunchDateTime()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)
GetPayloadDeliveryPlatform()(*PayloadDeliveryPlatform)
GetReport()(SimulationReportable)
GetStatus()(*SimulationStatus)
SetAttackTechnique(value *SimulationAttackTechnique)()
SetAttackType(value *SimulationAttackType)()
SetAutomationId(value *string)()
SetCompletionDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)()
SetCreatedBy(value EmailIdentityable)()
SetCreatedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)()
SetDescription(value *string)()
SetDisplayName(value *string)()
SetIsAutomated(value *bool)()
SetLastModifiedBy(value EmailIdentityable)()
SetLastModifiedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)()
SetLaunchDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)()
SetPayloadDeliveryPlatform(value *PayloadDeliveryPlatform)()
SetReport(value SimulationReportable)()
SetStatus(value *SimulationStatus)()
}