/*
Libre Graph API

Libre Graph is a free API for cloud collaboration inspired by the MS Graph API.

API version: v1.0.4
*/

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

package libregraph

import (
	"encoding/json"
)

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

// Thumbnail The thumbnail resource type represents a thumbnail for an image, video, document, or any item that has a bitmap representation.
type Thumbnail struct {
	// The content stream for the thumbnail.
	Content *string `json:"content,omitempty"`
	// The height of the thumbnail, in pixels.
	Height *int32 `json:"height,omitempty"`
	// The unique identifier of the item that provided the thumbnail. This is only available when a folder thumbnail is requested.
	SourceItemId *string `json:"sourceItemId,omitempty"`
	// The URL used to fetch the thumbnail content.
	Url *string `json:"url,omitempty"`
	// The width of the thumbnail, in pixels.
	Width *int32 `json:"width,omitempty"`
}

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

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

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

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

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

	return false
}

// SetContent gets a reference to the given string and assigns it to the Content field.
func (o *Thumbnail) SetContent(v string) {
	o.Content = &v
}

// GetHeight returns the Height field value if set, zero value otherwise.
func (o *Thumbnail) GetHeight() int32 {
	if o == nil || IsNil(o.Height) {
		var ret int32
		return ret
	}
	return *o.Height
}

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

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

	return false
}

// SetHeight gets a reference to the given int32 and assigns it to the Height field.
func (o *Thumbnail) SetHeight(v int32) {
	o.Height = &v
}

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

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

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

	return false
}

// SetSourceItemId gets a reference to the given string and assigns it to the SourceItemId field.
func (o *Thumbnail) SetSourceItemId(v string) {
	o.SourceItemId = &v
}

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

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

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

	return false
}

// SetUrl gets a reference to the given string and assigns it to the Url field.
func (o *Thumbnail) SetUrl(v string) {
	o.Url = &v
}

// GetWidth returns the Width field value if set, zero value otherwise.
func (o *Thumbnail) GetWidth() int32 {
	if o == nil || IsNil(o.Width) {
		var ret int32
		return ret
	}
	return *o.Width
}

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

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

	return false
}

// SetWidth gets a reference to the given int32 and assigns it to the Width field.
func (o *Thumbnail) SetWidth(v int32) {
	o.Width = &v
}

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

func (o Thumbnail) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !IsNil(o.Content) {
		toSerialize["content"] = o.Content
	}
	if !IsNil(o.Height) {
		toSerialize["height"] = o.Height
	}
	if !IsNil(o.SourceItemId) {
		toSerialize["sourceItemId"] = o.SourceItemId
	}
	if !IsNil(o.Url) {
		toSerialize["url"] = o.Url
	}
	if !IsNil(o.Width) {
		toSerialize["width"] = o.Width
	}
	return toSerialize, nil
}

type NullableThumbnail struct {
	value *Thumbnail
	isSet bool
}

func (v NullableThumbnail) Get() *Thumbnail {
	return v.value
}

func (v *NullableThumbnail) Set(val *Thumbnail) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableThumbnail(val *Thumbnail) *NullableThumbnail {
	return &NullableThumbnail{value: val, isSet: true}
}

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

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