/*
AutoGlue API

API for managing K3s clusters across cloud providers

API version: 1.0
*/

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

package autoglue

import (
	"encoding/json"
)

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

// HandlersMemberOut struct for HandlersMemberOut
type HandlersMemberOut struct {
	Email *string `json:"email,omitempty"`
	// owner/admin/member
	Role   *string `json:"role,omitempty"`
	UserId *string `json:"user_id,omitempty"`
}

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

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

// GetEmail returns the Email field value if set, zero value otherwise.
func (o *HandlersMemberOut) 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 *HandlersMemberOut) 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 *HandlersMemberOut) 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 *HandlersMemberOut) SetEmail(v string) {
	o.Email = &v
}

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

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

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

	return false
}

// SetRole gets a reference to the given string and assigns it to the Role field.
func (o *HandlersMemberOut) SetRole(v string) {
	o.Role = &v
}

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

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

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

	return false
}

// SetUserId gets a reference to the given string and assigns it to the UserId field.
func (o *HandlersMemberOut) SetUserId(v string) {
	o.UserId = &v
}

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

func (o HandlersMemberOut) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !IsNil(o.Email) {
		toSerialize["email"] = o.Email
	}
	if !IsNil(o.Role) {
		toSerialize["role"] = o.Role
	}
	if !IsNil(o.UserId) {
		toSerialize["user_id"] = o.UserId
	}
	return toSerialize, nil
}

type NullableHandlersMemberOut struct {
	value *HandlersMemberOut
	isSet bool
}

func (v NullableHandlersMemberOut) Get() *HandlersMemberOut {
	return v.value
}

func (v *NullableHandlersMemberOut) Set(val *HandlersMemberOut) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableHandlersMemberOut(val *HandlersMemberOut) *NullableHandlersMemberOut {
	return &NullableHandlersMemberOut{value: val, isSet: true}
}

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

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