// Code generated by Microsoft Kiota - DO NOT EDIT.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.

package models

import (
    i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization"
)

type TenantDataSecurityAndGovernance struct {
    DataSecurityAndGovernance
}
// NewTenantDataSecurityAndGovernance instantiates a new TenantDataSecurityAndGovernance and sets the default values.
func NewTenantDataSecurityAndGovernance()(*TenantDataSecurityAndGovernance) {
    m := &TenantDataSecurityAndGovernance{
        DataSecurityAndGovernance: *NewDataSecurityAndGovernance(),
    }
    odataTypeValue := "#microsoft.graph.tenantDataSecurityAndGovernance"
    m.SetOdataType(&odataTypeValue)
    return m
}
// CreateTenantDataSecurityAndGovernanceFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value
// returns a Parsable when successful
func CreateTenantDataSecurityAndGovernanceFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) {
    return NewTenantDataSecurityAndGovernance(), nil
}
// GetFieldDeserializers the deserialization information for the current model
// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful
func (m *TenantDataSecurityAndGovernance) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) {
    res := m.DataSecurityAndGovernance.GetFieldDeserializers()
    res["protectionScopes"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
        val, err := n.GetObjectValue(CreateTenantProtectionScopeContainerFromDiscriminatorValue)
        if err != nil {
            return err
        }
        if val != nil {
            m.SetProtectionScopes(val.(TenantProtectionScopeContainerable))
        }
        return nil
    }
    return res
}
// GetProtectionScopes gets the protectionScopes property value. The protectionScopes property
// returns a TenantProtectionScopeContainerable when successful
func (m *TenantDataSecurityAndGovernance) GetProtectionScopes()(TenantProtectionScopeContainerable) {
    val, err := m.GetBackingStore().Get("protectionScopes")
    if err != nil {
        panic(err)
    }
    if val != nil {
        return val.(TenantProtectionScopeContainerable)
    }
    return nil
}
// Serialize serializes information the current object
func (m *TenantDataSecurityAndGovernance) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) {
    err := m.DataSecurityAndGovernance.Serialize(writer)
    if err != nil {
        return err
    }
    {
        err = writer.WriteObjectValue("protectionScopes", m.GetProtectionScopes())
        if err != nil {
            return err
        }
    }
    return nil
}
// SetProtectionScopes sets the protectionScopes property value. The protectionScopes property
func (m *TenantDataSecurityAndGovernance) SetProtectionScopes(value TenantProtectionScopeContainerable)() {
    err := m.GetBackingStore().Set("protectionScopes", value)
    if err != nil {
        panic(err)
    }
}
type TenantDataSecurityAndGovernanceable interface {
    DataSecurityAndGovernanceable
    i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable
    GetProtectionScopes()(TenantProtectionScopeContainerable)
    SetProtectionScopes(value TenantProtectionScopeContainerable)()
}
