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

// DeploymentStatusStatisticsList200ResponseInner struct for DeploymentStatusStatisticsList200ResponseInner
type DeploymentStatusStatisticsList200ResponseInner struct {
	// The deployment ID
	Id *string `json:"id,omitempty"`
	Stats *Statistics `json:"stats,omitempty"`
	AdditionalProperties map[string]interface{}
}

type _DeploymentStatusStatisticsList200ResponseInner DeploymentStatusStatisticsList200ResponseInner

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

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

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

// GetStats returns the Stats field value if set, zero value otherwise.
func (o *DeploymentStatusStatisticsList200ResponseInner) GetStats() Statistics {
	if o == nil || IsNil(o.Stats) {
		var ret Statistics
		return ret
	}
	return *o.Stats
}

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

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

	return false
}

// SetStats gets a reference to the given Statistics and assigns it to the Stats field.
func (o *DeploymentStatusStatisticsList200ResponseInner) SetStats(v Statistics) {
	o.Stats = &v
}

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

func (o DeploymentStatusStatisticsList200ResponseInner) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !IsNil(o.Id) {
		toSerialize["id"] = o.Id
	}
	if !IsNil(o.Stats) {
		toSerialize["stats"] = o.Stats
	}

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

	return toSerialize, nil
}

func (o *DeploymentStatusStatisticsList200ResponseInner) UnmarshalJSON(data []byte) (err error) {
	varDeploymentStatusStatisticsList200ResponseInner := _DeploymentStatusStatisticsList200ResponseInner{}

	err = json.Unmarshal(data, &varDeploymentStatusStatisticsList200ResponseInner)

	if err != nil {
		return err
	}

	*o = DeploymentStatusStatisticsList200ResponseInner(varDeploymentStatusStatisticsList200ResponseInner)

	additionalProperties := make(map[string]interface{})

	if err = json.Unmarshal(data, &additionalProperties); err == nil {
		delete(additionalProperties, "id")
		delete(additionalProperties, "stats")
		o.AdditionalProperties = additionalProperties
	}

	return err
}

type NullableDeploymentStatusStatisticsList200ResponseInner struct {
	value *DeploymentStatusStatisticsList200ResponseInner
	isSet bool
}

func (v NullableDeploymentStatusStatisticsList200ResponseInner) Get() *DeploymentStatusStatisticsList200ResponseInner {
	return v.value
}

func (v *NullableDeploymentStatusStatisticsList200ResponseInner) Set(val *DeploymentStatusStatisticsList200ResponseInner) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableDeploymentStatusStatisticsList200ResponseInner(val *DeploymentStatusStatisticsList200ResponseInner) *NullableDeploymentStatusStatisticsList200ResponseInner {
	return &NullableDeploymentStatusStatisticsList200ResponseInner{value: val, isSet: true}
}

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

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


