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

// AccessibilitySetValueRequest struct for AccessibilitySetValueRequest
type AccessibilitySetValueRequest struct {
	Id string `json:"id"`
	Value *string `json:"value,omitempty"`
}

type _AccessibilitySetValueRequest AccessibilitySetValueRequest

// NewAccessibilitySetValueRequest instantiates a new AccessibilitySetValueRequest 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 NewAccessibilitySetValueRequest(id string) *AccessibilitySetValueRequest {
	this := AccessibilitySetValueRequest{}
	this.Id = id
	return &this
}

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

// GetId returns the Id field value
func (o *AccessibilitySetValueRequest) 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 *AccessibilitySetValueRequest) GetIdOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return &o.Id, true
}

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

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

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

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

	return false
}

// SetValue gets a reference to the given string and assigns it to the Value field.
func (o *AccessibilitySetValueRequest) SetValue(v string) {
	o.Value = &v
}

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

func (o AccessibilitySetValueRequest) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	toSerialize["id"] = o.Id
	if !IsNil(o.Value) {
		toSerialize["value"] = o.Value
	}
	return toSerialize, nil
}

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

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

	varAccessibilitySetValueRequest := _AccessibilitySetValueRequest{}

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

	if err != nil {
		return err
	}

	*o = AccessibilitySetValueRequest(varAccessibilitySetValueRequest)

	return err
}

type NullableAccessibilitySetValueRequest struct {
	value *AccessibilitySetValueRequest
	isSet bool
}

func (v NullableAccessibilitySetValueRequest) Get() *AccessibilitySetValueRequest {
	return v.value
}

func (v *NullableAccessibilitySetValueRequest) Set(val *AccessibilitySetValueRequest) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableAccessibilitySetValueRequest(val *AccessibilitySetValueRequest) *NullableAccessibilitySetValueRequest {
	return &NullableAccessibilitySetValueRequest{value: val, isSet: true}
}

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

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


