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

// CreateRegionResponse struct for CreateRegionResponse
type CreateRegionResponse struct {
	// ID of the created region
	Id string `json:"id"`
	// Proxy API key for the region
	ProxyApiKey NullableString `json:"proxyApiKey,omitempty"`
	// SSH Gateway API key for the region
	SshGatewayApiKey NullableString `json:"sshGatewayApiKey,omitempty"`
	// Snapshot Manager username for the region
	SnapshotManagerUsername NullableString `json:"snapshotManagerUsername,omitempty"`
	// Snapshot Manager password for the region
	SnapshotManagerPassword NullableString `json:"snapshotManagerPassword,omitempty"`
	AdditionalProperties map[string]interface{}
}

type _CreateRegionResponse CreateRegionResponse

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

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

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

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

// GetProxyApiKey returns the ProxyApiKey field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *CreateRegionResponse) GetProxyApiKey() string {
	if o == nil || IsNil(o.ProxyApiKey.Get()) {
		var ret string
		return ret
	}
	return *o.ProxyApiKey.Get()
}

// GetProxyApiKeyOk returns a tuple with the ProxyApiKey field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *CreateRegionResponse) GetProxyApiKeyOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return o.ProxyApiKey.Get(), o.ProxyApiKey.IsSet()
}

// HasProxyApiKey returns a boolean if a field has been set.
func (o *CreateRegionResponse) HasProxyApiKey() bool {
	if o != nil && o.ProxyApiKey.IsSet() {
		return true
	}

	return false
}

// SetProxyApiKey gets a reference to the given NullableString and assigns it to the ProxyApiKey field.
func (o *CreateRegionResponse) SetProxyApiKey(v string) {
	o.ProxyApiKey.Set(&v)
}
// SetProxyApiKeyNil sets the value for ProxyApiKey to be an explicit nil
func (o *CreateRegionResponse) SetProxyApiKeyNil() {
	o.ProxyApiKey.Set(nil)
}

// UnsetProxyApiKey ensures that no value is present for ProxyApiKey, not even an explicit nil
func (o *CreateRegionResponse) UnsetProxyApiKey() {
	o.ProxyApiKey.Unset()
}

// GetSshGatewayApiKey returns the SshGatewayApiKey field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *CreateRegionResponse) GetSshGatewayApiKey() string {
	if o == nil || IsNil(o.SshGatewayApiKey.Get()) {
		var ret string
		return ret
	}
	return *o.SshGatewayApiKey.Get()
}

// GetSshGatewayApiKeyOk returns a tuple with the SshGatewayApiKey field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *CreateRegionResponse) GetSshGatewayApiKeyOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return o.SshGatewayApiKey.Get(), o.SshGatewayApiKey.IsSet()
}

// HasSshGatewayApiKey returns a boolean if a field has been set.
func (o *CreateRegionResponse) HasSshGatewayApiKey() bool {
	if o != nil && o.SshGatewayApiKey.IsSet() {
		return true
	}

	return false
}

// SetSshGatewayApiKey gets a reference to the given NullableString and assigns it to the SshGatewayApiKey field.
func (o *CreateRegionResponse) SetSshGatewayApiKey(v string) {
	o.SshGatewayApiKey.Set(&v)
}
// SetSshGatewayApiKeyNil sets the value for SshGatewayApiKey to be an explicit nil
func (o *CreateRegionResponse) SetSshGatewayApiKeyNil() {
	o.SshGatewayApiKey.Set(nil)
}

// UnsetSshGatewayApiKey ensures that no value is present for SshGatewayApiKey, not even an explicit nil
func (o *CreateRegionResponse) UnsetSshGatewayApiKey() {
	o.SshGatewayApiKey.Unset()
}

// GetSnapshotManagerUsername returns the SnapshotManagerUsername field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *CreateRegionResponse) GetSnapshotManagerUsername() string {
	if o == nil || IsNil(o.SnapshotManagerUsername.Get()) {
		var ret string
		return ret
	}
	return *o.SnapshotManagerUsername.Get()
}

// GetSnapshotManagerUsernameOk returns a tuple with the SnapshotManagerUsername field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *CreateRegionResponse) GetSnapshotManagerUsernameOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return o.SnapshotManagerUsername.Get(), o.SnapshotManagerUsername.IsSet()
}

// HasSnapshotManagerUsername returns a boolean if a field has been set.
func (o *CreateRegionResponse) HasSnapshotManagerUsername() bool {
	if o != nil && o.SnapshotManagerUsername.IsSet() {
		return true
	}

	return false
}

// SetSnapshotManagerUsername gets a reference to the given NullableString and assigns it to the SnapshotManagerUsername field.
func (o *CreateRegionResponse) SetSnapshotManagerUsername(v string) {
	o.SnapshotManagerUsername.Set(&v)
}
// SetSnapshotManagerUsernameNil sets the value for SnapshotManagerUsername to be an explicit nil
func (o *CreateRegionResponse) SetSnapshotManagerUsernameNil() {
	o.SnapshotManagerUsername.Set(nil)
}

// UnsetSnapshotManagerUsername ensures that no value is present for SnapshotManagerUsername, not even an explicit nil
func (o *CreateRegionResponse) UnsetSnapshotManagerUsername() {
	o.SnapshotManagerUsername.Unset()
}

// GetSnapshotManagerPassword returns the SnapshotManagerPassword field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *CreateRegionResponse) GetSnapshotManagerPassword() string {
	if o == nil || IsNil(o.SnapshotManagerPassword.Get()) {
		var ret string
		return ret
	}
	return *o.SnapshotManagerPassword.Get()
}

// GetSnapshotManagerPasswordOk returns a tuple with the SnapshotManagerPassword field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *CreateRegionResponse) GetSnapshotManagerPasswordOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return o.SnapshotManagerPassword.Get(), o.SnapshotManagerPassword.IsSet()
}

// HasSnapshotManagerPassword returns a boolean if a field has been set.
func (o *CreateRegionResponse) HasSnapshotManagerPassword() bool {
	if o != nil && o.SnapshotManagerPassword.IsSet() {
		return true
	}

	return false
}

// SetSnapshotManagerPassword gets a reference to the given NullableString and assigns it to the SnapshotManagerPassword field.
func (o *CreateRegionResponse) SetSnapshotManagerPassword(v string) {
	o.SnapshotManagerPassword.Set(&v)
}
// SetSnapshotManagerPasswordNil sets the value for SnapshotManagerPassword to be an explicit nil
func (o *CreateRegionResponse) SetSnapshotManagerPasswordNil() {
	o.SnapshotManagerPassword.Set(nil)
}

// UnsetSnapshotManagerPassword ensures that no value is present for SnapshotManagerPassword, not even an explicit nil
func (o *CreateRegionResponse) UnsetSnapshotManagerPassword() {
	o.SnapshotManagerPassword.Unset()
}

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

func (o CreateRegionResponse) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	toSerialize["id"] = o.Id
	if o.ProxyApiKey.IsSet() {
		toSerialize["proxyApiKey"] = o.ProxyApiKey.Get()
	}
	if o.SshGatewayApiKey.IsSet() {
		toSerialize["sshGatewayApiKey"] = o.SshGatewayApiKey.Get()
	}
	if o.SnapshotManagerUsername.IsSet() {
		toSerialize["snapshotManagerUsername"] = o.SnapshotManagerUsername.Get()
	}
	if o.SnapshotManagerPassword.IsSet() {
		toSerialize["snapshotManagerPassword"] = o.SnapshotManagerPassword.Get()
	}

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

	return toSerialize, nil
}

func (o *CreateRegionResponse) 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)
		}
	}

	varCreateRegionResponse := _CreateRegionResponse{}

	err = json.Unmarshal(data, &varCreateRegionResponse)

	if err != nil {
		return err
	}

	*o = CreateRegionResponse(varCreateRegionResponse)

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

	if err = json.Unmarshal(data, &additionalProperties); err == nil {
		delete(additionalProperties, "id")
		delete(additionalProperties, "proxyApiKey")
		delete(additionalProperties, "sshGatewayApiKey")
		delete(additionalProperties, "snapshotManagerUsername")
		delete(additionalProperties, "snapshotManagerPassword")
		o.AdditionalProperties = additionalProperties
	}

	return err
}

type NullableCreateRegionResponse struct {
	value *CreateRegionResponse
	isSet bool
}

func (v NullableCreateRegionResponse) Get() *CreateRegionResponse {
	return v.value
}

func (v *NullableCreateRegionResponse) Set(val *CreateRegionResponse) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableCreateRegionResponse(val *CreateRegionResponse) *NullableCreateRegionResponse {
	return &NullableCreateRegionResponse{value: val, isSet: true}
}

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

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


