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

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

// HandlersMeResponse struct for HandlersMeResponse
type HandlersMeResponse struct {
	AvatarUrl   *string           `json:"avatar_url,omitempty"`
	CreatedAt   *time.Time        `json:"created_at,omitempty"`
	DisplayName *string           `json:"display_name,omitempty"`
	Emails      []ModelsUserEmail `json:"emails,omitempty"`
	// example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
	Id            *string              `json:"id,omitempty"`
	IsAdmin       *bool                `json:"is_admin,omitempty"`
	IsDisabled    *bool                `json:"is_disabled,omitempty"`
	Organizations []ModelsOrganization `json:"organizations,omitempty"`
	PrimaryEmail  *string              `json:"primary_email,omitempty"`
	UpdatedAt     *time.Time           `json:"updated_at,omitempty"`
}

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

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

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

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

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

	return false
}

// SetAvatarUrl gets a reference to the given string and assigns it to the AvatarUrl field.
func (o *HandlersMeResponse) SetAvatarUrl(v string) {
	o.AvatarUrl = &v
}

// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise.
func (o *HandlersMeResponse) GetCreatedAt() time.Time {
	if o == nil || IsNil(o.CreatedAt) {
		var ret time.Time
		return ret
	}
	return *o.CreatedAt
}

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

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

	return false
}

// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field.
func (o *HandlersMeResponse) SetCreatedAt(v time.Time) {
	o.CreatedAt = &v
}

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

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

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

	return false
}

// SetDisplayName gets a reference to the given string and assigns it to the DisplayName field.
func (o *HandlersMeResponse) SetDisplayName(v string) {
	o.DisplayName = &v
}

// GetEmails returns the Emails field value if set, zero value otherwise.
func (o *HandlersMeResponse) GetEmails() []ModelsUserEmail {
	if o == nil || IsNil(o.Emails) {
		var ret []ModelsUserEmail
		return ret
	}
	return o.Emails
}

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

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

	return false
}

// SetEmails gets a reference to the given []ModelsUserEmail and assigns it to the Emails field.
func (o *HandlersMeResponse) SetEmails(v []ModelsUserEmail) {
	o.Emails = v
}

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

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

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

	return false
}

// SetId gets a reference to the given string and assigns it to the Id field.
func (o *HandlersMeResponse) SetId(v string) {
	o.Id = &v
}

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

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

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

	return false
}

// SetIsAdmin gets a reference to the given bool and assigns it to the IsAdmin field.
func (o *HandlersMeResponse) SetIsAdmin(v bool) {
	o.IsAdmin = &v
}

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

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

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

	return false
}

// SetIsDisabled gets a reference to the given bool and assigns it to the IsDisabled field.
func (o *HandlersMeResponse) SetIsDisabled(v bool) {
	o.IsDisabled = &v
}

// GetOrganizations returns the Organizations field value if set, zero value otherwise.
func (o *HandlersMeResponse) GetOrganizations() []ModelsOrganization {
	if o == nil || IsNil(o.Organizations) {
		var ret []ModelsOrganization
		return ret
	}
	return o.Organizations
}

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

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

	return false
}

// SetOrganizations gets a reference to the given []ModelsOrganization and assigns it to the Organizations field.
func (o *HandlersMeResponse) SetOrganizations(v []ModelsOrganization) {
	o.Organizations = v
}

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

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

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

	return false
}

// SetPrimaryEmail gets a reference to the given string and assigns it to the PrimaryEmail field.
func (o *HandlersMeResponse) SetPrimaryEmail(v string) {
	o.PrimaryEmail = &v
}

// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise.
func (o *HandlersMeResponse) GetUpdatedAt() time.Time {
	if o == nil || IsNil(o.UpdatedAt) {
		var ret time.Time
		return ret
	}
	return *o.UpdatedAt
}

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

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

	return false
}

// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field.
func (o *HandlersMeResponse) SetUpdatedAt(v time.Time) {
	o.UpdatedAt = &v
}

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

func (o HandlersMeResponse) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !IsNil(o.AvatarUrl) {
		toSerialize["avatar_url"] = o.AvatarUrl
	}
	if !IsNil(o.CreatedAt) {
		toSerialize["created_at"] = o.CreatedAt
	}
	if !IsNil(o.DisplayName) {
		toSerialize["display_name"] = o.DisplayName
	}
	if !IsNil(o.Emails) {
		toSerialize["emails"] = o.Emails
	}
	if !IsNil(o.Id) {
		toSerialize["id"] = o.Id
	}
	if !IsNil(o.IsAdmin) {
		toSerialize["is_admin"] = o.IsAdmin
	}
	if !IsNil(o.IsDisabled) {
		toSerialize["is_disabled"] = o.IsDisabled
	}
	if !IsNil(o.Organizations) {
		toSerialize["organizations"] = o.Organizations
	}
	if !IsNil(o.PrimaryEmail) {
		toSerialize["primary_email"] = o.PrimaryEmail
	}
	if !IsNil(o.UpdatedAt) {
		toSerialize["updated_at"] = o.UpdatedAt
	}
	return toSerialize, nil
}

type NullableHandlersMeResponse struct {
	value *HandlersMeResponse
	isSet bool
}

func (v NullableHandlersMeResponse) Get() *HandlersMeResponse {
	return v.value
}

func (v *NullableHandlersMeResponse) Set(val *HandlersMeResponse) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableHandlersMeResponse(val *HandlersMeResponse) *NullableHandlersMeResponse {
	return &NullableHandlersMeResponse{value: val, isSet: true}
}

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

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