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

// DeploymentIdentifier Deployment identifier
type DeploymentIdentifier struct {
	DeploymentIds []string `json:"deployment_ids,omitempty"`
	AdditionalProperties map[string]interface{}
}

type _DeploymentIdentifier DeploymentIdentifier

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

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

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

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

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

	return false
}

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

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

func (o DeploymentIdentifier) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !IsNil(o.DeploymentIds) {
		toSerialize["deployment_ids"] = o.DeploymentIds
	}

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

	return toSerialize, nil
}

func (o *DeploymentIdentifier) UnmarshalJSON(data []byte) (err error) {
	varDeploymentIdentifier := _DeploymentIdentifier{}

	err = json.Unmarshal(data, &varDeploymentIdentifier)

	if err != nil {
		return err
	}

	*o = DeploymentIdentifier(varDeploymentIdentifier)

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

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

	return err
}

type NullableDeploymentIdentifier struct {
	value *DeploymentIdentifier
	isSet bool
}

func (v NullableDeploymentIdentifier) Get() *DeploymentIdentifier {
	return v.value
}

func (v *NullableDeploymentIdentifier) Set(val *DeploymentIdentifier) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableDeploymentIdentifier(val *DeploymentIdentifier) *NullableDeploymentIdentifier {
	return &NullableDeploymentIdentifier{value: val, isSet: true}
}

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

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


