/*
Daytona

Daytona AI platform API Docs

API version: 1.0
Contact: support@daytona.com
*/

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

package apiclient

import (
	"encoding/json"
)

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

// SessionExecuteResponse struct for SessionExecuteResponse
type SessionExecuteResponse struct {
	// The ID of the executed command
	CmdId *string `json:"cmdId,omitempty"`
	// The output of the executed command marked with stdout and stderr prefixes
	Output *string `json:"output,omitempty"`
	// The exit code of the executed command
	ExitCode *float32 `json:"exitCode,omitempty"`
	AdditionalProperties map[string]interface{}
}

type _SessionExecuteResponse SessionExecuteResponse

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

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

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

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

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

	return false
}

// SetCmdId gets a reference to the given string and assigns it to the CmdId field.
func (o *SessionExecuteResponse) SetCmdId(v string) {
	o.CmdId = &v
}

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

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

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

	return false
}

// SetOutput gets a reference to the given string and assigns it to the Output field.
func (o *SessionExecuteResponse) SetOutput(v string) {
	o.Output = &v
}

// GetExitCode returns the ExitCode field value if set, zero value otherwise.
func (o *SessionExecuteResponse) GetExitCode() float32 {
	if o == nil || IsNil(o.ExitCode) {
		var ret float32
		return ret
	}
	return *o.ExitCode
}

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

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

	return false
}

// SetExitCode gets a reference to the given float32 and assigns it to the ExitCode field.
func (o *SessionExecuteResponse) SetExitCode(v float32) {
	o.ExitCode = &v
}

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

func (o SessionExecuteResponse) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !IsNil(o.CmdId) {
		toSerialize["cmdId"] = o.CmdId
	}
	if !IsNil(o.Output) {
		toSerialize["output"] = o.Output
	}
	if !IsNil(o.ExitCode) {
		toSerialize["exitCode"] = o.ExitCode
	}

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

	return toSerialize, nil
}

func (o *SessionExecuteResponse) UnmarshalJSON(data []byte) (err error) {
	varSessionExecuteResponse := _SessionExecuteResponse{}

	err = json.Unmarshal(data, &varSessionExecuteResponse)

	if err != nil {
		return err
	}

	*o = SessionExecuteResponse(varSessionExecuteResponse)

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

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

	return err
}

type NullableSessionExecuteResponse struct {
	value *SessionExecuteResponse
	isSet bool
}

func (v NullableSessionExecuteResponse) Get() *SessionExecuteResponse {
	return v.value
}

func (v *NullableSessionExecuteResponse) Set(val *SessionExecuteResponse) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableSessionExecuteResponse(val *SessionExecuteResponse) *NullableSessionExecuteResponse {
	return &NullableSessionExecuteResponse{value: val, isSet: true}
}

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

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


