/*
Hindsight HTTP API

HTTP API for Hindsight

API version: 0.4.21
*/

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

package hindsight

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

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

// AuditLogListResponse Response model for list audit logs endpoint.
type AuditLogListResponse struct {
	BankId string `json:"bank_id"`
	Total int32 `json:"total"`
	Limit int32 `json:"limit"`
	Offset int32 `json:"offset"`
	Items []AuditLogEntry `json:"items"`
}

type _AuditLogListResponse AuditLogListResponse

// NewAuditLogListResponse instantiates a new AuditLogListResponse 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 NewAuditLogListResponse(bankId string, total int32, limit int32, offset int32, items []AuditLogEntry) *AuditLogListResponse {
	this := AuditLogListResponse{}
	this.BankId = bankId
	this.Total = total
	this.Limit = limit
	this.Offset = offset
	this.Items = items
	return &this
}

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

// GetBankId returns the BankId field value
func (o *AuditLogListResponse) 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 *AuditLogListResponse) GetBankIdOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return &o.BankId, true
}

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

// GetTotal returns the Total field value
func (o *AuditLogListResponse) GetTotal() int32 {
	if o == nil {
		var ret int32
		return ret
	}

	return o.Total
}

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

// SetTotal sets field value
func (o *AuditLogListResponse) SetTotal(v int32) {
	o.Total = v
}

// GetLimit returns the Limit field value
func (o *AuditLogListResponse) GetLimit() int32 {
	if o == nil {
		var ret int32
		return ret
	}

	return o.Limit
}

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

// SetLimit sets field value
func (o *AuditLogListResponse) SetLimit(v int32) {
	o.Limit = v
}

// GetOffset returns the Offset field value
func (o *AuditLogListResponse) GetOffset() int32 {
	if o == nil {
		var ret int32
		return ret
	}

	return o.Offset
}

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

// SetOffset sets field value
func (o *AuditLogListResponse) SetOffset(v int32) {
	o.Offset = v
}

// GetItems returns the Items field value
func (o *AuditLogListResponse) GetItems() []AuditLogEntry {
	if o == nil {
		var ret []AuditLogEntry
		return ret
	}

	return o.Items
}

// GetItemsOk returns a tuple with the Items field value
// and a boolean to check if the value has been set.
func (o *AuditLogListResponse) GetItemsOk() ([]AuditLogEntry, bool) {
	if o == nil {
		return nil, false
	}
	return o.Items, true
}

// SetItems sets field value
func (o *AuditLogListResponse) SetItems(v []AuditLogEntry) {
	o.Items = v
}

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

func (o AuditLogListResponse) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	toSerialize["bank_id"] = o.BankId
	toSerialize["total"] = o.Total
	toSerialize["limit"] = o.Limit
	toSerialize["offset"] = o.Offset
	toSerialize["items"] = o.Items
	return toSerialize, nil
}

func (o *AuditLogListResponse) 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",
		"total",
		"limit",
		"offset",
		"items",
	}

	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)
		}
	}

	varAuditLogListResponse := _AuditLogListResponse{}

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

	if err != nil {
		return err
	}

	*o = AuditLogListResponse(varAuditLogListResponse)

	return err
}

type NullableAuditLogListResponse struct {
	value *AuditLogListResponse
	isSet bool
}

func (v NullableAuditLogListResponse) Get() *AuditLogListResponse {
	return v.value
}

func (v *NullableAuditLogListResponse) Set(val *AuditLogListResponse) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableAuditLogListResponse(val *AuditLogListResponse) *NullableAuditLogListResponse {
	return &NullableAuditLogListResponse{value: val, isSet: true}
}

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

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


