/*
Hindsight HTTP API

HTTP API for Hindsight

API version: 0.4.17
*/

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

package hindsight

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

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

// OperationsListResponse Response model for list operations endpoint.
type OperationsListResponse struct {
	BankId string `json:"bank_id"`
	Total int32 `json:"total"`
	Limit int32 `json:"limit"`
	Offset int32 `json:"offset"`
	Operations []OperationResponse `json:"operations"`
}

type _OperationsListResponse OperationsListResponse

// NewOperationsListResponse instantiates a new OperationsListResponse 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 NewOperationsListResponse(bankId string, total int32, limit int32, offset int32, operations []OperationResponse) *OperationsListResponse {
	this := OperationsListResponse{}
	this.BankId = bankId
	this.Total = total
	this.Limit = limit
	this.Offset = offset
	this.Operations = operations
	return &this
}

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

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

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

// GetTotal returns the Total field value
func (o *OperationsListResponse) 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 *OperationsListResponse) GetTotalOk() (*int32, bool) {
	if o == nil {
		return nil, false
	}
	return &o.Total, true
}

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

// GetLimit returns the Limit field value
func (o *OperationsListResponse) 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 *OperationsListResponse) GetLimitOk() (*int32, bool) {
	if o == nil {
		return nil, false
	}
	return &o.Limit, true
}

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

// GetOffset returns the Offset field value
func (o *OperationsListResponse) 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 *OperationsListResponse) GetOffsetOk() (*int32, bool) {
	if o == nil {
		return nil, false
	}
	return &o.Offset, true
}

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

// GetOperations returns the Operations field value
func (o *OperationsListResponse) GetOperations() []OperationResponse {
	if o == nil {
		var ret []OperationResponse
		return ret
	}

	return o.Operations
}

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

// SetOperations sets field value
func (o *OperationsListResponse) SetOperations(v []OperationResponse) {
	o.Operations = v
}

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

func (o OperationsListResponse) 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["operations"] = o.Operations
	return toSerialize, nil
}

func (o *OperationsListResponse) 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",
		"operations",
	}

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

	varOperationsListResponse := _OperationsListResponse{}

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

	if err != nil {
		return err
	}

	*o = OperationsListResponse(varOperationsListResponse)

	return err
}

type NullableOperationsListResponse struct {
	value *OperationsListResponse
	isSet bool
}

func (v NullableOperationsListResponse) Get() *OperationsListResponse {
	return v.value
}

func (v *NullableOperationsListResponse) Set(val *OperationsListResponse) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableOperationsListResponse(val *OperationsListResponse) *NullableOperationsListResponse {
	return &NullableOperationsListResponse{value: val, isSet: true}
}

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

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


