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

// ListRecordingsResponse struct for ListRecordingsResponse
type ListRecordingsResponse struct {
	Recordings []Recording `json:"recordings"`
}

type _ListRecordingsResponse ListRecordingsResponse

// NewListRecordingsResponse instantiates a new ListRecordingsResponse 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 NewListRecordingsResponse(recordings []Recording) *ListRecordingsResponse {
	this := ListRecordingsResponse{}
	this.Recordings = recordings
	return &this
}

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

// GetRecordings returns the Recordings field value
func (o *ListRecordingsResponse) GetRecordings() []Recording {
	if o == nil {
		var ret []Recording
		return ret
	}

	return o.Recordings
}

// GetRecordingsOk returns a tuple with the Recordings field value
// and a boolean to check if the value has been set.
func (o *ListRecordingsResponse) GetRecordingsOk() ([]Recording, bool) {
	if o == nil {
		return nil, false
	}
	return o.Recordings, true
}

// SetRecordings sets field value
func (o *ListRecordingsResponse) SetRecordings(v []Recording) {
	o.Recordings = v
}

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

func (o ListRecordingsResponse) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	toSerialize["recordings"] = o.Recordings
	return toSerialize, nil
}

func (o *ListRecordingsResponse) 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{
		"recordings",
	}

	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)
		}
	}

	varListRecordingsResponse := _ListRecordingsResponse{}

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

	if err != nil {
		return err
	}

	*o = ListRecordingsResponse(varListRecordingsResponse)

	return err
}

type NullableListRecordingsResponse struct {
	value *ListRecordingsResponse
	isSet bool
}

func (v NullableListRecordingsResponse) Get() *ListRecordingsResponse {
	return v.value
}

func (v *NullableListRecordingsResponse) Set(val *ListRecordingsResponse) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableListRecordingsResponse(val *ListRecordingsResponse) *NullableListRecordingsResponse {
	return &NullableListRecordingsResponse{value: val, isSet: true}
}

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

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


