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

// DeviceAuthManagementSearchDevicesRequest struct for DeviceAuthManagementSearchDevicesRequest
type DeviceAuthManagementSearchDevicesRequest struct {
	// Device status filter. Can be an array for querying devices from multiple device statuses.
	Status []string `json:"status,omitempty"`
	// Device ID filter. Can be a string for querying for a single device.
	Id []string `json:"id,omitempty"`
	AdditionalProperties map[string]interface{}
}

type _DeviceAuthManagementSearchDevicesRequest DeviceAuthManagementSearchDevicesRequest

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

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

// GetStatus returns the Status field value if set, zero value otherwise.
func (o *DeviceAuthManagementSearchDevicesRequest) GetStatus() []string {
	if o == nil || IsNil(o.Status) {
		var ret []string
		return ret
	}
	return o.Status
}

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

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

	return false
}

// SetStatus gets a reference to the given []string and assigns it to the Status field.
func (o *DeviceAuthManagementSearchDevicesRequest) SetStatus(v []string) {
	o.Status = v
}

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

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

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

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

	return toSerialize, nil
}

func (o *DeviceAuthManagementSearchDevicesRequest) UnmarshalJSON(data []byte) (err error) {
	varDeviceAuthManagementSearchDevicesRequest := _DeviceAuthManagementSearchDevicesRequest{}

	err = json.Unmarshal(data, &varDeviceAuthManagementSearchDevicesRequest)

	if err != nil {
		return err
	}

	*o = DeviceAuthManagementSearchDevicesRequest(varDeviceAuthManagementSearchDevicesRequest)

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

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

	return err
}

type NullableDeviceAuthManagementSearchDevicesRequest struct {
	value *DeviceAuthManagementSearchDevicesRequest
	isSet bool
}

func (v NullableDeviceAuthManagementSearchDevicesRequest) Get() *DeviceAuthManagementSearchDevicesRequest {
	return v.value
}

func (v *NullableDeviceAuthManagementSearchDevicesRequest) Set(val *DeviceAuthManagementSearchDevicesRequest) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableDeviceAuthManagementSearchDevicesRequest(val *DeviceAuthManagementSearchDevicesRequest) *NullableDeviceAuthManagementSearchDevicesRequest {
	return &NullableDeviceAuthManagementSearchDevicesRequest{value: val, isSet: true}
}

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

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


