/*
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"
)

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

// MousePositionResponse struct for MousePositionResponse
type MousePositionResponse struct {
	X *int32 `json:"x,omitempty"`
	Y *int32 `json:"y,omitempty"`
}

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

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

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

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

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

	return false
}

// SetX gets a reference to the given int32 and assigns it to the X field.
func (o *MousePositionResponse) SetX(v int32) {
	o.X = &v
}

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

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

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

	return false
}

// SetY gets a reference to the given int32 and assigns it to the Y field.
func (o *MousePositionResponse) SetY(v int32) {
	o.Y = &v
}

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

func (o MousePositionResponse) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !IsNil(o.X) {
		toSerialize["x"] = o.X
	}
	if !IsNil(o.Y) {
		toSerialize["y"] = o.Y
	}
	return toSerialize, nil
}

type NullableMousePositionResponse struct {
	value *MousePositionResponse
	isSet bool
}

func (v NullableMousePositionResponse) Get() *MousePositionResponse {
	return v.value
}

func (v *NullableMousePositionResponse) Set(val *MousePositionResponse) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableMousePositionResponse(val *MousePositionResponse) *NullableMousePositionResponse {
	return &NullableMousePositionResponse{value: val, isSet: true}
}

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

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


