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

// CLIParams CLI parameters
type CLIParams struct {
	Command []string `json:"command,omitempty"`
	ExecutionTimeOut *int32 `json:"executionTimeOut,omitempty"`
	AdditionalProperties map[string]interface{}
}

type _CLIParams CLIParams

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

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

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

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

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

	return false
}

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

// GetExecutionTimeOut returns the ExecutionTimeOut field value if set, zero value otherwise.
func (o *CLIParams) GetExecutionTimeOut() int32 {
	if o == nil || IsNil(o.ExecutionTimeOut) {
		var ret int32
		return ret
	}
	return *o.ExecutionTimeOut
}

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

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

	return false
}

// SetExecutionTimeOut gets a reference to the given int32 and assigns it to the ExecutionTimeOut field.
func (o *CLIParams) SetExecutionTimeOut(v int32) {
	o.ExecutionTimeOut = &v
}

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

func (o CLIParams) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !IsNil(o.Command) {
		toSerialize["command"] = o.Command
	}
	if !IsNil(o.ExecutionTimeOut) {
		toSerialize["executionTimeOut"] = o.ExecutionTimeOut
	}

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

	return toSerialize, nil
}

func (o *CLIParams) UnmarshalJSON(data []byte) (err error) {
	varCLIParams := _CLIParams{}

	err = json.Unmarshal(data, &varCLIParams)

	if err != nil {
		return err
	}

	*o = CLIParams(varCLIParams)

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

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

	return err
}

type NullableCLIParams struct {
	value *CLIParams
	isSet bool
}

func (v NullableCLIParams) Get() *CLIParams {
	return v.value
}

func (v *NullableCLIParams) Set(val *CLIParams) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableCLIParams(val *CLIParams) *NullableCLIParams {
	return &NullableCLIParams{value: val, isSet: true}
}

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

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


