// 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"
	ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e "github.com/microsoft/kiota-abstractions-go/store"
)

type ImplicitGrantSettings struct {
	// Stores model information.
	backingStore ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore
}

// NewImplicitGrantSettings instantiates a new ImplicitGrantSettings and sets the default values.
func NewImplicitGrantSettings() *ImplicitGrantSettings {
	m := &ImplicitGrantSettings{}
	m.backingStore = ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStoreFactoryInstance()
	return m
}

// CreateImplicitGrantSettingsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value
// returns a Parsable when successful
func CreateImplicitGrantSettingsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) {
	return NewImplicitGrantSettings(), nil
}

// GetBackingStore gets the BackingStore property value. Stores model information.
// returns a BackingStore when successful
func (m *ImplicitGrantSettings) GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore {
	return m.backingStore
}

// GetEnableAccessTokenIssuance gets the enableAccessTokenIssuance property value. Specifies whether this web application can request an access token using the OAuth 2.0 implicit flow.
// returns a *bool when successful
func (m *ImplicitGrantSettings) GetEnableAccessTokenIssuance() *bool {
	val, err := m.GetBackingStore().Get("enableAccessTokenIssuance")
	if err != nil {
		panic(err)
	}
	if val != nil {
		return val.(*bool)
	}
	return nil
}

// GetEnableIdTokenIssuance gets the enableIdTokenIssuance property value. Specifies whether this web application can request an ID token using the OAuth 2.0 implicit flow.
// returns a *bool when successful
func (m *ImplicitGrantSettings) GetEnableIdTokenIssuance() *bool {
	val, err := m.GetBackingStore().Get("enableIdTokenIssuance")
	if err != nil {
		panic(err)
	}
	if val != nil {
		return val.(*bool)
	}
	return nil
}

// GetFieldDeserializers the deserialization information for the current model
// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful
func (m *ImplicitGrantSettings) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
	res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error)
	res["enableAccessTokenIssuance"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
		val, err := n.GetBoolValue()
		if err != nil {
			return err
		}
		if val != nil {
			m.SetEnableAccessTokenIssuance(val)
		}
		return nil
	}
	res["enableIdTokenIssuance"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
		val, err := n.GetBoolValue()
		if err != nil {
			return err
		}
		if val != nil {
			m.SetEnableIdTokenIssuance(val)
		}
		return nil
	}
	res["@odata.type"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
		val, err := n.GetStringValue()
		if err != nil {
			return err
		}
		if val != nil {
			m.SetOdataType(val)
		}
		return nil
	}
	return res
}

// GetOdataType gets the @odata.type property value. The OdataType property
// returns a *string when successful
func (m *ImplicitGrantSettings) GetOdataType() *string {
	val, err := m.GetBackingStore().Get("odataType")
	if err != nil {
		panic(err)
	}
	if val != nil {
		return val.(*string)
	}
	return nil
}

// Serialize serializes information the current object
func (m *ImplicitGrantSettings) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error {
	{
		err := writer.WriteBoolValue("enableAccessTokenIssuance", m.GetEnableAccessTokenIssuance())
		if err != nil {
			return err
		}
	}
	{
		err := writer.WriteBoolValue("enableIdTokenIssuance", m.GetEnableIdTokenIssuance())
		if err != nil {
			return err
		}
	}
	{
		err := writer.WriteStringValue("@odata.type", m.GetOdataType())
		if err != nil {
			return err
		}
	}
	return nil
}

// SetBackingStore sets the BackingStore property value. Stores model information.
func (m *ImplicitGrantSettings) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) {
	m.backingStore = value
}

// SetEnableAccessTokenIssuance sets the enableAccessTokenIssuance property value. Specifies whether this web application can request an access token using the OAuth 2.0 implicit flow.
func (m *ImplicitGrantSettings) SetEnableAccessTokenIssuance(value *bool) {
	err := m.GetBackingStore().Set("enableAccessTokenIssuance", value)
	if err != nil {
		panic(err)
	}
}

// SetEnableIdTokenIssuance sets the enableIdTokenIssuance property value. Specifies whether this web application can request an ID token using the OAuth 2.0 implicit flow.
func (m *ImplicitGrantSettings) SetEnableIdTokenIssuance(value *bool) {
	err := m.GetBackingStore().Set("enableIdTokenIssuance", value)
	if err != nil {
		panic(err)
	}
}

// SetOdataType sets the @odata.type property value. The OdataType property
func (m *ImplicitGrantSettings) SetOdataType(value *string) {
	err := m.GetBackingStore().Set("odataType", value)
	if err != nil {
		panic(err)
	}
}

type ImplicitGrantSettingsable interface {
	ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackedModel
	i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable
	GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore
	GetEnableAccessTokenIssuance() *bool
	GetEnableIdTokenIssuance() *bool
	GetOdataType() *string
	SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore)
	SetEnableAccessTokenIssuance(value *bool)
	SetEnableIdTokenIssuance(value *bool)
	SetOdataType(value *string)
}
