/*
Mender API

Combined API specification for the features of the different Mender backend services, suitable for code generation applications 

API version: 1
Contact: support@mender.io
*/

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

package client

import (
	"encoding/json"
)

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

// UserUpdate Update user information.
type UserUpdate struct {
	// A unique email address.
	Email *string `json:"email,omitempty"`
	// New password.
	Password *string `json:"password,omitempty"`
	// Current password.
	CurrentPassword *string `json:"current_password,omitempty"`
}

// NewUserUpdate instantiates a new UserUpdate 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 NewUserUpdate() *UserUpdate {
	this := UserUpdate{}
	return &this
}

// NewUserUpdateWithDefaults instantiates a new UserUpdate 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 NewUserUpdateWithDefaults() *UserUpdate {
	this := UserUpdate{}
	return &this
}

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

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

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

	return false
}

// SetEmail gets a reference to the given string and assigns it to the Email field.
func (o *UserUpdate) SetEmail(v string) {
	o.Email = &v
}

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

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

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

	return false
}

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

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

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

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

	return false
}

// SetCurrentPassword gets a reference to the given string and assigns it to the CurrentPassword field.
func (o *UserUpdate) SetCurrentPassword(v string) {
	o.CurrentPassword = &v
}

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

func (o UserUpdate) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !IsNil(o.Email) {
		toSerialize["email"] = o.Email
	}
	if !IsNil(o.Password) {
		toSerialize["password"] = o.Password
	}
	if !IsNil(o.CurrentPassword) {
		toSerialize["current_password"] = o.CurrentPassword
	}
	return toSerialize, nil
}

type NullableUserUpdate struct {
	value *UserUpdate
	isSet bool
}

func (v NullableUserUpdate) Get() *UserUpdate {
	return v.value
}

func (v *NullableUserUpdate) Set(val *UserUpdate) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableUserUpdate(val *UserUpdate) *NullableUserUpdate {
	return &NullableUserUpdate{value: val, isSet: true}
}

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

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


