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

// ApplicationLinks struct for ApplicationLinks
type ApplicationLinks struct {
	Previous NullableString `json:"previous"`
	Next NullableString `json:"next"`
}

type _ApplicationLinks ApplicationLinks

// NewApplicationLinks instantiates a new ApplicationLinks 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 NewApplicationLinks(previous NullableString, next NullableString) *ApplicationLinks {
	this := ApplicationLinks{}
	this.Previous = previous
	this.Next = next
	return &this
}

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

// GetPrevious returns the Previous field value
// If the value is explicit nil, the zero value for string will be returned
func (o *ApplicationLinks) GetPrevious() string {
	if o == nil || o.Previous.Get() == nil {
		var ret string
		return ret
	}

	return *o.Previous.Get()
}

// GetPreviousOk returns a tuple with the Previous field value
// 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 *ApplicationLinks) GetPreviousOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return o.Previous.Get(), o.Previous.IsSet()
}

// SetPrevious sets field value
func (o *ApplicationLinks) SetPrevious(v string) {
	o.Previous.Set(&v)
}

// GetNext returns the Next field value
// If the value is explicit nil, the zero value for string will be returned
func (o *ApplicationLinks) GetNext() string {
	if o == nil || o.Next.Get() == nil {
		var ret string
		return ret
	}

	return *o.Next.Get()
}

// GetNextOk returns a tuple with the Next field value
// 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 *ApplicationLinks) GetNextOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return o.Next.Get(), o.Next.IsSet()
}

// SetNext sets field value
func (o *ApplicationLinks) SetNext(v string) {
	o.Next.Set(&v)
}

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

func (o ApplicationLinks) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	toSerialize["previous"] = o.Previous.Get()
	toSerialize["next"] = o.Next.Get()
	return toSerialize, nil
}

func (o *ApplicationLinks) 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{
		"previous",
		"next",
	}

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

	varApplicationLinks := _ApplicationLinks{}

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

	if err != nil {
		return err
	}

	*o = ApplicationLinks(varApplicationLinks)

	return err
}

type NullableApplicationLinks struct {
	value *ApplicationLinks
	isSet bool
}

func (v NullableApplicationLinks) Get() *ApplicationLinks {
	return v.value
}

func (v *NullableApplicationLinks) Set(val *ApplicationLinks) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableApplicationLinks(val *ApplicationLinks) *NullableApplicationLinks {
	return &NullableApplicationLinks{value: val, isSet: true}
}

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

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


