/*
Edge Application API

No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)

API version: 2.0.0
*/

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

package edgeapplications

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

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

// CreateOriginsRequestAddresses struct for CreateOriginsRequestAddresses
type CreateOriginsRequestAddresses struct {
	Address string `json:"address"`
}

type _CreateOriginsRequestAddresses CreateOriginsRequestAddresses

// NewCreateOriginsRequestAddresses instantiates a new CreateOriginsRequestAddresses 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 NewCreateOriginsRequestAddresses(address string) *CreateOriginsRequestAddresses {
	this := CreateOriginsRequestAddresses{}
	this.Address = address
	return &this
}

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

// GetAddress returns the Address field value
func (o *CreateOriginsRequestAddresses) GetAddress() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.Address
}

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

// SetAddress sets field value
func (o *CreateOriginsRequestAddresses) SetAddress(v string) {
	o.Address = v
}

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

func (o CreateOriginsRequestAddresses) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	toSerialize["address"] = o.Address
	return toSerialize, nil
}

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

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

	varCreateOriginsRequestAddresses := _CreateOriginsRequestAddresses{}

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

	if err != nil {
		return err
	}

	*o = CreateOriginsRequestAddresses(varCreateOriginsRequestAddresses)

	return err
}

type NullableCreateOriginsRequestAddresses struct {
	value *CreateOriginsRequestAddresses
	isSet bool
}

func (v NullableCreateOriginsRequestAddresses) Get() *CreateOriginsRequestAddresses {
	return v.value
}

func (v *NullableCreateOriginsRequestAddresses) Set(val *CreateOriginsRequestAddresses) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableCreateOriginsRequestAddresses(val *CreateOriginsRequestAddresses) *NullableCreateOriginsRequestAddresses {
	return &NullableCreateOriginsRequestAddresses{value: val, isSet: true}
}

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

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


