/*
Daytona Toolbox API

Daytona Toolbox API

API version: v0.0.0-dev
*/

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

package toolbox

import (
	"encoding/json"
	"bytes"
	"fmt"
)

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

// Recording struct for Recording
type Recording struct {
	DurationSeconds *float32 `json:"durationSeconds,omitempty"`
	EndTime *string `json:"endTime,omitempty"`
	FileName string `json:"fileName"`
	FilePath string `json:"filePath"`
	Id string `json:"id"`
	SizeBytes *int32 `json:"sizeBytes,omitempty"`
	StartTime string `json:"startTime"`
	Status string `json:"status"`
}

type _Recording Recording

// NewRecording instantiates a new Recording 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 NewRecording(fileName string, filePath string, id string, startTime string, status string) *Recording {
	this := Recording{}
	this.FileName = fileName
	this.FilePath = filePath
	this.Id = id
	this.StartTime = startTime
	this.Status = status
	return &this
}

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

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

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

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

	return false
}

// SetDurationSeconds gets a reference to the given float32 and assigns it to the DurationSeconds field.
func (o *Recording) SetDurationSeconds(v float32) {
	o.DurationSeconds = &v
}

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

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

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

	return false
}

// SetEndTime gets a reference to the given string and assigns it to the EndTime field.
func (o *Recording) SetEndTime(v string) {
	o.EndTime = &v
}

// GetFileName returns the FileName field value
func (o *Recording) GetFileName() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.FileName
}

// GetFileNameOk returns a tuple with the FileName field value
// and a boolean to check if the value has been set.
func (o *Recording) GetFileNameOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return &o.FileName, true
}

// SetFileName sets field value
func (o *Recording) SetFileName(v string) {
	o.FileName = v
}

// GetFilePath returns the FilePath field value
func (o *Recording) GetFilePath() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.FilePath
}

// GetFilePathOk returns a tuple with the FilePath field value
// and a boolean to check if the value has been set.
func (o *Recording) GetFilePathOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return &o.FilePath, true
}

// SetFilePath sets field value
func (o *Recording) SetFilePath(v string) {
	o.FilePath = v
}

// GetId returns the Id field value
func (o *Recording) GetId() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.Id
}

// GetIdOk returns a tuple with the Id field value
// and a boolean to check if the value has been set.
func (o *Recording) GetIdOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return &o.Id, true
}

// SetId sets field value
func (o *Recording) SetId(v string) {
	o.Id = v
}

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

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

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

	return false
}

// SetSizeBytes gets a reference to the given int32 and assigns it to the SizeBytes field.
func (o *Recording) SetSizeBytes(v int32) {
	o.SizeBytes = &v
}

// GetStartTime returns the StartTime field value
func (o *Recording) GetStartTime() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.StartTime
}

// GetStartTimeOk returns a tuple with the StartTime field value
// and a boolean to check if the value has been set.
func (o *Recording) GetStartTimeOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return &o.StartTime, true
}

// SetStartTime sets field value
func (o *Recording) SetStartTime(v string) {
	o.StartTime = v
}

// GetStatus returns the Status field value
func (o *Recording) GetStatus() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.Status
}

// GetStatusOk returns a tuple with the Status field value
// and a boolean to check if the value has been set.
func (o *Recording) GetStatusOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return &o.Status, true
}

// SetStatus sets field value
func (o *Recording) SetStatus(v string) {
	o.Status = v
}

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

func (o Recording) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !IsNil(o.DurationSeconds) {
		toSerialize["durationSeconds"] = o.DurationSeconds
	}
	if !IsNil(o.EndTime) {
		toSerialize["endTime"] = o.EndTime
	}
	toSerialize["fileName"] = o.FileName
	toSerialize["filePath"] = o.FilePath
	toSerialize["id"] = o.Id
	if !IsNil(o.SizeBytes) {
		toSerialize["sizeBytes"] = o.SizeBytes
	}
	toSerialize["startTime"] = o.StartTime
	toSerialize["status"] = o.Status
	return toSerialize, nil
}

func (o *Recording) UnmarshalJSON(data []byte) (err error) {
	// This validates that all required properties are included in the JSON object
	// by unmarshalling the object into a generic map with string keys and checking
	// that every required field exists as a key in the generic map.
	requiredProperties := []string{
		"fileName",
		"filePath",
		"id",
		"startTime",
		"status",
	}

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

	err = json.Unmarshal(data, &allProperties)

	if err != nil {
		return err;
	}

	for _, requiredProperty := range(requiredProperties) {
		if _, exists := allProperties[requiredProperty]; !exists {
			return fmt.Errorf("no value given for required property %v", requiredProperty)
		}
	}

	varRecording := _Recording{}

	decoder := json.NewDecoder(bytes.NewReader(data))
	decoder.DisallowUnknownFields()
	err = decoder.Decode(&varRecording)

	if err != nil {
		return err
	}

	*o = Recording(varRecording)

	return err
}

type NullableRecording struct {
	value *Recording
	isSet bool
}

func (v NullableRecording) Get() *Recording {
	return v.value
}

func (v *NullableRecording) Set(val *Recording) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableRecording(val *Recording) *NullableRecording {
	return &NullableRecording{value: val, isSet: true}
}

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

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


