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

// PolicyBundleRecord A policy bundle plus some metadata
type PolicyBundleRecord struct {
	CreatedAt *time.Time `json:"created_at,omitempty"`
	LastUpdated *time.Time `json:"last_updated,omitempty"`
	// The bundle's identifier
	PolicyId *string `json:"policyId,omitempty"`
	// True if the bundle is currently defined to be used automatically
	Active *bool `json:"active,omitempty"`
	// UserId of the user that owns the bundle
	UserId *string `json:"userId,omitempty"`
	// Source location of where the policy bundle originated
	PolicySource *string `json:"policy_source,omitempty"`
	Policybundle *PolicyBundle `json:"policybundle,omitempty"`
}

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

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

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

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

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

	return false
}

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

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

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

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

	return false
}

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

// GetPolicyId returns the PolicyId field value if set, zero value otherwise.
func (o *PolicyBundleRecord) GetPolicyId() string {
	if o == nil || o.PolicyId == nil {
		var ret string
		return ret
	}
	return *o.PolicyId
}

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

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

	return false
}

// SetPolicyId gets a reference to the given string and assigns it to the PolicyId field.
func (o *PolicyBundleRecord) SetPolicyId(v string) {
	o.PolicyId = &v
}

// GetActive returns the Active field value if set, zero value otherwise.
func (o *PolicyBundleRecord) GetActive() bool {
	if o == nil || o.Active == nil {
		var ret bool
		return ret
	}
	return *o.Active
}

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

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

	return false
}

// SetActive gets a reference to the given bool and assigns it to the Active field.
func (o *PolicyBundleRecord) SetActive(v bool) {
	o.Active = &v
}

// GetUserId returns the UserId field value if set, zero value otherwise.
func (o *PolicyBundleRecord) GetUserId() string {
	if o == nil || o.UserId == nil {
		var ret string
		return ret
	}
	return *o.UserId
}

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

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

	return false
}

// SetUserId gets a reference to the given string and assigns it to the UserId field.
func (o *PolicyBundleRecord) SetUserId(v string) {
	o.UserId = &v
}

// GetPolicySource returns the PolicySource field value if set, zero value otherwise.
func (o *PolicyBundleRecord) GetPolicySource() string {
	if o == nil || o.PolicySource == nil {
		var ret string
		return ret
	}
	return *o.PolicySource
}

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

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

	return false
}

// SetPolicySource gets a reference to the given string and assigns it to the PolicySource field.
func (o *PolicyBundleRecord) SetPolicySource(v string) {
	o.PolicySource = &v
}

// GetPolicybundle returns the Policybundle field value if set, zero value otherwise.
func (o *PolicyBundleRecord) GetPolicybundle() PolicyBundle {
	if o == nil || o.Policybundle == nil {
		var ret PolicyBundle
		return ret
	}
	return *o.Policybundle
}

// GetPolicybundleOk returns a tuple with the Policybundle field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PolicyBundleRecord) GetPolicybundleOk() (*PolicyBundle, bool) {
	if o == nil || o.Policybundle == nil {
		return nil, false
	}
	return o.Policybundle, true
}

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

	return false
}

// SetPolicybundle gets a reference to the given PolicyBundle and assigns it to the Policybundle field.
func (o *PolicyBundleRecord) SetPolicybundle(v PolicyBundle) {
	o.Policybundle = &v
}

func (o PolicyBundleRecord) MarshalJSON() ([]byte, error) {
	toSerialize := map[string]interface{}{}
	if o.CreatedAt != nil {
		toSerialize["created_at"] = o.CreatedAt
	}
	if o.LastUpdated != nil {
		toSerialize["last_updated"] = o.LastUpdated
	}
	if o.PolicyId != nil {
		toSerialize["policyId"] = o.PolicyId
	}
	if o.Active != nil {
		toSerialize["active"] = o.Active
	}
	if o.UserId != nil {
		toSerialize["userId"] = o.UserId
	}
	if o.PolicySource != nil {
		toSerialize["policy_source"] = o.PolicySource
	}
	if o.Policybundle != nil {
		toSerialize["policybundle"] = o.Policybundle
	}
	return json.Marshal(toSerialize)
}

type NullablePolicyBundleRecord struct {
	value *PolicyBundleRecord
	isSet bool
}

func (v NullablePolicyBundleRecord) Get() *PolicyBundleRecord {
	return v.value
}

func (v *NullablePolicyBundleRecord) Set(val *PolicyBundleRecord) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullablePolicyBundleRecord(val *PolicyBundleRecord) *NullablePolicyBundleRecord {
	return &NullablePolicyBundleRecord{value: val, isSet: true}
}

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

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


