/*
1Backend

AI-native microservices platform.

API version: 0.8.2
Contact: sales@singulatron.com
*/

// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.

package openapi

import (
	"encoding/json"
	"bytes"
	"fmt"
)

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

// ProxySvcRouteInput struct for ProxySvcRouteInput
type ProxySvcRouteInput struct {
	// Id is the host itself, e.g. \"test.localhost\"
	Id string `json:"id"`
	Target *string `json:"target,omitempty"`
}

type _ProxySvcRouteInput ProxySvcRouteInput

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

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

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

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

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

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

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

	return false
}

// SetTarget gets a reference to the given string and assigns it to the Target field.
func (o *ProxySvcRouteInput) SetTarget(v string) {
	o.Target = &v
}

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

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

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

	varProxySvcRouteInput := _ProxySvcRouteInput{}

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

	if err != nil {
		return err
	}

	*o = ProxySvcRouteInput(varProxySvcRouteInput)

	return err
}

type NullableProxySvcRouteInput struct {
	value *ProxySvcRouteInput
	isSet bool
}

func (v NullableProxySvcRouteInput) Get() *ProxySvcRouteInput {
	return v.value
}

func (v *NullableProxySvcRouteInput) Set(val *ProxySvcRouteInput) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableProxySvcRouteInput(val *ProxySvcRouteInput) *NullableProxySvcRouteInput {
	return &NullableProxySvcRouteInput{value: val, isSet: true}
}

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

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


