/*
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 TaskResultHTTPRequest type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &TaskResultHTTPRequest{}

// TaskResultHTTPRequest struct for TaskResultHTTPRequest
type TaskResultHTTPRequest struct {
	StatusCode *int32 `json:"statusCode,omitempty"`
	Body *string `json:"body,omitempty"`
	AdditionalProperties map[string]interface{}
}

type _TaskResultHTTPRequest TaskResultHTTPRequest

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

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

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

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

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

	return false
}

// SetStatusCode gets a reference to the given int32 and assigns it to the StatusCode field.
func (o *TaskResultHTTPRequest) SetStatusCode(v int32) {
	o.StatusCode = &v
}

// GetBody returns the Body field value if set, zero value otherwise.
func (o *TaskResultHTTPRequest) 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 *TaskResultHTTPRequest) 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 *TaskResultHTTPRequest) 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 *TaskResultHTTPRequest) SetBody(v string) {
	o.Body = &v
}

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

func (o TaskResultHTTPRequest) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !IsNil(o.StatusCode) {
		toSerialize["statusCode"] = o.StatusCode
	}
	if !IsNil(o.Body) {
		toSerialize["body"] = o.Body
	}

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

	return toSerialize, nil
}

func (o *TaskResultHTTPRequest) UnmarshalJSON(data []byte) (err error) {
	varTaskResultHTTPRequest := _TaskResultHTTPRequest{}

	err = json.Unmarshal(data, &varTaskResultHTTPRequest)

	if err != nil {
		return err
	}

	*o = TaskResultHTTPRequest(varTaskResultHTTPRequest)

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

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

	return err
}

type NullableTaskResultHTTPRequest struct {
	value *TaskResultHTTPRequest
	isSet bool
}

func (v NullableTaskResultHTTPRequest) Get() *TaskResultHTTPRequest {
	return v.value
}

func (v *NullableTaskResultHTTPRequest) Set(val *TaskResultHTTPRequest) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableTaskResultHTTPRequest(val *TaskResultHTTPRequest) *NullableTaskResultHTTPRequest {
	return &NullableTaskResultHTTPRequest{value: val, isSet: true}
}

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

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


