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

// JobStatus struct for JobStatus
type JobStatus struct {
	Id *string `json:"id,omitempty"`
	WorkflowName *string `json:"workflowName,omitempty"`
	InputParameters []InputParameter `json:"inputParameters,omitempty"`
	Status *string `json:"status,omitempty"`
	Results []TaskResult `json:"results,omitempty"`
	AdditionalProperties map[string]interface{}
}

type _JobStatus JobStatus

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

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

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

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

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

	return false
}

// SetId gets a reference to the given string and assigns it to the Id field.
func (o *JobStatus) SetId(v string) {
	o.Id = &v
}

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

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

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

	return false
}

// SetWorkflowName gets a reference to the given string and assigns it to the WorkflowName field.
func (o *JobStatus) SetWorkflowName(v string) {
	o.WorkflowName = &v
}

// GetInputParameters returns the InputParameters field value if set, zero value otherwise.
func (o *JobStatus) GetInputParameters() []InputParameter {
	if o == nil || IsNil(o.InputParameters) {
		var ret []InputParameter
		return ret
	}
	return o.InputParameters
}

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

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

	return false
}

// SetInputParameters gets a reference to the given []InputParameter and assigns it to the InputParameters field.
func (o *JobStatus) SetInputParameters(v []InputParameter) {
	o.InputParameters = v
}

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

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

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

	return false
}

// SetStatus gets a reference to the given string and assigns it to the Status field.
func (o *JobStatus) SetStatus(v string) {
	o.Status = &v
}

// GetResults returns the Results field value if set, zero value otherwise.
func (o *JobStatus) GetResults() []TaskResult {
	if o == nil || IsNil(o.Results) {
		var ret []TaskResult
		return ret
	}
	return o.Results
}

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

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

	return false
}

// SetResults gets a reference to the given []TaskResult and assigns it to the Results field.
func (o *JobStatus) SetResults(v []TaskResult) {
	o.Results = v
}

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

func (o JobStatus) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !IsNil(o.Id) {
		toSerialize["id"] = o.Id
	}
	if !IsNil(o.WorkflowName) {
		toSerialize["workflowName"] = o.WorkflowName
	}
	if !IsNil(o.InputParameters) {
		toSerialize["inputParameters"] = o.InputParameters
	}
	if !IsNil(o.Status) {
		toSerialize["status"] = o.Status
	}
	if !IsNil(o.Results) {
		toSerialize["results"] = o.Results
	}

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

	return toSerialize, nil
}

func (o *JobStatus) UnmarshalJSON(data []byte) (err error) {
	varJobStatus := _JobStatus{}

	err = json.Unmarshal(data, &varJobStatus)

	if err != nil {
		return err
	}

	*o = JobStatus(varJobStatus)

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

	if err = json.Unmarshal(data, &additionalProperties); err == nil {
		delete(additionalProperties, "id")
		delete(additionalProperties, "workflowName")
		delete(additionalProperties, "inputParameters")
		delete(additionalProperties, "status")
		delete(additionalProperties, "results")
		o.AdditionalProperties = additionalProperties
	}

	return err
}

type NullableJobStatus struct {
	value *JobStatus
	isSet bool
}

func (v NullableJobStatus) Get() *JobStatus {
	return v.value
}

func (v *NullableJobStatus) Set(val *JobStatus) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableJobStatus(val *JobStatus) *NullableJobStatus {
	return &NullableJobStatus{value: val, isSet: true}
}

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

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


