/*
gravity

No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)

API version: 0.28.1
*/

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

package api

import (
	"encoding/json"
)

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

// EtcdAPIMember struct for EtcdAPIMember
type EtcdAPIMember struct {
	Id        *string `json:"id,omitempty"`
	IsLeader  *bool   `json:"isLeader,omitempty"`
	IsLearner *bool   `json:"isLearner,omitempty"`
	Name      *string `json:"name,omitempty"`
}

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

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

// GetId returns the Id field value if set, zero value otherwise.
func (o *EtcdAPIMember) 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 *EtcdAPIMember) 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 *EtcdAPIMember) 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 *EtcdAPIMember) SetId(v string) {
	o.Id = &v
}

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

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

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

	return false
}

// SetIsLeader gets a reference to the given bool and assigns it to the IsLeader field.
func (o *EtcdAPIMember) SetIsLeader(v bool) {
	o.IsLeader = &v
}

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

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

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

	return false
}

// SetIsLearner gets a reference to the given bool and assigns it to the IsLearner field.
func (o *EtcdAPIMember) SetIsLearner(v bool) {
	o.IsLearner = &v
}

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

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

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

	return false
}

// SetName gets a reference to the given string and assigns it to the Name field.
func (o *EtcdAPIMember) SetName(v string) {
	o.Name = &v
}

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

func (o EtcdAPIMember) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !IsNil(o.Id) {
		toSerialize["id"] = o.Id
	}
	if !IsNil(o.IsLeader) {
		toSerialize["isLeader"] = o.IsLeader
	}
	if !IsNil(o.IsLearner) {
		toSerialize["isLearner"] = o.IsLearner
	}
	if !IsNil(o.Name) {
		toSerialize["name"] = o.Name
	}
	return toSerialize, nil
}

type NullableEtcdAPIMember struct {
	value *EtcdAPIMember
	isSet bool
}

func (v NullableEtcdAPIMember) Get() *EtcdAPIMember {
	return v.value
}

func (v *NullableEtcdAPIMember) Set(val *EtcdAPIMember) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableEtcdAPIMember(val *EtcdAPIMember) *NullableEtcdAPIMember {
	return &NullableEtcdAPIMember{value: val, isSet: true}
}

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

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