/*
authentik

Making authentication simple.

API version: 2026.5.0-rc1
Contact: hello@goauthentik.io
*/

// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.

package api

import (
	"encoding/json"
	"fmt"
)

// checks if the IdentificationChallenge type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &IdentificationChallenge{}

// IdentificationChallenge Identification challenges with all UI elements
type IdentificationChallenge struct {
	FlowInfo              *ContextualFlowInfo       `json:"flow_info,omitempty"`
	Component             *string                   `json:"component,omitempty"`
	ResponseErrors        *map[string][]ErrorDetail `json:"response_errors,omitempty"`
	UserFields            []string                  `json:"user_fields"`
	PendingUserIdentifier NullableString            `json:"pending_user_identifier,omitempty"`
	PasswordFields        bool                      `json:"password_fields"`
	AllowShowPassword     *bool                     `json:"allow_show_password,omitempty"`
	ApplicationPre        *string                   `json:"application_pre,omitempty"`
	ApplicationPreLaunch  *string                   `json:"application_pre_launch,omitempty"`
	FlowDesignation       FlowDesignationEnum       `json:"flow_designation"`
	CaptchaStage          NullableCaptchaChallenge  `json:"captcha_stage,omitempty"`
	EnrollUrl             *string                   `json:"enroll_url,omitempty"`
	RecoveryUrl           *string                   `json:"recovery_url,omitempty"`
	PasswordlessUrl       *string                   `json:"passwordless_url,omitempty"`
	PrimaryAction         string                    `json:"primary_action"`
	Sources               []LoginSource             `json:"sources,omitempty"`
	ShowSourceLabels      bool                      `json:"show_source_labels"`
	EnableRememberMe      *bool                     `json:"enable_remember_me,omitempty"`
	PasskeyChallenge      map[string]interface{}    `json:"passkey_challenge,omitempty"`
	AdditionalProperties  map[string]interface{}
}

type _IdentificationChallenge IdentificationChallenge

// NewIdentificationChallenge instantiates a new IdentificationChallenge object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewIdentificationChallenge(userFields []string, passwordFields bool, flowDesignation FlowDesignationEnum, primaryAction string, showSourceLabels bool) *IdentificationChallenge {
	this := IdentificationChallenge{}
	var component string = "ak-stage-identification"
	this.Component = &component
	this.UserFields = userFields
	this.PasswordFields = passwordFields
	var allowShowPassword bool = false
	this.AllowShowPassword = &allowShowPassword
	this.FlowDesignation = flowDesignation
	this.PrimaryAction = primaryAction
	this.ShowSourceLabels = showSourceLabels
	var enableRememberMe bool = true
	this.EnableRememberMe = &enableRememberMe
	return &this
}

// NewIdentificationChallengeWithDefaults instantiates a new IdentificationChallenge object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewIdentificationChallengeWithDefaults() *IdentificationChallenge {
	this := IdentificationChallenge{}
	var component string = "ak-stage-identification"
	this.Component = &component
	var allowShowPassword bool = false
	this.AllowShowPassword = &allowShowPassword
	var enableRememberMe bool = true
	this.EnableRememberMe = &enableRememberMe
	return &this
}

// GetFlowInfo returns the FlowInfo field value if set, zero value otherwise.
func (o *IdentificationChallenge) GetFlowInfo() ContextualFlowInfo {
	if o == nil || IsNil(o.FlowInfo) {
		var ret ContextualFlowInfo
		return ret
	}
	return *o.FlowInfo
}

// GetFlowInfoOk returns a tuple with the FlowInfo field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IdentificationChallenge) GetFlowInfoOk() (*ContextualFlowInfo, bool) {
	if o == nil || IsNil(o.FlowInfo) {
		return nil, false
	}
	return o.FlowInfo, true
}

// HasFlowInfo returns a boolean if a field has been set.
func (o *IdentificationChallenge) HasFlowInfo() bool {
	if o != nil && !IsNil(o.FlowInfo) {
		return true
	}

	return false
}

// SetFlowInfo gets a reference to the given ContextualFlowInfo and assigns it to the FlowInfo field.
func (o *IdentificationChallenge) SetFlowInfo(v ContextualFlowInfo) {
	o.FlowInfo = &v
}

// GetComponent returns the Component field value if set, zero value otherwise.
func (o *IdentificationChallenge) GetComponent() string {
	if o == nil || IsNil(o.Component) {
		var ret string
		return ret
	}
	return *o.Component
}

// GetComponentOk returns a tuple with the Component field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IdentificationChallenge) GetComponentOk() (*string, bool) {
	if o == nil || IsNil(o.Component) {
		return nil, false
	}
	return o.Component, true
}

// HasComponent returns a boolean if a field has been set.
func (o *IdentificationChallenge) HasComponent() bool {
	if o != nil && !IsNil(o.Component) {
		return true
	}

	return false
}

// SetComponent gets a reference to the given string and assigns it to the Component field.
func (o *IdentificationChallenge) SetComponent(v string) {
	o.Component = &v
}

// GetResponseErrors returns the ResponseErrors field value if set, zero value otherwise.
func (o *IdentificationChallenge) GetResponseErrors() map[string][]ErrorDetail {
	if o == nil || IsNil(o.ResponseErrors) {
		var ret map[string][]ErrorDetail
		return ret
	}
	return *o.ResponseErrors
}

// GetResponseErrorsOk returns a tuple with the ResponseErrors field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IdentificationChallenge) GetResponseErrorsOk() (*map[string][]ErrorDetail, bool) {
	if o == nil || IsNil(o.ResponseErrors) {
		return nil, false
	}
	return o.ResponseErrors, true
}

// HasResponseErrors returns a boolean if a field has been set.
func (o *IdentificationChallenge) HasResponseErrors() bool {
	if o != nil && !IsNil(o.ResponseErrors) {
		return true
	}

	return false
}

// SetResponseErrors gets a reference to the given map[string][]ErrorDetail and assigns it to the ResponseErrors field.
func (o *IdentificationChallenge) SetResponseErrors(v map[string][]ErrorDetail) {
	o.ResponseErrors = &v
}

// GetUserFields returns the UserFields field value
// If the value is explicit nil, the zero value for []string will be returned
func (o *IdentificationChallenge) GetUserFields() []string {
	if o == nil {
		var ret []string
		return ret
	}

	return o.UserFields
}

// GetUserFieldsOk returns a tuple with the UserFields field value
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *IdentificationChallenge) GetUserFieldsOk() ([]string, bool) {
	if o == nil || IsNil(o.UserFields) {
		return nil, false
	}
	return o.UserFields, true
}

// SetUserFields sets field value
func (o *IdentificationChallenge) SetUserFields(v []string) {
	o.UserFields = v
}

// GetPendingUserIdentifier returns the PendingUserIdentifier field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *IdentificationChallenge) GetPendingUserIdentifier() string {
	if o == nil || IsNil(o.PendingUserIdentifier.Get()) {
		var ret string
		return ret
	}
	return *o.PendingUserIdentifier.Get()
}

// GetPendingUserIdentifierOk returns a tuple with the PendingUserIdentifier field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *IdentificationChallenge) GetPendingUserIdentifierOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return o.PendingUserIdentifier.Get(), o.PendingUserIdentifier.IsSet()
}

// HasPendingUserIdentifier returns a boolean if a field has been set.
func (o *IdentificationChallenge) HasPendingUserIdentifier() bool {
	if o != nil && o.PendingUserIdentifier.IsSet() {
		return true
	}

	return false
}

// SetPendingUserIdentifier gets a reference to the given NullableString and assigns it to the PendingUserIdentifier field.
func (o *IdentificationChallenge) SetPendingUserIdentifier(v string) {
	o.PendingUserIdentifier.Set(&v)
}

// SetPendingUserIdentifierNil sets the value for PendingUserIdentifier to be an explicit nil
func (o *IdentificationChallenge) SetPendingUserIdentifierNil() {
	o.PendingUserIdentifier.Set(nil)
}

// UnsetPendingUserIdentifier ensures that no value is present for PendingUserIdentifier, not even an explicit nil
func (o *IdentificationChallenge) UnsetPendingUserIdentifier() {
	o.PendingUserIdentifier.Unset()
}

// GetPasswordFields returns the PasswordFields field value
func (o *IdentificationChallenge) GetPasswordFields() bool {
	if o == nil {
		var ret bool
		return ret
	}

	return o.PasswordFields
}

// GetPasswordFieldsOk returns a tuple with the PasswordFields field value
// and a boolean to check if the value has been set.
func (o *IdentificationChallenge) GetPasswordFieldsOk() (*bool, bool) {
	if o == nil {
		return nil, false
	}
	return &o.PasswordFields, true
}

// SetPasswordFields sets field value
func (o *IdentificationChallenge) SetPasswordFields(v bool) {
	o.PasswordFields = v
}

// GetAllowShowPassword returns the AllowShowPassword field value if set, zero value otherwise.
func (o *IdentificationChallenge) GetAllowShowPassword() bool {
	if o == nil || IsNil(o.AllowShowPassword) {
		var ret bool
		return ret
	}
	return *o.AllowShowPassword
}

// GetAllowShowPasswordOk returns a tuple with the AllowShowPassword field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IdentificationChallenge) GetAllowShowPasswordOk() (*bool, bool) {
	if o == nil || IsNil(o.AllowShowPassword) {
		return nil, false
	}
	return o.AllowShowPassword, true
}

// HasAllowShowPassword returns a boolean if a field has been set.
func (o *IdentificationChallenge) HasAllowShowPassword() bool {
	if o != nil && !IsNil(o.AllowShowPassword) {
		return true
	}

	return false
}

// SetAllowShowPassword gets a reference to the given bool and assigns it to the AllowShowPassword field.
func (o *IdentificationChallenge) SetAllowShowPassword(v bool) {
	o.AllowShowPassword = &v
}

// GetApplicationPre returns the ApplicationPre field value if set, zero value otherwise.
func (o *IdentificationChallenge) GetApplicationPre() string {
	if o == nil || IsNil(o.ApplicationPre) {
		var ret string
		return ret
	}
	return *o.ApplicationPre
}

// GetApplicationPreOk returns a tuple with the ApplicationPre field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IdentificationChallenge) GetApplicationPreOk() (*string, bool) {
	if o == nil || IsNil(o.ApplicationPre) {
		return nil, false
	}
	return o.ApplicationPre, true
}

// HasApplicationPre returns a boolean if a field has been set.
func (o *IdentificationChallenge) HasApplicationPre() bool {
	if o != nil && !IsNil(o.ApplicationPre) {
		return true
	}

	return false
}

// SetApplicationPre gets a reference to the given string and assigns it to the ApplicationPre field.
func (o *IdentificationChallenge) SetApplicationPre(v string) {
	o.ApplicationPre = &v
}

// GetApplicationPreLaunch returns the ApplicationPreLaunch field value if set, zero value otherwise.
func (o *IdentificationChallenge) GetApplicationPreLaunch() string {
	if o == nil || IsNil(o.ApplicationPreLaunch) {
		var ret string
		return ret
	}
	return *o.ApplicationPreLaunch
}

// GetApplicationPreLaunchOk returns a tuple with the ApplicationPreLaunch field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IdentificationChallenge) GetApplicationPreLaunchOk() (*string, bool) {
	if o == nil || IsNil(o.ApplicationPreLaunch) {
		return nil, false
	}
	return o.ApplicationPreLaunch, true
}

// HasApplicationPreLaunch returns a boolean if a field has been set.
func (o *IdentificationChallenge) HasApplicationPreLaunch() bool {
	if o != nil && !IsNil(o.ApplicationPreLaunch) {
		return true
	}

	return false
}

// SetApplicationPreLaunch gets a reference to the given string and assigns it to the ApplicationPreLaunch field.
func (o *IdentificationChallenge) SetApplicationPreLaunch(v string) {
	o.ApplicationPreLaunch = &v
}

// GetFlowDesignation returns the FlowDesignation field value
func (o *IdentificationChallenge) GetFlowDesignation() FlowDesignationEnum {
	if o == nil {
		var ret FlowDesignationEnum
		return ret
	}

	return o.FlowDesignation
}

// GetFlowDesignationOk returns a tuple with the FlowDesignation field value
// and a boolean to check if the value has been set.
func (o *IdentificationChallenge) GetFlowDesignationOk() (*FlowDesignationEnum, bool) {
	if o == nil {
		return nil, false
	}
	return &o.FlowDesignation, true
}

// SetFlowDesignation sets field value
func (o *IdentificationChallenge) SetFlowDesignation(v FlowDesignationEnum) {
	o.FlowDesignation = v
}

// GetCaptchaStage returns the CaptchaStage field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *IdentificationChallenge) GetCaptchaStage() CaptchaChallenge {
	if o == nil || IsNil(o.CaptchaStage.Get()) {
		var ret CaptchaChallenge
		return ret
	}
	return *o.CaptchaStage.Get()
}

// GetCaptchaStageOk returns a tuple with the CaptchaStage field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *IdentificationChallenge) GetCaptchaStageOk() (*CaptchaChallenge, bool) {
	if o == nil {
		return nil, false
	}
	return o.CaptchaStage.Get(), o.CaptchaStage.IsSet()
}

// HasCaptchaStage returns a boolean if a field has been set.
func (o *IdentificationChallenge) HasCaptchaStage() bool {
	if o != nil && o.CaptchaStage.IsSet() {
		return true
	}

	return false
}

// SetCaptchaStage gets a reference to the given NullableCaptchaChallenge and assigns it to the CaptchaStage field.
func (o *IdentificationChallenge) SetCaptchaStage(v CaptchaChallenge) {
	o.CaptchaStage.Set(&v)
}

// SetCaptchaStageNil sets the value for CaptchaStage to be an explicit nil
func (o *IdentificationChallenge) SetCaptchaStageNil() {
	o.CaptchaStage.Set(nil)
}

// UnsetCaptchaStage ensures that no value is present for CaptchaStage, not even an explicit nil
func (o *IdentificationChallenge) UnsetCaptchaStage() {
	o.CaptchaStage.Unset()
}

// GetEnrollUrl returns the EnrollUrl field value if set, zero value otherwise.
func (o *IdentificationChallenge) GetEnrollUrl() string {
	if o == nil || IsNil(o.EnrollUrl) {
		var ret string
		return ret
	}
	return *o.EnrollUrl
}

// GetEnrollUrlOk returns a tuple with the EnrollUrl field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IdentificationChallenge) GetEnrollUrlOk() (*string, bool) {
	if o == nil || IsNil(o.EnrollUrl) {
		return nil, false
	}
	return o.EnrollUrl, true
}

// HasEnrollUrl returns a boolean if a field has been set.
func (o *IdentificationChallenge) HasEnrollUrl() bool {
	if o != nil && !IsNil(o.EnrollUrl) {
		return true
	}

	return false
}

// SetEnrollUrl gets a reference to the given string and assigns it to the EnrollUrl field.
func (o *IdentificationChallenge) SetEnrollUrl(v string) {
	o.EnrollUrl = &v
}

// GetRecoveryUrl returns the RecoveryUrl field value if set, zero value otherwise.
func (o *IdentificationChallenge) GetRecoveryUrl() string {
	if o == nil || IsNil(o.RecoveryUrl) {
		var ret string
		return ret
	}
	return *o.RecoveryUrl
}

// GetRecoveryUrlOk returns a tuple with the RecoveryUrl field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IdentificationChallenge) GetRecoveryUrlOk() (*string, bool) {
	if o == nil || IsNil(o.RecoveryUrl) {
		return nil, false
	}
	return o.RecoveryUrl, true
}

// HasRecoveryUrl returns a boolean if a field has been set.
func (o *IdentificationChallenge) HasRecoveryUrl() bool {
	if o != nil && !IsNil(o.RecoveryUrl) {
		return true
	}

	return false
}

// SetRecoveryUrl gets a reference to the given string and assigns it to the RecoveryUrl field.
func (o *IdentificationChallenge) SetRecoveryUrl(v string) {
	o.RecoveryUrl = &v
}

// GetPasswordlessUrl returns the PasswordlessUrl field value if set, zero value otherwise.
func (o *IdentificationChallenge) GetPasswordlessUrl() string {
	if o == nil || IsNil(o.PasswordlessUrl) {
		var ret string
		return ret
	}
	return *o.PasswordlessUrl
}

// GetPasswordlessUrlOk returns a tuple with the PasswordlessUrl field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IdentificationChallenge) GetPasswordlessUrlOk() (*string, bool) {
	if o == nil || IsNil(o.PasswordlessUrl) {
		return nil, false
	}
	return o.PasswordlessUrl, true
}

// HasPasswordlessUrl returns a boolean if a field has been set.
func (o *IdentificationChallenge) HasPasswordlessUrl() bool {
	if o != nil && !IsNil(o.PasswordlessUrl) {
		return true
	}

	return false
}

// SetPasswordlessUrl gets a reference to the given string and assigns it to the PasswordlessUrl field.
func (o *IdentificationChallenge) SetPasswordlessUrl(v string) {
	o.PasswordlessUrl = &v
}

// GetPrimaryAction returns the PrimaryAction field value
func (o *IdentificationChallenge) GetPrimaryAction() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.PrimaryAction
}

// GetPrimaryActionOk returns a tuple with the PrimaryAction field value
// and a boolean to check if the value has been set.
func (o *IdentificationChallenge) GetPrimaryActionOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return &o.PrimaryAction, true
}

// SetPrimaryAction sets field value
func (o *IdentificationChallenge) SetPrimaryAction(v string) {
	o.PrimaryAction = v
}

// GetSources returns the Sources field value if set, zero value otherwise.
func (o *IdentificationChallenge) GetSources() []LoginSource {
	if o == nil || IsNil(o.Sources) {
		var ret []LoginSource
		return ret
	}
	return o.Sources
}

// GetSourcesOk returns a tuple with the Sources field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IdentificationChallenge) GetSourcesOk() ([]LoginSource, bool) {
	if o == nil || IsNil(o.Sources) {
		return nil, false
	}
	return o.Sources, true
}

// HasSources returns a boolean if a field has been set.
func (o *IdentificationChallenge) HasSources() bool {
	if o != nil && !IsNil(o.Sources) {
		return true
	}

	return false
}

// SetSources gets a reference to the given []LoginSource and assigns it to the Sources field.
func (o *IdentificationChallenge) SetSources(v []LoginSource) {
	o.Sources = v
}

// GetShowSourceLabels returns the ShowSourceLabels field value
func (o *IdentificationChallenge) GetShowSourceLabels() bool {
	if o == nil {
		var ret bool
		return ret
	}

	return o.ShowSourceLabels
}

// GetShowSourceLabelsOk returns a tuple with the ShowSourceLabels field value
// and a boolean to check if the value has been set.
func (o *IdentificationChallenge) GetShowSourceLabelsOk() (*bool, bool) {
	if o == nil {
		return nil, false
	}
	return &o.ShowSourceLabels, true
}

// SetShowSourceLabels sets field value
func (o *IdentificationChallenge) SetShowSourceLabels(v bool) {
	o.ShowSourceLabels = v
}

// GetEnableRememberMe returns the EnableRememberMe field value if set, zero value otherwise.
func (o *IdentificationChallenge) GetEnableRememberMe() bool {
	if o == nil || IsNil(o.EnableRememberMe) {
		var ret bool
		return ret
	}
	return *o.EnableRememberMe
}

// GetEnableRememberMeOk returns a tuple with the EnableRememberMe field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IdentificationChallenge) GetEnableRememberMeOk() (*bool, bool) {
	if o == nil || IsNil(o.EnableRememberMe) {
		return nil, false
	}
	return o.EnableRememberMe, true
}

// HasEnableRememberMe returns a boolean if a field has been set.
func (o *IdentificationChallenge) HasEnableRememberMe() bool {
	if o != nil && !IsNil(o.EnableRememberMe) {
		return true
	}

	return false
}

// SetEnableRememberMe gets a reference to the given bool and assigns it to the EnableRememberMe field.
func (o *IdentificationChallenge) SetEnableRememberMe(v bool) {
	o.EnableRememberMe = &v
}

// GetPasskeyChallenge returns the PasskeyChallenge field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *IdentificationChallenge) GetPasskeyChallenge() map[string]interface{} {
	if o == nil {
		var ret map[string]interface{}
		return ret
	}
	return o.PasskeyChallenge
}

// GetPasskeyChallengeOk returns a tuple with the PasskeyChallenge field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *IdentificationChallenge) GetPasskeyChallengeOk() (map[string]interface{}, bool) {
	if o == nil || IsNil(o.PasskeyChallenge) {
		return map[string]interface{}{}, false
	}
	return o.PasskeyChallenge, true
}

// HasPasskeyChallenge returns a boolean if a field has been set.
func (o *IdentificationChallenge) HasPasskeyChallenge() bool {
	if o != nil && !IsNil(o.PasskeyChallenge) {
		return true
	}

	return false
}

// SetPasskeyChallenge gets a reference to the given map[string]interface{} and assigns it to the PasskeyChallenge field.
func (o *IdentificationChallenge) SetPasskeyChallenge(v map[string]interface{}) {
	o.PasskeyChallenge = v
}

func (o IdentificationChallenge) MarshalJSON() ([]byte, error) {
	toSerialize, err := o.ToMap()
	if err != nil {
		return []byte{}, err
	}
	return json.Marshal(toSerialize)
}

func (o IdentificationChallenge) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !IsNil(o.FlowInfo) {
		toSerialize["flow_info"] = o.FlowInfo
	}
	if !IsNil(o.Component) {
		toSerialize["component"] = o.Component
	}
	if !IsNil(o.ResponseErrors) {
		toSerialize["response_errors"] = o.ResponseErrors
	}
	if o.UserFields != nil {
		toSerialize["user_fields"] = o.UserFields
	}
	if o.PendingUserIdentifier.IsSet() {
		toSerialize["pending_user_identifier"] = o.PendingUserIdentifier.Get()
	}
	toSerialize["password_fields"] = o.PasswordFields
	if !IsNil(o.AllowShowPassword) {
		toSerialize["allow_show_password"] = o.AllowShowPassword
	}
	if !IsNil(o.ApplicationPre) {
		toSerialize["application_pre"] = o.ApplicationPre
	}
	if !IsNil(o.ApplicationPreLaunch) {
		toSerialize["application_pre_launch"] = o.ApplicationPreLaunch
	}
	toSerialize["flow_designation"] = o.FlowDesignation
	if o.CaptchaStage.IsSet() {
		toSerialize["captcha_stage"] = o.CaptchaStage.Get()
	}
	if !IsNil(o.EnrollUrl) {
		toSerialize["enroll_url"] = o.EnrollUrl
	}
	if !IsNil(o.RecoveryUrl) {
		toSerialize["recovery_url"] = o.RecoveryUrl
	}
	if !IsNil(o.PasswordlessUrl) {
		toSerialize["passwordless_url"] = o.PasswordlessUrl
	}
	toSerialize["primary_action"] = o.PrimaryAction
	if !IsNil(o.Sources) {
		toSerialize["sources"] = o.Sources
	}
	toSerialize["show_source_labels"] = o.ShowSourceLabels
	if !IsNil(o.EnableRememberMe) {
		toSerialize["enable_remember_me"] = o.EnableRememberMe
	}
	if o.PasskeyChallenge != nil {
		toSerialize["passkey_challenge"] = o.PasskeyChallenge
	}

	for key, value := range o.AdditionalProperties {
		toSerialize[key] = value
	}

	return toSerialize, nil
}

func (o *IdentificationChallenge) UnmarshalJSON(data []byte) (err error) {
	// This validates that all required properties are included in the JSON object
	// by unmarshalling the object into a generic map with string keys and checking
	// that every required field exists as a key in the generic map.
	requiredProperties := []string{
		"user_fields",
		"password_fields",
		"flow_designation",
		"primary_action",
		"show_source_labels",
	}

	allProperties := make(map[string]interface{})

	err = json.Unmarshal(data, &allProperties)

	if err != nil {
		return err
	}

	for _, requiredProperty := range requiredProperties {
		if _, exists := allProperties[requiredProperty]; !exists {
			return fmt.Errorf("no value given for required property %v", requiredProperty)
		}
	}

	varIdentificationChallenge := _IdentificationChallenge{}

	err = json.Unmarshal(data, &varIdentificationChallenge)

	if err != nil {
		return err
	}

	*o = IdentificationChallenge(varIdentificationChallenge)

	additionalProperties := make(map[string]interface{})

	if err = json.Unmarshal(data, &additionalProperties); err == nil {
		delete(additionalProperties, "flow_info")
		delete(additionalProperties, "component")
		delete(additionalProperties, "response_errors")
		delete(additionalProperties, "user_fields")
		delete(additionalProperties, "pending_user_identifier")
		delete(additionalProperties, "password_fields")
		delete(additionalProperties, "allow_show_password")
		delete(additionalProperties, "application_pre")
		delete(additionalProperties, "application_pre_launch")
		delete(additionalProperties, "flow_designation")
		delete(additionalProperties, "captcha_stage")
		delete(additionalProperties, "enroll_url")
		delete(additionalProperties, "recovery_url")
		delete(additionalProperties, "passwordless_url")
		delete(additionalProperties, "primary_action")
		delete(additionalProperties, "sources")
		delete(additionalProperties, "show_source_labels")
		delete(additionalProperties, "enable_remember_me")
		delete(additionalProperties, "passkey_challenge")
		o.AdditionalProperties = additionalProperties
	}

	return err
}

type NullableIdentificationChallenge struct {
	value *IdentificationChallenge
	isSet bool
}

func (v NullableIdentificationChallenge) Get() *IdentificationChallenge {
	return v.value
}

func (v *NullableIdentificationChallenge) Set(val *IdentificationChallenge) {
	v.value = val
	v.isSet = true
}

func (v NullableIdentificationChallenge) IsSet() bool {
	return v.isSet
}

func (v *NullableIdentificationChallenge) Unset() {
	v.value = nil
	v.isSet = false
}

func NewNullableIdentificationChallenge(val *IdentificationChallenge) *NullableIdentificationChallenge {
	return &NullableIdentificationChallenge{value: val, isSet: true}
}

func (v NullableIdentificationChallenge) MarshalJSON() ([]byte, error) {
	return json.Marshal(v.value)
}

func (v *NullableIdentificationChallenge) UnmarshalJSON(src []byte) error {
	v.isSet = true
	return json.Unmarshal(src, &v.value)
}
