/*
Daytona Toolbox API

Daytona Toolbox API

API version: v0.0.0-dev
*/

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

package toolbox

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

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

// Match struct for Match
type Match struct {
	Content string `json:"content"`
	File string `json:"file"`
	Line int32 `json:"line"`
}

type _Match Match

// NewMatch instantiates a new Match 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 NewMatch(content string, file string, line int32) *Match {
	this := Match{}
	this.Content = content
	this.File = file
	this.Line = line
	return &this
}

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

// GetContent returns the Content field value
func (o *Match) GetContent() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.Content
}

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

// SetContent sets field value
func (o *Match) SetContent(v string) {
	o.Content = v
}

// GetFile returns the File field value
func (o *Match) GetFile() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.File
}

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

// SetFile sets field value
func (o *Match) SetFile(v string) {
	o.File = v
}

// GetLine returns the Line field value
func (o *Match) GetLine() int32 {
	if o == nil {
		var ret int32
		return ret
	}

	return o.Line
}

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

// SetLine sets field value
func (o *Match) SetLine(v int32) {
	o.Line = v
}

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

func (o Match) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	toSerialize["content"] = o.Content
	toSerialize["file"] = o.File
	toSerialize["line"] = o.Line
	return toSerialize, nil
}

func (o *Match) 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{
		"content",
		"file",
		"line",
	}

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

	varMatch := _Match{}

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

	if err != nil {
		return err
	}

	*o = Match(varMatch)

	return err
}

type NullableMatch struct {
	value *Match
	isSet bool
}

func (v NullableMatch) Get() *Match {
	return v.value
}

func (v *NullableMatch) Set(val *Match) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableMatch(val *Match) *NullableMatch {
	return &NullableMatch{value: val, isSet: true}
}

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

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


