/*
Anchore Engine API Server

This is the Anchore Engine API. Provides the primary external API for users of the service.

API version: 0.1.20
Contact: nurmi@anchore.com
*/

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

package anchore

import (
	"encoding/json"
	"time"
)

// WhitelistItem Identifies a specific gate and trigger match from a policy against an image and indicates it should be ignored in final policy decisions
type WhitelistItem struct {
	Id *string `json:"id,omitempty"`
	Gate string `json:"gate"`
	TriggerId string `json:"trigger_id"`
	ExpiresOn *time.Time `json:"expires_on,omitempty"`
}

// NewWhitelistItem instantiates a new WhitelistItem 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 NewWhitelistItem(gate string, triggerId string) *WhitelistItem {
	this := WhitelistItem{}
	this.Gate = gate
	this.TriggerId = triggerId
	return &this
}

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

// GetId returns the Id field value if set, zero value otherwise.
func (o *WhitelistItem) GetId() string {
	if o == nil || o.Id == nil {
		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 *WhitelistItem) GetIdOk() (*string, bool) {
	if o == nil || o.Id == nil {
		return nil, false
	}
	return o.Id, true
}

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

	return false
}

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

// GetGate returns the Gate field value
func (o *WhitelistItem) GetGate() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.Gate
}

// GetGateOk returns a tuple with the Gate field value
// and a boolean to check if the value has been set.
func (o *WhitelistItem) GetGateOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return &o.Gate, true
}

// SetGate sets field value
func (o *WhitelistItem) SetGate(v string) {
	o.Gate = v
}

// GetTriggerId returns the TriggerId field value
func (o *WhitelistItem) GetTriggerId() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.TriggerId
}

// GetTriggerIdOk returns a tuple with the TriggerId field value
// and a boolean to check if the value has been set.
func (o *WhitelistItem) GetTriggerIdOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return &o.TriggerId, true
}

// SetTriggerId sets field value
func (o *WhitelistItem) SetTriggerId(v string) {
	o.TriggerId = v
}

// GetExpiresOn returns the ExpiresOn field value if set, zero value otherwise.
func (o *WhitelistItem) GetExpiresOn() time.Time {
	if o == nil || o.ExpiresOn == nil {
		var ret time.Time
		return ret
	}
	return *o.ExpiresOn
}

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

// HasExpiresOn returns a boolean if a field has been set.
func (o *WhitelistItem) HasExpiresOn() bool {
	if o != nil && o.ExpiresOn != nil {
		return true
	}

	return false
}

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

func (o WhitelistItem) MarshalJSON() ([]byte, error) {
	toSerialize := map[string]interface{}{}
	if o.Id != nil {
		toSerialize["id"] = o.Id
	}
	if true {
		toSerialize["gate"] = o.Gate
	}
	if true {
		toSerialize["trigger_id"] = o.TriggerId
	}
	if o.ExpiresOn != nil {
		toSerialize["expires_on"] = o.ExpiresOn
	}
	return json.Marshal(toSerialize)
}

type NullableWhitelistItem struct {
	value *WhitelistItem
	isSet bool
}

func (v NullableWhitelistItem) Get() *WhitelistItem {
	return v.value
}

func (v *NullableWhitelistItem) Set(val *WhitelistItem) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableWhitelistItem(val *WhitelistItem) *NullableWhitelistItem {
	return &NullableWhitelistItem{value: val, isSet: true}
}

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

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


