model_game_response_offers_inner_price.go•6.72 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 GameResponseOffersInnerPrice type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &GameResponseOffersInnerPrice{}
// GameResponseOffersInnerPrice struct for GameResponseOffersInnerPrice
type GameResponseOffersInnerPrice struct {
Currency *string `json:"currency,omitempty"`
DiscountPercent *float32 `json:"discount_percent,omitempty"`
Value *float32 `json:"value,omitempty"`
Initial *float32 `json:"initial,omitempty"`
}
// NewGameResponseOffersInnerPrice instantiates a new GameResponseOffersInnerPrice 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 NewGameResponseOffersInnerPrice() *GameResponseOffersInnerPrice {
this := GameResponseOffersInnerPrice{}
return &this
}
// NewGameResponseOffersInnerPriceWithDefaults instantiates a new GameResponseOffersInnerPrice 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 NewGameResponseOffersInnerPriceWithDefaults() *GameResponseOffersInnerPrice {
this := GameResponseOffersInnerPrice{}
return &this
}
// GetCurrency returns the Currency field value if set, zero value otherwise.
func (o *GameResponseOffersInnerPrice) GetCurrency() string {
if o == nil || IsNil(o.Currency) {
var ret string
return ret
}
return *o.Currency
}
// GetCurrencyOk returns a tuple with the Currency field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GameResponseOffersInnerPrice) GetCurrencyOk() (*string, bool) {
if o == nil || IsNil(o.Currency) {
return nil, false
}
return o.Currency, true
}
// HasCurrency returns a boolean if a field has been set.
func (o *GameResponseOffersInnerPrice) HasCurrency() bool {
if o != nil && !IsNil(o.Currency) {
return true
}
return false
}
// SetCurrency gets a reference to the given string and assigns it to the Currency field.
func (o *GameResponseOffersInnerPrice) SetCurrency(v string) {
o.Currency = &v
}
// GetDiscountPercent returns the DiscountPercent field value if set, zero value otherwise.
func (o *GameResponseOffersInnerPrice) GetDiscountPercent() float32 {
if o == nil || IsNil(o.DiscountPercent) {
var ret float32
return ret
}
return *o.DiscountPercent
}
// GetDiscountPercentOk returns a tuple with the DiscountPercent field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GameResponseOffersInnerPrice) GetDiscountPercentOk() (*float32, bool) {
if o == nil || IsNil(o.DiscountPercent) {
return nil, false
}
return o.DiscountPercent, true
}
// HasDiscountPercent returns a boolean if a field has been set.
func (o *GameResponseOffersInnerPrice) HasDiscountPercent() bool {
if o != nil && !IsNil(o.DiscountPercent) {
return true
}
return false
}
// SetDiscountPercent gets a reference to the given float32 and assigns it to the DiscountPercent field.
func (o *GameResponseOffersInnerPrice) SetDiscountPercent(v float32) {
o.DiscountPercent = &v
}
// GetValue returns the Value field value if set, zero value otherwise.
func (o *GameResponseOffersInnerPrice) GetValue() float32 {
if o == nil || IsNil(o.Value) {
var ret float32
return ret
}
return *o.Value
}
// GetValueOk returns a tuple with the Value field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GameResponseOffersInnerPrice) GetValueOk() (*float32, bool) {
if o == nil || IsNil(o.Value) {
return nil, false
}
return o.Value, true
}
// HasValue returns a boolean if a field has been set.
func (o *GameResponseOffersInnerPrice) HasValue() bool {
if o != nil && !IsNil(o.Value) {
return true
}
return false
}
// SetValue gets a reference to the given float32 and assigns it to the Value field.
func (o *GameResponseOffersInnerPrice) SetValue(v float32) {
o.Value = &v
}
// GetInitial returns the Initial field value if set, zero value otherwise.
func (o *GameResponseOffersInnerPrice) GetInitial() float32 {
if o == nil || IsNil(o.Initial) {
var ret float32
return ret
}
return *o.Initial
}
// GetInitialOk returns a tuple with the Initial field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GameResponseOffersInnerPrice) GetInitialOk() (*float32, bool) {
if o == nil || IsNil(o.Initial) {
return nil, false
}
return o.Initial, true
}
// HasInitial returns a boolean if a field has been set.
func (o *GameResponseOffersInnerPrice) HasInitial() bool {
if o != nil && !IsNil(o.Initial) {
return true
}
return false
}
// SetInitial gets a reference to the given float32 and assigns it to the Initial field.
func (o *GameResponseOffersInnerPrice) SetInitial(v float32) {
o.Initial = &v
}
func (o GameResponseOffersInnerPrice) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o GameResponseOffersInnerPrice) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Currency) {
toSerialize["currency"] = o.Currency
}
if !IsNil(o.DiscountPercent) {
toSerialize["discount_percent"] = o.DiscountPercent
}
if !IsNil(o.Value) {
toSerialize["value"] = o.Value
}
if !IsNil(o.Initial) {
toSerialize["initial"] = o.Initial
}
return toSerialize, nil
}
type NullableGameResponseOffersInnerPrice struct {
value *GameResponseOffersInnerPrice
isSet bool
}
func (v NullableGameResponseOffersInnerPrice) Get() *GameResponseOffersInnerPrice {
return v.value
}
func (v *NullableGameResponseOffersInnerPrice) Set(val *GameResponseOffersInnerPrice) {
v.value = val
v.isSet = true
}
func (v NullableGameResponseOffersInnerPrice) IsSet() bool {
return v.isSet
}
func (v *NullableGameResponseOffersInnerPrice) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableGameResponseOffersInnerPrice(val *GameResponseOffersInnerPrice) *NullableGameResponseOffersInnerPrice {
return &NullableGameResponseOffersInnerPrice{value: val, isSet: true}
}
func (v NullableGameResponseOffersInnerPrice) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableGameResponseOffersInnerPrice) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}