/*
 * Subset of Influx API covered by Influx CLI
 *
 * 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 api

import (
	"encoding/json"
)

// Tasks struct for Tasks
type Tasks struct {
	Links *Links  `json:"links,omitempty" yaml:"links,omitempty"`
	Tasks *[]Task `json:"tasks,omitempty" yaml:"tasks,omitempty"`
}

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

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

// GetLinks returns the Links field value if set, zero value otherwise.
func (o *Tasks) GetLinks() Links {
	if o == nil || o.Links == nil {
		var ret Links
		return ret
	}
	return *o.Links
}

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

// HasLinks returns a boolean if a field has been set.
func (o *Tasks) HasLinks() bool {
	if o != nil && o.Links != nil {
		return true
	}

	return false
}

// SetLinks gets a reference to the given Links and assigns it to the Links field.
func (o *Tasks) SetLinks(v Links) {
	o.Links = &v
}

// GetTasks returns the Tasks field value if set, zero value otherwise.
func (o *Tasks) GetTasks() []Task {
	if o == nil || o.Tasks == nil {
		var ret []Task
		return ret
	}
	return *o.Tasks
}

// GetTasksOk returns a tuple with the Tasks field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Tasks) GetTasksOk() (*[]Task, bool) {
	if o == nil || o.Tasks == nil {
		return nil, false
	}
	return o.Tasks, true
}

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

	return false
}

// SetTasks gets a reference to the given []Task and assigns it to the Tasks field.
func (o *Tasks) SetTasks(v []Task) {
	o.Tasks = &v
}

func (o Tasks) MarshalJSON() ([]byte, error) {
	toSerialize := map[string]interface{}{}
	if o.Links != nil {
		toSerialize["links"] = o.Links
	}
	if o.Tasks != nil {
		toSerialize["tasks"] = o.Tasks
	}
	return json.Marshal(toSerialize)
}

type NullableTasks struct {
	value *Tasks
	isSet bool
}

func (v NullableTasks) Get() *Tasks {
	return v.value
}

func (v *NullableTasks) Set(val *Tasks) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableTasks(val *Tasks) *NullableTasks {
	return &NullableTasks{value: val, isSet: true}
}

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

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