/*
Configuration API

API version: 2
*/

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

package balanceplatform

import (
	"encoding/json"

	"github.com/adyen/adyen-go-api-library/v21/src/common"
)

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

// SearchRegisteredDevicesResponse struct for SearchRegisteredDevicesResponse
type SearchRegisteredDevicesResponse struct {
	// Contains a list of registered SCA devices and their corresponding details.
	Data []Device `json:"data,omitempty"`
	// The total amount of registered SCA devices that match the query parameters.
	ItemsTotal *int32 `json:"itemsTotal,omitempty"`
	Link       *Link  `json:"link,omitempty"`
	// The total amount of list pages.
	PagesTotal *int32 `json:"pagesTotal,omitempty"`
}

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

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

// GetData returns the Data field value if set, zero value otherwise.
func (o *SearchRegisteredDevicesResponse) GetData() []Device {
	if o == nil || common.IsNil(o.Data) {
		var ret []Device
		return ret
	}
	return o.Data
}

// GetDataOk returns a tuple with the Data field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SearchRegisteredDevicesResponse) GetDataOk() ([]Device, bool) {
	if o == nil || common.IsNil(o.Data) {
		return nil, false
	}
	return o.Data, true
}

// HasData returns a boolean if a field has been set.
func (o *SearchRegisteredDevicesResponse) HasData() bool {
	if o != nil && !common.IsNil(o.Data) {
		return true
	}

	return false
}

// SetData gets a reference to the given []Device and assigns it to the Data field.
func (o *SearchRegisteredDevicesResponse) SetData(v []Device) {
	o.Data = v
}

// GetItemsTotal returns the ItemsTotal field value if set, zero value otherwise.
func (o *SearchRegisteredDevicesResponse) GetItemsTotal() int32 {
	if o == nil || common.IsNil(o.ItemsTotal) {
		var ret int32
		return ret
	}
	return *o.ItemsTotal
}

// GetItemsTotalOk returns a tuple with the ItemsTotal field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SearchRegisteredDevicesResponse) GetItemsTotalOk() (*int32, bool) {
	if o == nil || common.IsNil(o.ItemsTotal) {
		return nil, false
	}
	return o.ItemsTotal, true
}

// HasItemsTotal returns a boolean if a field has been set.
func (o *SearchRegisteredDevicesResponse) HasItemsTotal() bool {
	if o != nil && !common.IsNil(o.ItemsTotal) {
		return true
	}

	return false
}

// SetItemsTotal gets a reference to the given int32 and assigns it to the ItemsTotal field.
func (o *SearchRegisteredDevicesResponse) SetItemsTotal(v int32) {
	o.ItemsTotal = &v
}

// GetLink returns the Link field value if set, zero value otherwise.
func (o *SearchRegisteredDevicesResponse) GetLink() Link {
	if o == nil || common.IsNil(o.Link) {
		var ret Link
		return ret
	}
	return *o.Link
}

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

// HasLink returns a boolean if a field has been set.
func (o *SearchRegisteredDevicesResponse) HasLink() bool {
	if o != nil && !common.IsNil(o.Link) {
		return true
	}

	return false
}

// SetLink gets a reference to the given Link and assigns it to the Link field.
func (o *SearchRegisteredDevicesResponse) SetLink(v Link) {
	o.Link = &v
}

// GetPagesTotal returns the PagesTotal field value if set, zero value otherwise.
func (o *SearchRegisteredDevicesResponse) GetPagesTotal() int32 {
	if o == nil || common.IsNil(o.PagesTotal) {
		var ret int32
		return ret
	}
	return *o.PagesTotal
}

// GetPagesTotalOk returns a tuple with the PagesTotal field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SearchRegisteredDevicesResponse) GetPagesTotalOk() (*int32, bool) {
	if o == nil || common.IsNil(o.PagesTotal) {
		return nil, false
	}
	return o.PagesTotal, true
}

// HasPagesTotal returns a boolean if a field has been set.
func (o *SearchRegisteredDevicesResponse) HasPagesTotal() bool {
	if o != nil && !common.IsNil(o.PagesTotal) {
		return true
	}

	return false
}

// SetPagesTotal gets a reference to the given int32 and assigns it to the PagesTotal field.
func (o *SearchRegisteredDevicesResponse) SetPagesTotal(v int32) {
	o.PagesTotal = &v
}

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

func (o SearchRegisteredDevicesResponse) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !common.IsNil(o.Data) {
		toSerialize["data"] = o.Data
	}
	if !common.IsNil(o.ItemsTotal) {
		toSerialize["itemsTotal"] = o.ItemsTotal
	}
	if !common.IsNil(o.Link) {
		toSerialize["link"] = o.Link
	}
	if !common.IsNil(o.PagesTotal) {
		toSerialize["pagesTotal"] = o.PagesTotal
	}
	return toSerialize, nil
}

type NullableSearchRegisteredDevicesResponse struct {
	value *SearchRegisteredDevicesResponse
	isSet bool
}

func (v NullableSearchRegisteredDevicesResponse) Get() *SearchRegisteredDevicesResponse {
	return v.value
}

func (v *NullableSearchRegisteredDevicesResponse) Set(val *SearchRegisteredDevicesResponse) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableSearchRegisteredDevicesResponse(val *SearchRegisteredDevicesResponse) *NullableSearchRegisteredDevicesResponse {
	return &NullableSearchRegisteredDevicesResponse{value: val, isSet: true}
}

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

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