// 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 (
    i561e97a8befe7661a44c8f54600992b4207a3a0cf6770e5559949bc276de2e22 "github.com/google/uuid"
    i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization"
)

type PasskeyAuthenticationMethodTarget struct {
    AuthenticationMethodTarget
}
// NewPasskeyAuthenticationMethodTarget instantiates a new PasskeyAuthenticationMethodTarget and sets the default values.
func NewPasskeyAuthenticationMethodTarget()(*PasskeyAuthenticationMethodTarget) {
    m := &PasskeyAuthenticationMethodTarget{
        AuthenticationMethodTarget: *NewAuthenticationMethodTarget(),
    }
    return m
}
// CreatePasskeyAuthenticationMethodTargetFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value
// returns a Parsable when successful
func CreatePasskeyAuthenticationMethodTargetFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) {
    return NewPasskeyAuthenticationMethodTarget(), nil
}
// GetAllowedPasskeyProfiles gets the allowedPasskeyProfiles property value. List of passkey profiles scoped to the targets. Required.
// returns a []UUID when successful
func (m *PasskeyAuthenticationMethodTarget) GetAllowedPasskeyProfiles()([]i561e97a8befe7661a44c8f54600992b4207a3a0cf6770e5559949bc276de2e22.UUID) {
    val, err := m.GetBackingStore().Get("allowedPasskeyProfiles")
    if err != nil {
        panic(err)
    }
    if val != nil {
        return val.([]i561e97a8befe7661a44c8f54600992b4207a3a0cf6770e5559949bc276de2e22.UUID)
    }
    return nil
}
// GetFieldDeserializers the deserialization information for the current model
// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful
func (m *PasskeyAuthenticationMethodTarget) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) {
    res := m.AuthenticationMethodTarget.GetFieldDeserializers()
    res["allowedPasskeyProfiles"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
        val, err := n.GetCollectionOfPrimitiveValues("uuid")
        if err != nil {
            return err
        }
        if val != nil {
            res := make([]i561e97a8befe7661a44c8f54600992b4207a3a0cf6770e5559949bc276de2e22.UUID, len(val))
            for i, v := range val {
                if v != nil {
                    res[i] = *(v.(*i561e97a8befe7661a44c8f54600992b4207a3a0cf6770e5559949bc276de2e22.UUID))
                }
            }
            m.SetAllowedPasskeyProfiles(res)
        }
        return nil
    }
    return res
}
// Serialize serializes information the current object
func (m *PasskeyAuthenticationMethodTarget) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) {
    err := m.AuthenticationMethodTarget.Serialize(writer)
    if err != nil {
        return err
    }
    if m.GetAllowedPasskeyProfiles() != nil {
        err = writer.WriteCollectionOfUUIDValues("allowedPasskeyProfiles", m.GetAllowedPasskeyProfiles())
        if err != nil {
            return err
        }
    }
    return nil
}
// SetAllowedPasskeyProfiles sets the allowedPasskeyProfiles property value. List of passkey profiles scoped to the targets. Required.
func (m *PasskeyAuthenticationMethodTarget) SetAllowedPasskeyProfiles(value []i561e97a8befe7661a44c8f54600992b4207a3a0cf6770e5559949bc276de2e22.UUID)() {
    err := m.GetBackingStore().Set("allowedPasskeyProfiles", value)
    if err != nil {
        panic(err)
    }
}
type PasskeyAuthenticationMethodTargetable interface {
    AuthenticationMethodTargetable
    i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable
    GetAllowedPasskeyProfiles()([]i561e97a8befe7661a44c8f54600992b4207a3a0cf6770e5559949bc276de2e22.UUID)
    SetAllowedPasskeyProfiles(value []i561e97a8befe7661a44c8f54600992b4207a3a0cf6770e5559949bc276de2e22.UUID)()
}
