/*
Mender API

Combined API specification for the features of the different Mender backend services, suitable for code generation applications 

API version: 1
Contact: support@mender.io
*/

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

package client

import (
	"encoding/json"
)

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

// TaskResultHTTPResponse struct for TaskResultHTTPResponse
type TaskResultHTTPResponse struct {
	Uri *string `json:"uri,omitempty"`
	Method *string `json:"method,omitempty"`
	Headers []string `json:"headers,omitempty"`
	Body *string `json:"body,omitempty"`
	AdditionalProperties map[string]interface{}
}

type _TaskResultHTTPResponse TaskResultHTTPResponse

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

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

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

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

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

	return false
}

// SetUri gets a reference to the given string and assigns it to the Uri field.
func (o *TaskResultHTTPResponse) SetUri(v string) {
	o.Uri = &v
}

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

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

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

	return false
}

// SetMethod gets a reference to the given string and assigns it to the Method field.
func (o *TaskResultHTTPResponse) SetMethod(v string) {
	o.Method = &v
}

// GetHeaders returns the Headers field value if set, zero value otherwise.
func (o *TaskResultHTTPResponse) GetHeaders() []string {
	if o == nil || IsNil(o.Headers) {
		var ret []string
		return ret
	}
	return o.Headers
}

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

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

	return false
}

// SetHeaders gets a reference to the given []string and assigns it to the Headers field.
func (o *TaskResultHTTPResponse) SetHeaders(v []string) {
	o.Headers = v
}

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

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

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

	return false
}

// SetBody gets a reference to the given string and assigns it to the Body field.
func (o *TaskResultHTTPResponse) SetBody(v string) {
	o.Body = &v
}

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

func (o TaskResultHTTPResponse) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !IsNil(o.Uri) {
		toSerialize["uri"] = o.Uri
	}
	if !IsNil(o.Method) {
		toSerialize["method"] = o.Method
	}
	if !IsNil(o.Headers) {
		toSerialize["headers"] = o.Headers
	}
	if !IsNil(o.Body) {
		toSerialize["body"] = o.Body
	}

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

	return toSerialize, nil
}

func (o *TaskResultHTTPResponse) UnmarshalJSON(data []byte) (err error) {
	varTaskResultHTTPResponse := _TaskResultHTTPResponse{}

	err = json.Unmarshal(data, &varTaskResultHTTPResponse)

	if err != nil {
		return err
	}

	*o = TaskResultHTTPResponse(varTaskResultHTTPResponse)

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

	if err = json.Unmarshal(data, &additionalProperties); err == nil {
		delete(additionalProperties, "uri")
		delete(additionalProperties, "method")
		delete(additionalProperties, "headers")
		delete(additionalProperties, "body")
		o.AdditionalProperties = additionalProperties
	}

	return err
}

type NullableTaskResultHTTPResponse struct {
	value *TaskResultHTTPResponse
	isSet bool
}

func (v NullableTaskResultHTTPResponse) Get() *TaskResultHTTPResponse {
	return v.value
}

func (v *NullableTaskResultHTTPResponse) Set(val *TaskResultHTTPResponse) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableTaskResultHTTPResponse(val *TaskResultHTTPResponse) *NullableTaskResultHTTPResponse {
	return &NullableTaskResultHTTPResponse{value: val, isSet: true}
}

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

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


