/*
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"
	"time"
)

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

// AuthSet struct for AuthSet
type AuthSet struct {
	// The unique ID of the authentication set.
	Id *string `json:"id,omitempty"`
	// The unique ID of the device the authentication set belongs.
	DeviceId *string `json:"device_id,omitempty"`
	// The device's identity data.
	IdentityData map[string]interface{} `json:"identity_data,omitempty"`
	// PEM-encoded public key of the device authentication set.
	Pubkey *string `json:"pubkey,omitempty"`
	// Authorization status of the set.
	Status *string `json:"status,omitempty"`
	// The creation timestamp of the authentication set.
	Ts *time.Time `json:"ts,omitempty"`
	AdditionalProperties map[string]interface{}
}

type _AuthSet AuthSet

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

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

// GetId returns the Id field value if set, zero value otherwise.
func (o *AuthSet) 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 *AuthSet) 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 *AuthSet) 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 *AuthSet) SetId(v string) {
	o.Id = &v
}

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

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

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

	return false
}

// SetDeviceId gets a reference to the given string and assigns it to the DeviceId field.
func (o *AuthSet) SetDeviceId(v string) {
	o.DeviceId = &v
}

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

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

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

	return false
}

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

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

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

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

	return false
}

// SetPubkey gets a reference to the given string and assigns it to the Pubkey field.
func (o *AuthSet) SetPubkey(v string) {
	o.Pubkey = &v
}

// GetStatus returns the Status field value if set, zero value otherwise.
func (o *AuthSet) 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 *AuthSet) 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 *AuthSet) 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 *AuthSet) SetStatus(v string) {
	o.Status = &v
}

// GetTs returns the Ts field value if set, zero value otherwise.
func (o *AuthSet) GetTs() time.Time {
	if o == nil || IsNil(o.Ts) {
		var ret time.Time
		return ret
	}
	return *o.Ts
}

// GetTsOk returns a tuple with the Ts field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AuthSet) GetTsOk() (*time.Time, bool) {
	if o == nil || IsNil(o.Ts) {
		return nil, false
	}
	return o.Ts, true
}

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

	return false
}

// SetTs gets a reference to the given time.Time and assigns it to the Ts field.
func (o *AuthSet) SetTs(v time.Time) {
	o.Ts = &v
}

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

func (o AuthSet) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !IsNil(o.Id) {
		toSerialize["id"] = o.Id
	}
	if !IsNil(o.DeviceId) {
		toSerialize["device_id"] = o.DeviceId
	}
	if !IsNil(o.IdentityData) {
		toSerialize["identity_data"] = o.IdentityData
	}
	if !IsNil(o.Pubkey) {
		toSerialize["pubkey"] = o.Pubkey
	}
	if !IsNil(o.Status) {
		toSerialize["status"] = o.Status
	}
	if !IsNil(o.Ts) {
		toSerialize["ts"] = o.Ts
	}

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

	return toSerialize, nil
}

func (o *AuthSet) UnmarshalJSON(data []byte) (err error) {
	varAuthSet := _AuthSet{}

	err = json.Unmarshal(data, &varAuthSet)

	if err != nil {
		return err
	}

	*o = AuthSet(varAuthSet)

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

	if err = json.Unmarshal(data, &additionalProperties); err == nil {
		delete(additionalProperties, "id")
		delete(additionalProperties, "device_id")
		delete(additionalProperties, "identity_data")
		delete(additionalProperties, "pubkey")
		delete(additionalProperties, "status")
		delete(additionalProperties, "ts")
		o.AdditionalProperties = additionalProperties
	}

	return err
}

type NullableAuthSet struct {
	value *AuthSet
	isSet bool
}

func (v NullableAuthSet) Get() *AuthSet {
	return v.value
}

func (v *NullableAuthSet) Set(val *AuthSet) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableAuthSet(val *AuthSet) *NullableAuthSet {
	return &NullableAuthSet{value: val, isSet: true}
}

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

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


