mirror of
https://github.com/openshift/installer.git
synced 2026-02-05 15:47:14 +01:00
216 lines
9.1 KiB
Go
216 lines
9.1 KiB
Go
package models
|
|
|
|
import (
|
|
i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization"
|
|
)
|
|
|
|
// Directory
|
|
type Directory struct {
|
|
Entity
|
|
}
|
|
// NewDirectory instantiates a new Directory and sets the default values.
|
|
func NewDirectory()(*Directory) {
|
|
m := &Directory{
|
|
Entity: *NewEntity(),
|
|
}
|
|
return m
|
|
}
|
|
// CreateDirectoryFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value
|
|
func CreateDirectoryFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) {
|
|
return NewDirectory(), nil
|
|
}
|
|
// GetAdministrativeUnits gets the administrativeUnits property value. Conceptual container for user and group directory objects.
|
|
func (m *Directory) GetAdministrativeUnits()([]AdministrativeUnitable) {
|
|
val, err := m.GetBackingStore().Get("administrativeUnits")
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
if val != nil {
|
|
return val.([]AdministrativeUnitable)
|
|
}
|
|
return nil
|
|
}
|
|
// GetDeletedItems gets the deletedItems property value. Recently deleted items. Read-only. Nullable.
|
|
func (m *Directory) GetDeletedItems()([]DirectoryObjectable) {
|
|
val, err := m.GetBackingStore().Get("deletedItems")
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
if val != nil {
|
|
return val.([]DirectoryObjectable)
|
|
}
|
|
return nil
|
|
}
|
|
// GetFederationConfigurations gets the federationConfigurations property value. Configure domain federation with organizations whose identity provider (IdP) supports either the SAML or WS-Fed protocol.
|
|
func (m *Directory) GetFederationConfigurations()([]IdentityProviderBaseable) {
|
|
val, err := m.GetBackingStore().Get("federationConfigurations")
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
if val != nil {
|
|
return val.([]IdentityProviderBaseable)
|
|
}
|
|
return nil
|
|
}
|
|
// GetFieldDeserializers the deserialization information for the current model
|
|
func (m *Directory) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) {
|
|
res := m.Entity.GetFieldDeserializers()
|
|
res["administrativeUnits"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
|
|
val, err := n.GetCollectionOfObjectValues(CreateAdministrativeUnitFromDiscriminatorValue)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val != nil {
|
|
res := make([]AdministrativeUnitable, len(val))
|
|
for i, v := range val {
|
|
res[i] = v.(AdministrativeUnitable)
|
|
}
|
|
m.SetAdministrativeUnits(res)
|
|
}
|
|
return nil
|
|
}
|
|
res["deletedItems"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
|
|
val, err := n.GetCollectionOfObjectValues(CreateDirectoryObjectFromDiscriminatorValue)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val != nil {
|
|
res := make([]DirectoryObjectable, len(val))
|
|
for i, v := range val {
|
|
res[i] = v.(DirectoryObjectable)
|
|
}
|
|
m.SetDeletedItems(res)
|
|
}
|
|
return nil
|
|
}
|
|
res["federationConfigurations"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
|
|
val, err := n.GetCollectionOfObjectValues(CreateIdentityProviderBaseFromDiscriminatorValue)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val != nil {
|
|
res := make([]IdentityProviderBaseable, len(val))
|
|
for i, v := range val {
|
|
res[i] = v.(IdentityProviderBaseable)
|
|
}
|
|
m.SetFederationConfigurations(res)
|
|
}
|
|
return nil
|
|
}
|
|
res["onPremisesSynchronization"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
|
|
val, err := n.GetCollectionOfObjectValues(CreateOnPremisesDirectorySynchronizationFromDiscriminatorValue)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val != nil {
|
|
res := make([]OnPremisesDirectorySynchronizationable, len(val))
|
|
for i, v := range val {
|
|
res[i] = v.(OnPremisesDirectorySynchronizationable)
|
|
}
|
|
m.SetOnPremisesSynchronization(res)
|
|
}
|
|
return nil
|
|
}
|
|
return res
|
|
}
|
|
// GetOnPremisesSynchronization gets the onPremisesSynchronization property value. A container for on-premises directory synchronization functionalities that are available for the organization.
|
|
func (m *Directory) GetOnPremisesSynchronization()([]OnPremisesDirectorySynchronizationable) {
|
|
val, err := m.GetBackingStore().Get("onPremisesSynchronization")
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
if val != nil {
|
|
return val.([]OnPremisesDirectorySynchronizationable)
|
|
}
|
|
return nil
|
|
}
|
|
// Serialize serializes information the current object
|
|
func (m *Directory) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) {
|
|
err := m.Entity.Serialize(writer)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if m.GetAdministrativeUnits() != nil {
|
|
cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetAdministrativeUnits()))
|
|
for i, v := range m.GetAdministrativeUnits() {
|
|
cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable)
|
|
}
|
|
err = writer.WriteCollectionOfObjectValues("administrativeUnits", cast)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
}
|
|
if m.GetDeletedItems() != nil {
|
|
cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetDeletedItems()))
|
|
for i, v := range m.GetDeletedItems() {
|
|
cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable)
|
|
}
|
|
err = writer.WriteCollectionOfObjectValues("deletedItems", cast)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
}
|
|
if m.GetFederationConfigurations() != nil {
|
|
cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetFederationConfigurations()))
|
|
for i, v := range m.GetFederationConfigurations() {
|
|
cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable)
|
|
}
|
|
err = writer.WriteCollectionOfObjectValues("federationConfigurations", cast)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
}
|
|
if m.GetOnPremisesSynchronization() != nil {
|
|
cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetOnPremisesSynchronization()))
|
|
for i, v := range m.GetOnPremisesSynchronization() {
|
|
cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable)
|
|
}
|
|
err = writer.WriteCollectionOfObjectValues("onPremisesSynchronization", cast)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
}
|
|
return nil
|
|
}
|
|
// SetAdministrativeUnits sets the administrativeUnits property value. Conceptual container for user and group directory objects.
|
|
func (m *Directory) SetAdministrativeUnits(value []AdministrativeUnitable)() {
|
|
err := m.GetBackingStore().Set("administrativeUnits", value)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
}
|
|
// SetDeletedItems sets the deletedItems property value. Recently deleted items. Read-only. Nullable.
|
|
func (m *Directory) SetDeletedItems(value []DirectoryObjectable)() {
|
|
err := m.GetBackingStore().Set("deletedItems", value)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
}
|
|
// SetFederationConfigurations sets the federationConfigurations property value. Configure domain federation with organizations whose identity provider (IdP) supports either the SAML or WS-Fed protocol.
|
|
func (m *Directory) SetFederationConfigurations(value []IdentityProviderBaseable)() {
|
|
err := m.GetBackingStore().Set("federationConfigurations", value)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
}
|
|
// SetOnPremisesSynchronization sets the onPremisesSynchronization property value. A container for on-premises directory synchronization functionalities that are available for the organization.
|
|
func (m *Directory) SetOnPremisesSynchronization(value []OnPremisesDirectorySynchronizationable)() {
|
|
err := m.GetBackingStore().Set("onPremisesSynchronization", value)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
}
|
|
// Directoryable
|
|
type Directoryable interface {
|
|
Entityable
|
|
i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable
|
|
GetAdministrativeUnits()([]AdministrativeUnitable)
|
|
GetDeletedItems()([]DirectoryObjectable)
|
|
GetFederationConfigurations()([]IdentityProviderBaseable)
|
|
GetOnPremisesSynchronization()([]OnPremisesDirectorySynchronizationable)
|
|
SetAdministrativeUnits(value []AdministrativeUnitable)()
|
|
SetDeletedItems(value []DirectoryObjectable)()
|
|
SetFederationConfigurations(value []IdentityProviderBaseable)()
|
|
SetOnPremisesSynchronization(value []OnPremisesDirectorySynchronizationable)()
|
|
}
|