/*
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 NativeLogoutChallenge type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &NativeLogoutChallenge{}

// NativeLogoutChallenge Challenge for native browser logout
type NativeLogoutChallenge struct {
	FlowInfo             *ContextualFlowInfo       `json:"flow_info,omitempty"`
	Component            *string                   `json:"component,omitempty"`
	ResponseErrors       *map[string][]ErrorDetail `json:"response_errors,omitempty"`
	ProviderName         *string                   `json:"provider_name,omitempty"`
	IsComplete           *bool                     `json:"is_complete,omitempty"`
	PostUrl              *string                   `json:"post_url,omitempty"`
	RedirectUrl          *string                   `json:"redirect_url,omitempty"`
	SamlBinding          *SAMLBindingsEnum         `json:"saml_binding,omitempty"`
	SamlRequest          *string                   `json:"saml_request,omitempty"`
	SamlResponse         *string                   `json:"saml_response,omitempty"`
	SamlRelayState       *string                   `json:"saml_relay_state,omitempty"`
	AdditionalProperties map[string]interface{}
}

type _NativeLogoutChallenge NativeLogoutChallenge

// NewNativeLogoutChallenge instantiates a new NativeLogoutChallenge 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 NewNativeLogoutChallenge() *NativeLogoutChallenge {
	this := NativeLogoutChallenge{}
	var component string = "ak-provider-saml-native-logout"
	this.Component = &component
	var isComplete bool = false
	this.IsComplete = &isComplete
	return &this
}

// NewNativeLogoutChallengeWithDefaults instantiates a new NativeLogoutChallenge 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 NewNativeLogoutChallengeWithDefaults() *NativeLogoutChallenge {
	this := NativeLogoutChallenge{}
	var component string = "ak-provider-saml-native-logout"
	this.Component = &component
	var isComplete bool = false
	this.IsComplete = &isComplete
	return &this
}

// GetFlowInfo returns the FlowInfo field value if set, zero value otherwise.
func (o *NativeLogoutChallenge) 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 *NativeLogoutChallenge) 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 *NativeLogoutChallenge) 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 *NativeLogoutChallenge) SetFlowInfo(v ContextualFlowInfo) {
	o.FlowInfo = &v
}

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

// GetResponseErrors returns the ResponseErrors field value if set, zero value otherwise.
func (o *NativeLogoutChallenge) 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 *NativeLogoutChallenge) 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 *NativeLogoutChallenge) 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 *NativeLogoutChallenge) SetResponseErrors(v map[string][]ErrorDetail) {
	o.ResponseErrors = &v
}

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

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

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

	return false
}

// SetProviderName gets a reference to the given string and assigns it to the ProviderName field.
func (o *NativeLogoutChallenge) SetProviderName(v string) {
	o.ProviderName = &v
}

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

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

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

	return false
}

// SetIsComplete gets a reference to the given bool and assigns it to the IsComplete field.
func (o *NativeLogoutChallenge) SetIsComplete(v bool) {
	o.IsComplete = &v
}

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

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

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

	return false
}

// SetPostUrl gets a reference to the given string and assigns it to the PostUrl field.
func (o *NativeLogoutChallenge) SetPostUrl(v string) {
	o.PostUrl = &v
}

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

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

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

	return false
}

// SetRedirectUrl gets a reference to the given string and assigns it to the RedirectUrl field.
func (o *NativeLogoutChallenge) SetRedirectUrl(v string) {
	o.RedirectUrl = &v
}

// GetSamlBinding returns the SamlBinding field value if set, zero value otherwise.
func (o *NativeLogoutChallenge) GetSamlBinding() SAMLBindingsEnum {
	if o == nil || IsNil(o.SamlBinding) {
		var ret SAMLBindingsEnum
		return ret
	}
	return *o.SamlBinding
}

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

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

	return false
}

// SetSamlBinding gets a reference to the given SAMLBindingsEnum and assigns it to the SamlBinding field.
func (o *NativeLogoutChallenge) SetSamlBinding(v SAMLBindingsEnum) {
	o.SamlBinding = &v
}

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

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

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

	return false
}

// SetSamlRequest gets a reference to the given string and assigns it to the SamlRequest field.
func (o *NativeLogoutChallenge) SetSamlRequest(v string) {
	o.SamlRequest = &v
}

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

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

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

	return false
}

// SetSamlResponse gets a reference to the given string and assigns it to the SamlResponse field.
func (o *NativeLogoutChallenge) SetSamlResponse(v string) {
	o.SamlResponse = &v
}

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

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

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

	return false
}

// SetSamlRelayState gets a reference to the given string and assigns it to the SamlRelayState field.
func (o *NativeLogoutChallenge) SetSamlRelayState(v string) {
	o.SamlRelayState = &v
}

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

func (o NativeLogoutChallenge) 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 !IsNil(o.ProviderName) {
		toSerialize["provider_name"] = o.ProviderName
	}
	if !IsNil(o.IsComplete) {
		toSerialize["is_complete"] = o.IsComplete
	}
	if !IsNil(o.PostUrl) {
		toSerialize["post_url"] = o.PostUrl
	}
	if !IsNil(o.RedirectUrl) {
		toSerialize["redirect_url"] = o.RedirectUrl
	}
	if !IsNil(o.SamlBinding) {
		toSerialize["saml_binding"] = o.SamlBinding
	}
	if !IsNil(o.SamlRequest) {
		toSerialize["saml_request"] = o.SamlRequest
	}
	if !IsNil(o.SamlResponse) {
		toSerialize["saml_response"] = o.SamlResponse
	}
	if !IsNil(o.SamlRelayState) {
		toSerialize["saml_relay_state"] = o.SamlRelayState
	}

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

	return toSerialize, nil
}

func (o *NativeLogoutChallenge) UnmarshalJSON(data []byte) (err error) {
	varNativeLogoutChallenge := _NativeLogoutChallenge{}

	err = json.Unmarshal(data, &varNativeLogoutChallenge)

	if err != nil {
		return err
	}

	*o = NativeLogoutChallenge(varNativeLogoutChallenge)

	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, "provider_name")
		delete(additionalProperties, "is_complete")
		delete(additionalProperties, "post_url")
		delete(additionalProperties, "redirect_url")
		delete(additionalProperties, "saml_binding")
		delete(additionalProperties, "saml_request")
		delete(additionalProperties, "saml_response")
		delete(additionalProperties, "saml_relay_state")
		o.AdditionalProperties = additionalProperties
	}

	return err
}

type NullableNativeLogoutChallenge struct {
	value *NativeLogoutChallenge
	isSet bool
}

func (v NullableNativeLogoutChallenge) Get() *NativeLogoutChallenge {
	return v.value
}

func (v *NullableNativeLogoutChallenge) Set(val *NativeLogoutChallenge) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableNativeLogoutChallenge(val *NativeLogoutChallenge) *NullableNativeLogoutChallenge {
	return &NullableNativeLogoutChallenge{value: val, isSet: true}
}

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

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