/*
Services API

No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)

API version: 1.0.0
*/

// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.

package services

import (
	"encoding/json"
)

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

// UpdateServiceRequest struct for UpdateServiceRequest
type UpdateServiceRequest struct {
	Active *bool `json:"active,omitempty"`
	Name *string `json:"name,omitempty"`
	Variables []Variable `json:"variables,omitempty"`
}

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

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

// GetActive returns the Active field value if set, zero value otherwise.
func (o *UpdateServiceRequest) GetActive() bool {
	if o == nil || IsNil(o.Active) {
		var ret bool
		return ret
	}
	return *o.Active
}

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

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

	return false
}

// SetActive gets a reference to the given bool and assigns it to the Active field.
func (o *UpdateServiceRequest) SetActive(v bool) {
	o.Active = &v
}

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

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

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

	return false
}

// SetName gets a reference to the given string and assigns it to the Name field.
func (o *UpdateServiceRequest) SetName(v string) {
	o.Name = &v
}

// GetVariables returns the Variables field value if set, zero value otherwise.
func (o *UpdateServiceRequest) GetVariables() []Variable {
	if o == nil || IsNil(o.Variables) {
		var ret []Variable
		return ret
	}
	return o.Variables
}

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

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

	return false
}

// SetVariables gets a reference to the given []Variable and assigns it to the Variables field.
func (o *UpdateServiceRequest) SetVariables(v []Variable) {
	o.Variables = v
}

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

func (o UpdateServiceRequest) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !IsNil(o.Active) {
		toSerialize["active"] = o.Active
	}
	if !IsNil(o.Name) {
		toSerialize["name"] = o.Name
	}
	if !IsNil(o.Variables) {
		toSerialize["variables"] = o.Variables
	}
	return toSerialize, nil
}

type NullableUpdateServiceRequest struct {
	value *UpdateServiceRequest
	isSet bool
}

func (v NullableUpdateServiceRequest) Get() *UpdateServiceRequest {
	return v.value
}

func (v *NullableUpdateServiceRequest) Set(val *UpdateServiceRequest) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableUpdateServiceRequest(val *UpdateServiceRequest) *NullableUpdateServiceRequest {
	return &NullableUpdateServiceRequest{value: val, isSet: true}
}

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

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


