model_game_response_rating.go•9.61 kB
/*
GameBrain API
GameBrain API
API version: 1.0.1
Contact: mail@gamebrain.co
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package gamebrain
import (
"encoding/json"
)
// checks if the GameResponseRating type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &GameResponseRating{}
// GameResponseRating struct for GameResponseRating
type GameResponseRating struct {
Mean NullableFloat32 `json:"mean,omitempty"`
Count *int32 `json:"count,omitempty"`
MeanPlayers NullableFloat32 `json:"mean_players,omitempty"`
CountPlayers *int32 `json:"count_players,omitempty"`
MeanCritics NullableFloat32 `json:"mean_critics,omitempty"`
CountCritics *int32 `json:"count_critics,omitempty"`
}
// NewGameResponseRating instantiates a new GameResponseRating 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 NewGameResponseRating() *GameResponseRating {
this := GameResponseRating{}
return &this
}
// NewGameResponseRatingWithDefaults instantiates a new GameResponseRating 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 NewGameResponseRatingWithDefaults() *GameResponseRating {
this := GameResponseRating{}
return &this
}
// GetMean returns the Mean field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *GameResponseRating) GetMean() float32 {
if o == nil || IsNil(o.Mean.Get()) {
var ret float32
return ret
}
return *o.Mean.Get()
}
// GetMeanOk returns a tuple with the Mean 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 *GameResponseRating) GetMeanOk() (*float32, bool) {
if o == nil {
return nil, false
}
return o.Mean.Get(), o.Mean.IsSet()
}
// HasMean returns a boolean if a field has been set.
func (o *GameResponseRating) HasMean() bool {
if o != nil && o.Mean.IsSet() {
return true
}
return false
}
// SetMean gets a reference to the given NullableFloat32 and assigns it to the Mean field.
func (o *GameResponseRating) SetMean(v float32) {
o.Mean.Set(&v)
}
// SetMeanNil sets the value for Mean to be an explicit nil
func (o *GameResponseRating) SetMeanNil() {
o.Mean.Set(nil)
}
// UnsetMean ensures that no value is present for Mean, not even an explicit nil
func (o *GameResponseRating) UnsetMean() {
o.Mean.Unset()
}
// GetCount returns the Count field value if set, zero value otherwise.
func (o *GameResponseRating) GetCount() int32 {
if o == nil || IsNil(o.Count) {
var ret int32
return ret
}
return *o.Count
}
// GetCountOk returns a tuple with the Count field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GameResponseRating) GetCountOk() (*int32, bool) {
if o == nil || IsNil(o.Count) {
return nil, false
}
return o.Count, true
}
// HasCount returns a boolean if a field has been set.
func (o *GameResponseRating) HasCount() bool {
if o != nil && !IsNil(o.Count) {
return true
}
return false
}
// SetCount gets a reference to the given int32 and assigns it to the Count field.
func (o *GameResponseRating) SetCount(v int32) {
o.Count = &v
}
// GetMeanPlayers returns the MeanPlayers field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *GameResponseRating) GetMeanPlayers() float32 {
if o == nil || IsNil(o.MeanPlayers.Get()) {
var ret float32
return ret
}
return *o.MeanPlayers.Get()
}
// GetMeanPlayersOk returns a tuple with the MeanPlayers 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 *GameResponseRating) GetMeanPlayersOk() (*float32, bool) {
if o == nil {
return nil, false
}
return o.MeanPlayers.Get(), o.MeanPlayers.IsSet()
}
// HasMeanPlayers returns a boolean if a field has been set.
func (o *GameResponseRating) HasMeanPlayers() bool {
if o != nil && o.MeanPlayers.IsSet() {
return true
}
return false
}
// SetMeanPlayers gets a reference to the given NullableFloat32 and assigns it to the MeanPlayers field.
func (o *GameResponseRating) SetMeanPlayers(v float32) {
o.MeanPlayers.Set(&v)
}
// SetMeanPlayersNil sets the value for MeanPlayers to be an explicit nil
func (o *GameResponseRating) SetMeanPlayersNil() {
o.MeanPlayers.Set(nil)
}
// UnsetMeanPlayers ensures that no value is present for MeanPlayers, not even an explicit nil
func (o *GameResponseRating) UnsetMeanPlayers() {
o.MeanPlayers.Unset()
}
// GetCountPlayers returns the CountPlayers field value if set, zero value otherwise.
func (o *GameResponseRating) GetCountPlayers() int32 {
if o == nil || IsNil(o.CountPlayers) {
var ret int32
return ret
}
return *o.CountPlayers
}
// GetCountPlayersOk returns a tuple with the CountPlayers field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GameResponseRating) GetCountPlayersOk() (*int32, bool) {
if o == nil || IsNil(o.CountPlayers) {
return nil, false
}
return o.CountPlayers, true
}
// HasCountPlayers returns a boolean if a field has been set.
func (o *GameResponseRating) HasCountPlayers() bool {
if o != nil && !IsNil(o.CountPlayers) {
return true
}
return false
}
// SetCountPlayers gets a reference to the given int32 and assigns it to the CountPlayers field.
func (o *GameResponseRating) SetCountPlayers(v int32) {
o.CountPlayers = &v
}
// GetMeanCritics returns the MeanCritics field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *GameResponseRating) GetMeanCritics() float32 {
if o == nil || IsNil(o.MeanCritics.Get()) {
var ret float32
return ret
}
return *o.MeanCritics.Get()
}
// GetMeanCriticsOk returns a tuple with the MeanCritics 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 *GameResponseRating) GetMeanCriticsOk() (*float32, bool) {
if o == nil {
return nil, false
}
return o.MeanCritics.Get(), o.MeanCritics.IsSet()
}
// HasMeanCritics returns a boolean if a field has been set.
func (o *GameResponseRating) HasMeanCritics() bool {
if o != nil && o.MeanCritics.IsSet() {
return true
}
return false
}
// SetMeanCritics gets a reference to the given NullableFloat32 and assigns it to the MeanCritics field.
func (o *GameResponseRating) SetMeanCritics(v float32) {
o.MeanCritics.Set(&v)
}
// SetMeanCriticsNil sets the value for MeanCritics to be an explicit nil
func (o *GameResponseRating) SetMeanCriticsNil() {
o.MeanCritics.Set(nil)
}
// UnsetMeanCritics ensures that no value is present for MeanCritics, not even an explicit nil
func (o *GameResponseRating) UnsetMeanCritics() {
o.MeanCritics.Unset()
}
// GetCountCritics returns the CountCritics field value if set, zero value otherwise.
func (o *GameResponseRating) GetCountCritics() int32 {
if o == nil || IsNil(o.CountCritics) {
var ret int32
return ret
}
return *o.CountCritics
}
// GetCountCriticsOk returns a tuple with the CountCritics field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GameResponseRating) GetCountCriticsOk() (*int32, bool) {
if o == nil || IsNil(o.CountCritics) {
return nil, false
}
return o.CountCritics, true
}
// HasCountCritics returns a boolean if a field has been set.
func (o *GameResponseRating) HasCountCritics() bool {
if o != nil && !IsNil(o.CountCritics) {
return true
}
return false
}
// SetCountCritics gets a reference to the given int32 and assigns it to the CountCritics field.
func (o *GameResponseRating) SetCountCritics(v int32) {
o.CountCritics = &v
}
func (o GameResponseRating) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o GameResponseRating) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if o.Mean.IsSet() {
toSerialize["mean"] = o.Mean.Get()
}
if !IsNil(o.Count) {
toSerialize["count"] = o.Count
}
if o.MeanPlayers.IsSet() {
toSerialize["mean_players"] = o.MeanPlayers.Get()
}
if !IsNil(o.CountPlayers) {
toSerialize["count_players"] = o.CountPlayers
}
if o.MeanCritics.IsSet() {
toSerialize["mean_critics"] = o.MeanCritics.Get()
}
if !IsNil(o.CountCritics) {
toSerialize["count_critics"] = o.CountCritics
}
return toSerialize, nil
}
type NullableGameResponseRating struct {
value *GameResponseRating
isSet bool
}
func (v NullableGameResponseRating) Get() *GameResponseRating {
return v.value
}
func (v *NullableGameResponseRating) Set(val *GameResponseRating) {
v.value = val
v.isSet = true
}
func (v NullableGameResponseRating) IsSet() bool {
return v.isSet
}
func (v *NullableGameResponseRating) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableGameResponseRating(val *GameResponseRating) *NullableGameResponseRating {
return &NullableGameResponseRating{value: val, isSet: true}
}
func (v NullableGameResponseRating) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableGameResponseRating) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}