/*
Lethean Blockchain API

OpenAPI for Lethean Blockchain

API version: 6.0.1
*/

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

package lthn

import (
	"encoding/json"
)

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

// TransactionAttachmentModel struct for TransactionAttachmentModel
type TransactionAttachmentModel struct {
	Type *string `json:"type,omitempty"`
	ShortView *string `json:"short_view,omitempty"`
	DetailsView *string `json:"details_view,omitempty"`
	AdditionalProperties map[string]interface{}
}

type _TransactionAttachmentModel TransactionAttachmentModel

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

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

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

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

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

	return false
}

// SetType gets a reference to the given string and assigns it to the Type field.
func (o *TransactionAttachmentModel) SetType(v string) {
	o.Type = &v
}

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

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

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

	return false
}

// SetShortView gets a reference to the given string and assigns it to the ShortView field.
func (o *TransactionAttachmentModel) SetShortView(v string) {
	o.ShortView = &v
}

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

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

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

	return false
}

// SetDetailsView gets a reference to the given string and assigns it to the DetailsView field.
func (o *TransactionAttachmentModel) SetDetailsView(v string) {
	o.DetailsView = &v
}

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

func (o TransactionAttachmentModel) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !IsNil(o.Type) {
		toSerialize["type"] = o.Type
	}
	if !IsNil(o.ShortView) {
		toSerialize["short_view"] = o.ShortView
	}
	if !IsNil(o.DetailsView) {
		toSerialize["details_view"] = o.DetailsView
	}

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

	return toSerialize, nil
}

func (o *TransactionAttachmentModel) UnmarshalJSON(data []byte) (err error) {
	varTransactionAttachmentModel := _TransactionAttachmentModel{}

	err = json.Unmarshal(data, &varTransactionAttachmentModel)

	if err != nil {
		return err
	}

	*o = TransactionAttachmentModel(varTransactionAttachmentModel)

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

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

	return err
}

type NullableTransactionAttachmentModel struct {
	value *TransactionAttachmentModel
	isSet bool
}

func (v NullableTransactionAttachmentModel) Get() *TransactionAttachmentModel {
	return v.value
}

func (v *NullableTransactionAttachmentModel) Set(val *TransactionAttachmentModel) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableTransactionAttachmentModel(val *TransactionAttachmentModel) *NullableTransactionAttachmentModel {
	return &NullableTransactionAttachmentModel{value: val, isSet: true}
}

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

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


