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

// HTTPParams HTTP parameters
type HTTPParams struct {
	Uri *string `json:"uri,omitempty"`
	Method *string `json:"method,omitempty"`
	ContentType *string `json:"contentType,omitempty"`
	Body *string `json:"body,omitempty"`
	Json map[string]interface{} `json:"json,omitempty"`
	Headers map[string]interface{} `json:"headers,omitempty"`
	StatusCodes []int32 `json:"statusCodes,omitempty"`
	ConnectionTimeOut *int32 `json:"connectionTimeOut,omitempty"`
	ReadTimeOut *int32 `json:"readTimeOut,omitempty"`
	AdditionalProperties map[string]interface{}
}

type _HTTPParams HTTPParams

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

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

// GetUri returns the Uri field value if set, zero value otherwise.
func (o *HTTPParams) 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 *HTTPParams) 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 *HTTPParams) 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 *HTTPParams) SetUri(v string) {
	o.Uri = &v
}

// GetMethod returns the Method field value if set, zero value otherwise.
func (o *HTTPParams) 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 *HTTPParams) 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 *HTTPParams) 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 *HTTPParams) SetMethod(v string) {
	o.Method = &v
}

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

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

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

	return false
}

// SetContentType gets a reference to the given string and assigns it to the ContentType field.
func (o *HTTPParams) SetContentType(v string) {
	o.ContentType = &v
}

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

// GetJson returns the Json field value if set, zero value otherwise.
func (o *HTTPParams) GetJson() map[string]interface{} {
	if o == nil || IsNil(o.Json) {
		var ret map[string]interface{}
		return ret
	}
	return o.Json
}

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

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

	return false
}

// SetJson gets a reference to the given map[string]interface{} and assigns it to the Json field.
func (o *HTTPParams) SetJson(v map[string]interface{}) {
	o.Json = v
}

// GetHeaders returns the Headers field value if set, zero value otherwise.
func (o *HTTPParams) GetHeaders() map[string]interface{} {
	if o == nil || IsNil(o.Headers) {
		var ret map[string]interface{}
		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 *HTTPParams) GetHeadersOk() (map[string]interface{}, bool) {
	if o == nil || IsNil(o.Headers) {
		return map[string]interface{}{}, false
	}
	return o.Headers, true
}

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

	return false
}

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

// GetStatusCodes returns the StatusCodes field value if set, zero value otherwise.
func (o *HTTPParams) GetStatusCodes() []int32 {
	if o == nil || IsNil(o.StatusCodes) {
		var ret []int32
		return ret
	}
	return o.StatusCodes
}

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

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

	return false
}

// SetStatusCodes gets a reference to the given []int32 and assigns it to the StatusCodes field.
func (o *HTTPParams) SetStatusCodes(v []int32) {
	o.StatusCodes = v
}

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

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

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

	return false
}

// SetConnectionTimeOut gets a reference to the given int32 and assigns it to the ConnectionTimeOut field.
func (o *HTTPParams) SetConnectionTimeOut(v int32) {
	o.ConnectionTimeOut = &v
}

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

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

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

	return false
}

// SetReadTimeOut gets a reference to the given int32 and assigns it to the ReadTimeOut field.
func (o *HTTPParams) SetReadTimeOut(v int32) {
	o.ReadTimeOut = &v
}

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

func (o HTTPParams) 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.ContentType) {
		toSerialize["contentType"] = o.ContentType
	}
	if !IsNil(o.Body) {
		toSerialize["body"] = o.Body
	}
	if !IsNil(o.Json) {
		toSerialize["json"] = o.Json
	}
	if !IsNil(o.Headers) {
		toSerialize["headers"] = o.Headers
	}
	if !IsNil(o.StatusCodes) {
		toSerialize["statusCodes"] = o.StatusCodes
	}
	if !IsNil(o.ConnectionTimeOut) {
		toSerialize["connectionTimeOut"] = o.ConnectionTimeOut
	}
	if !IsNil(o.ReadTimeOut) {
		toSerialize["readTimeOut"] = o.ReadTimeOut
	}

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

	return toSerialize, nil
}

func (o *HTTPParams) UnmarshalJSON(data []byte) (err error) {
	varHTTPParams := _HTTPParams{}

	err = json.Unmarshal(data, &varHTTPParams)

	if err != nil {
		return err
	}

	*o = HTTPParams(varHTTPParams)

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

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

	return err
}

type NullableHTTPParams struct {
	value *HTTPParams
	isSet bool
}

func (v NullableHTTPParams) Get() *HTTPParams {
	return v.value
}

func (v *NullableHTTPParams) Set(val *HTTPParams) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableHTTPParams(val *HTTPParams) *NullableHTTPParams {
	return &NullableHTTPParams{value: val, isSet: true}
}

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

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


