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

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

// ProcessRestartResponse struct for ProcessRestartResponse
type ProcessRestartResponse struct {
	// A message indicating the result of restarting the process
	Message string `json:"message"`
	// The name of the VNC process that was restarted
	ProcessName string `json:"processName"`
	AdditionalProperties map[string]interface{}
}

type _ProcessRestartResponse ProcessRestartResponse

// NewProcessRestartResponse instantiates a new ProcessRestartResponse 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 NewProcessRestartResponse(message string, processName string) *ProcessRestartResponse {
	this := ProcessRestartResponse{}
	this.Message = message
	this.ProcessName = processName
	return &this
}

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

// GetMessage returns the Message field value
func (o *ProcessRestartResponse) GetMessage() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.Message
}

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

// SetMessage sets field value
func (o *ProcessRestartResponse) SetMessage(v string) {
	o.Message = v
}

// GetProcessName returns the ProcessName field value
func (o *ProcessRestartResponse) GetProcessName() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.ProcessName
}

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

// SetProcessName sets field value
func (o *ProcessRestartResponse) SetProcessName(v string) {
	o.ProcessName = v
}

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

func (o ProcessRestartResponse) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	toSerialize["message"] = o.Message
	toSerialize["processName"] = o.ProcessName

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

	return toSerialize, nil
}

func (o *ProcessRestartResponse) 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{
		"message",
		"processName",
	}

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

	varProcessRestartResponse := _ProcessRestartResponse{}

	err = json.Unmarshal(data, &varProcessRestartResponse)

	if err != nil {
		return err
	}

	*o = ProcessRestartResponse(varProcessRestartResponse)

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

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

	return err
}

type NullableProcessRestartResponse struct {
	value *ProcessRestartResponse
	isSet bool
}

func (v NullableProcessRestartResponse) Get() *ProcessRestartResponse {
	return v.value
}

func (v *NullableProcessRestartResponse) Set(val *ProcessRestartResponse) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableProcessRestartResponse(val *ProcessRestartResponse) *NullableProcessRestartResponse {
	return &NullableProcessRestartResponse{value: val, isSet: true}
}

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

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


