/*
Hindsight HTTP API

HTTP API for Hindsight

API version: 0.5.3
*/

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

package hindsight

import (
	"encoding/json"
	"bytes"
	"fmt"
)

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

// BankListItem Bank list item with profile summary.
type BankListItem struct {
	BankId string `json:"bank_id"`
	Name NullableString `json:"name,omitempty"`
	Disposition DispositionTraits `json:"disposition"`
	Mission NullableString `json:"mission,omitempty"`
	CreatedAt NullableString `json:"created_at,omitempty"`
	UpdatedAt NullableString `json:"updated_at,omitempty"`
}

type _BankListItem BankListItem

// NewBankListItem instantiates a new BankListItem 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 NewBankListItem(bankId string, disposition DispositionTraits) *BankListItem {
	this := BankListItem{}
	this.BankId = bankId
	this.Disposition = disposition
	return &this
}

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

// GetBankId returns the BankId field value
func (o *BankListItem) GetBankId() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.BankId
}

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

// SetBankId sets field value
func (o *BankListItem) SetBankId(v string) {
	o.BankId = v
}

// GetName returns the Name field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *BankListItem) GetName() string {
	if o == nil || IsNil(o.Name.Get()) {
		var ret string
		return ret
	}
	return *o.Name.Get()
}

// GetNameOk returns a tuple with the Name field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *BankListItem) GetNameOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return o.Name.Get(), o.Name.IsSet()
}

// HasName returns a boolean if a field has been set.
func (o *BankListItem) HasName() bool {
	if o != nil && o.Name.IsSet() {
		return true
	}

	return false
}

// SetName gets a reference to the given NullableString and assigns it to the Name field.
func (o *BankListItem) SetName(v string) {
	o.Name.Set(&v)
}
// SetNameNil sets the value for Name to be an explicit nil
func (o *BankListItem) SetNameNil() {
	o.Name.Set(nil)
}

// UnsetName ensures that no value is present for Name, not even an explicit nil
func (o *BankListItem) UnsetName() {
	o.Name.Unset()
}

// GetDisposition returns the Disposition field value
func (o *BankListItem) GetDisposition() DispositionTraits {
	if o == nil {
		var ret DispositionTraits
		return ret
	}

	return o.Disposition
}

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

// SetDisposition sets field value
func (o *BankListItem) SetDisposition(v DispositionTraits) {
	o.Disposition = v
}

// GetMission returns the Mission field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *BankListItem) GetMission() string {
	if o == nil || IsNil(o.Mission.Get()) {
		var ret string
		return ret
	}
	return *o.Mission.Get()
}

// GetMissionOk returns a tuple with the Mission field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *BankListItem) GetMissionOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return o.Mission.Get(), o.Mission.IsSet()
}

// HasMission returns a boolean if a field has been set.
func (o *BankListItem) HasMission() bool {
	if o != nil && o.Mission.IsSet() {
		return true
	}

	return false
}

// SetMission gets a reference to the given NullableString and assigns it to the Mission field.
func (o *BankListItem) SetMission(v string) {
	o.Mission.Set(&v)
}
// SetMissionNil sets the value for Mission to be an explicit nil
func (o *BankListItem) SetMissionNil() {
	o.Mission.Set(nil)
}

// UnsetMission ensures that no value is present for Mission, not even an explicit nil
func (o *BankListItem) UnsetMission() {
	o.Mission.Unset()
}

// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *BankListItem) GetCreatedAt() string {
	if o == nil || IsNil(o.CreatedAt.Get()) {
		var ret string
		return ret
	}
	return *o.CreatedAt.Get()
}

// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *BankListItem) GetCreatedAtOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return o.CreatedAt.Get(), o.CreatedAt.IsSet()
}

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

	return false
}

// SetCreatedAt gets a reference to the given NullableString and assigns it to the CreatedAt field.
func (o *BankListItem) SetCreatedAt(v string) {
	o.CreatedAt.Set(&v)
}
// SetCreatedAtNil sets the value for CreatedAt to be an explicit nil
func (o *BankListItem) SetCreatedAtNil() {
	o.CreatedAt.Set(nil)
}

// UnsetCreatedAt ensures that no value is present for CreatedAt, not even an explicit nil
func (o *BankListItem) UnsetCreatedAt() {
	o.CreatedAt.Unset()
}

// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *BankListItem) GetUpdatedAt() string {
	if o == nil || IsNil(o.UpdatedAt.Get()) {
		var ret string
		return ret
	}
	return *o.UpdatedAt.Get()
}

// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *BankListItem) GetUpdatedAtOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return o.UpdatedAt.Get(), o.UpdatedAt.IsSet()
}

// HasUpdatedAt returns a boolean if a field has been set.
func (o *BankListItem) HasUpdatedAt() bool {
	if o != nil && o.UpdatedAt.IsSet() {
		return true
	}

	return false
}

// SetUpdatedAt gets a reference to the given NullableString and assigns it to the UpdatedAt field.
func (o *BankListItem) SetUpdatedAt(v string) {
	o.UpdatedAt.Set(&v)
}
// SetUpdatedAtNil sets the value for UpdatedAt to be an explicit nil
func (o *BankListItem) SetUpdatedAtNil() {
	o.UpdatedAt.Set(nil)
}

// UnsetUpdatedAt ensures that no value is present for UpdatedAt, not even an explicit nil
func (o *BankListItem) UnsetUpdatedAt() {
	o.UpdatedAt.Unset()
}

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

func (o BankListItem) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	toSerialize["bank_id"] = o.BankId
	if o.Name.IsSet() {
		toSerialize["name"] = o.Name.Get()
	}
	toSerialize["disposition"] = o.Disposition
	if o.Mission.IsSet() {
		toSerialize["mission"] = o.Mission.Get()
	}
	if o.CreatedAt.IsSet() {
		toSerialize["created_at"] = o.CreatedAt.Get()
	}
	if o.UpdatedAt.IsSet() {
		toSerialize["updated_at"] = o.UpdatedAt.Get()
	}
	return toSerialize, nil
}

func (o *BankListItem) UnmarshalJSON(data []byte) (err error) {
	// This validates that all required properties are included in the JSON object
	// by unmarshalling the object into a generic map with string keys and checking
	// that every required field exists as a key in the generic map.
	requiredProperties := []string{
		"bank_id",
		"disposition",
	}

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

	err = json.Unmarshal(data, &allProperties)

	if err != nil {
		return err;
	}

	for _, requiredProperty := range(requiredProperties) {
		if _, exists := allProperties[requiredProperty]; !exists {
			return fmt.Errorf("no value given for required property %v", requiredProperty)
		}
	}

	varBankListItem := _BankListItem{}

	decoder := json.NewDecoder(bytes.NewReader(data))
	decoder.DisallowUnknownFields()
	err = decoder.Decode(&varBankListItem)

	if err != nil {
		return err
	}

	*o = BankListItem(varBankListItem)

	return err
}

type NullableBankListItem struct {
	value *BankListItem
	isSet bool
}

func (v NullableBankListItem) Get() *BankListItem {
	return v.value
}

func (v *NullableBankListItem) Set(val *BankListItem) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableBankListItem(val *BankListItem) *NullableBankListItem {
	return &NullableBankListItem{value: val, isSet: true}
}

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

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


