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

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

// IoTManagerInternalUpdateDeviceStatusesRequestInner struct for IoTManagerInternalUpdateDeviceStatusesRequestInner
type IoTManagerInternalUpdateDeviceStatusesRequestInner struct {
	// Device ID.
	Id string `json:"id"`
}

type _IoTManagerInternalUpdateDeviceStatusesRequestInner IoTManagerInternalUpdateDeviceStatusesRequestInner

// NewIoTManagerInternalUpdateDeviceStatusesRequestInner instantiates a new IoTManagerInternalUpdateDeviceStatusesRequestInner 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 NewIoTManagerInternalUpdateDeviceStatusesRequestInner(id string) *IoTManagerInternalUpdateDeviceStatusesRequestInner {
	this := IoTManagerInternalUpdateDeviceStatusesRequestInner{}
	this.Id = id
	return &this
}

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

// GetId returns the Id field value
func (o *IoTManagerInternalUpdateDeviceStatusesRequestInner) GetId() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.Id
}

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

// SetId sets field value
func (o *IoTManagerInternalUpdateDeviceStatusesRequestInner) SetId(v string) {
	o.Id = v
}

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

func (o IoTManagerInternalUpdateDeviceStatusesRequestInner) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	toSerialize["id"] = o.Id
	return toSerialize, nil
}

func (o *IoTManagerInternalUpdateDeviceStatusesRequestInner) UnmarshalJSON(data []byte) (err error) {
	// This validates that all required properties are included in the JSON object
	// by unmarshalling the object into a generic map with string keys and checking
	// that every required field exists as a key in the generic map.
	requiredProperties := []string{
		"id",
	}

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

	err = json.Unmarshal(data, &allProperties)

	if err != nil {
		return err;
	}

	for _, requiredProperty := range(requiredProperties) {
		if _, exists := allProperties[requiredProperty]; !exists {
			return fmt.Errorf("no value given for required property %v", requiredProperty)
		}
	}

	varIoTManagerInternalUpdateDeviceStatusesRequestInner := _IoTManagerInternalUpdateDeviceStatusesRequestInner{}

	decoder := json.NewDecoder(bytes.NewReader(data))
	decoder.DisallowUnknownFields()
	err = decoder.Decode(&varIoTManagerInternalUpdateDeviceStatusesRequestInner)

	if err != nil {
		return err
	}

	*o = IoTManagerInternalUpdateDeviceStatusesRequestInner(varIoTManagerInternalUpdateDeviceStatusesRequestInner)

	return err
}

type NullableIoTManagerInternalUpdateDeviceStatusesRequestInner struct {
	value *IoTManagerInternalUpdateDeviceStatusesRequestInner
	isSet bool
}

func (v NullableIoTManagerInternalUpdateDeviceStatusesRequestInner) Get() *IoTManagerInternalUpdateDeviceStatusesRequestInner {
	return v.value
}

func (v *NullableIoTManagerInternalUpdateDeviceStatusesRequestInner) Set(val *IoTManagerInternalUpdateDeviceStatusesRequestInner) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableIoTManagerInternalUpdateDeviceStatusesRequestInner(val *IoTManagerInternalUpdateDeviceStatusesRequestInner) *NullableIoTManagerInternalUpdateDeviceStatusesRequestInner {
	return &NullableIoTManagerInternalUpdateDeviceStatusesRequestInner{value: val, isSet: true}
}

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

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


