/*
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"
)

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

// IdentificationChallengeResponseRequest Identification challenge
type IdentificationChallengeResponseRequest struct {
	Component            *string                `json:"component,omitempty"`
	UidField             NullableString         `json:"uid_field,omitempty"`
	Password             NullableString         `json:"password,omitempty"`
	CaptchaToken         NullableString         `json:"captcha_token,omitempty"`
	Passkey              map[string]interface{} `json:"passkey,omitempty"`
	AdditionalProperties map[string]interface{}
}

type _IdentificationChallengeResponseRequest IdentificationChallengeResponseRequest

// NewIdentificationChallengeResponseRequest instantiates a new IdentificationChallengeResponseRequest 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 NewIdentificationChallengeResponseRequest() *IdentificationChallengeResponseRequest {
	this := IdentificationChallengeResponseRequest{}
	var component string = "ak-stage-identification"
	this.Component = &component
	return &this
}

// NewIdentificationChallengeResponseRequestWithDefaults instantiates a new IdentificationChallengeResponseRequest 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 NewIdentificationChallengeResponseRequestWithDefaults() *IdentificationChallengeResponseRequest {
	this := IdentificationChallengeResponseRequest{}
	var component string = "ak-stage-identification"
	this.Component = &component
	return &this
}

// GetComponent returns the Component field value if set, zero value otherwise.
func (o *IdentificationChallengeResponseRequest) 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 *IdentificationChallengeResponseRequest) 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 *IdentificationChallengeResponseRequest) 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 *IdentificationChallengeResponseRequest) SetComponent(v string) {
	o.Component = &v
}

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

// GetUidFieldOk returns a tuple with the UidField 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 *IdentificationChallengeResponseRequest) GetUidFieldOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return o.UidField.Get(), o.UidField.IsSet()
}

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

	return false
}

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

// SetUidFieldNil sets the value for UidField to be an explicit nil
func (o *IdentificationChallengeResponseRequest) SetUidFieldNil() {
	o.UidField.Set(nil)
}

// UnsetUidField ensures that no value is present for UidField, not even an explicit nil
func (o *IdentificationChallengeResponseRequest) UnsetUidField() {
	o.UidField.Unset()
}

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

// GetPasswordOk returns a tuple with the Password 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 *IdentificationChallengeResponseRequest) GetPasswordOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return o.Password.Get(), o.Password.IsSet()
}

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

	return false
}

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

// SetPasswordNil sets the value for Password to be an explicit nil
func (o *IdentificationChallengeResponseRequest) SetPasswordNil() {
	o.Password.Set(nil)
}

// UnsetPassword ensures that no value is present for Password, not even an explicit nil
func (o *IdentificationChallengeResponseRequest) UnsetPassword() {
	o.Password.Unset()
}

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

// GetCaptchaTokenOk returns a tuple with the CaptchaToken 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 *IdentificationChallengeResponseRequest) GetCaptchaTokenOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return o.CaptchaToken.Get(), o.CaptchaToken.IsSet()
}

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

	return false
}

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

// SetCaptchaTokenNil sets the value for CaptchaToken to be an explicit nil
func (o *IdentificationChallengeResponseRequest) SetCaptchaTokenNil() {
	o.CaptchaToken.Set(nil)
}

// UnsetCaptchaToken ensures that no value is present for CaptchaToken, not even an explicit nil
func (o *IdentificationChallengeResponseRequest) UnsetCaptchaToken() {
	o.CaptchaToken.Unset()
}

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

// GetPasskeyOk returns a tuple with the Passkey 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 *IdentificationChallengeResponseRequest) GetPasskeyOk() (map[string]interface{}, bool) {
	if o == nil || IsNil(o.Passkey) {
		return map[string]interface{}{}, false
	}
	return o.Passkey, true
}

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

	return false
}

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

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

func (o IdentificationChallengeResponseRequest) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !IsNil(o.Component) {
		toSerialize["component"] = o.Component
	}
	if o.UidField.IsSet() {
		toSerialize["uid_field"] = o.UidField.Get()
	}
	if o.Password.IsSet() {
		toSerialize["password"] = o.Password.Get()
	}
	if o.CaptchaToken.IsSet() {
		toSerialize["captcha_token"] = o.CaptchaToken.Get()
	}
	if o.Passkey != nil {
		toSerialize["passkey"] = o.Passkey
	}

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

	return toSerialize, nil
}

func (o *IdentificationChallengeResponseRequest) UnmarshalJSON(data []byte) (err error) {
	varIdentificationChallengeResponseRequest := _IdentificationChallengeResponseRequest{}

	err = json.Unmarshal(data, &varIdentificationChallengeResponseRequest)

	if err != nil {
		return err
	}

	*o = IdentificationChallengeResponseRequest(varIdentificationChallengeResponseRequest)

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

	if err = json.Unmarshal(data, &additionalProperties); err == nil {
		delete(additionalProperties, "component")
		delete(additionalProperties, "uid_field")
		delete(additionalProperties, "password")
		delete(additionalProperties, "captcha_token")
		delete(additionalProperties, "passkey")
		o.AdditionalProperties = additionalProperties
	}

	return err
}

type NullableIdentificationChallengeResponseRequest struct {
	value *IdentificationChallengeResponseRequest
	isSet bool
}

func (v NullableIdentificationChallengeResponseRequest) Get() *IdentificationChallengeResponseRequest {
	return v.value
}

func (v *NullableIdentificationChallengeResponseRequest) Set(val *IdentificationChallengeResponseRequest) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableIdentificationChallengeResponseRequest(val *IdentificationChallengeResponseRequest) *NullableIdentificationChallengeResponseRequest {
	return &NullableIdentificationChallengeResponseRequest{value: val, isSet: true}
}

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

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