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

// ReleasesDeleteError Releases used by active deployment.
type ReleasesDeleteError struct {
	// Description of the error.
	Error *string `json:"error,omitempty"`
	// List of IDs of active deployments which are using releases from the request.
	ActiveDeployments []string `json:"active_deployments,omitempty"`
	// Request ID (same as in X-MEN-RequestID header).
	RequestId *string `json:"request_id,omitempty"`
	AdditionalProperties map[string]interface{}
}

type _ReleasesDeleteError ReleasesDeleteError

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

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

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

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

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

	return false
}

// SetError gets a reference to the given string and assigns it to the Error field.
func (o *ReleasesDeleteError) SetError(v string) {
	o.Error = &v
}

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

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

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

	return false
}

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

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

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

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

	return false
}

// SetRequestId gets a reference to the given string and assigns it to the RequestId field.
func (o *ReleasesDeleteError) SetRequestId(v string) {
	o.RequestId = &v
}

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

func (o ReleasesDeleteError) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !IsNil(o.Error) {
		toSerialize["error"] = o.Error
	}
	if !IsNil(o.ActiveDeployments) {
		toSerialize["active_deployments"] = o.ActiveDeployments
	}
	if !IsNil(o.RequestId) {
		toSerialize["request_id"] = o.RequestId
	}

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

	return toSerialize, nil
}

func (o *ReleasesDeleteError) UnmarshalJSON(data []byte) (err error) {
	varReleasesDeleteError := _ReleasesDeleteError{}

	err = json.Unmarshal(data, &varReleasesDeleteError)

	if err != nil {
		return err
	}

	*o = ReleasesDeleteError(varReleasesDeleteError)

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

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

	return err
}

type NullableReleasesDeleteError struct {
	value *ReleasesDeleteError
	isSet bool
}

func (v NullableReleasesDeleteError) Get() *ReleasesDeleteError {
	return v.value
}

func (v *NullableReleasesDeleteError) Set(val *ReleasesDeleteError) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableReleasesDeleteError(val *ReleasesDeleteError) *NullableReleasesDeleteError {
	return &NullableReleasesDeleteError{value: val, isSet: true}
}

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

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


