...

Source file src/go.formulabun.club/replays/ingest/client/model_replay.go

Documentation: go.formulabun.club/replays/ingest/client

     1  /*
     2  GoBun File Info
     3  
     4  No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
     5  
     6  API version: 0.0.1
     7  */
     8  
     9  // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
    10  
    11  package openapi
    12  
    13  import (
    14  	"encoding/json"
    15  )
    16  
    17  // Replay struct for Replay
    18  type Replay struct {
    19  	Title *string `json:"Title,omitempty"`
    20  	GameMap *float32 `json:"GameMap,omitempty"`
    21  	Time *float32 `json:"Time,omitempty"`
    22  	Lap *float32 `json:"Lap,omitempty"`
    23  	PlayerEntries []PlayerEntry `json:"PlayerEntries,omitempty"`
    24  }
    25  
    26  // NewReplay instantiates a new Replay object
    27  // This constructor will assign default values to properties that have it defined,
    28  // and makes sure properties required by API are set, but the set of arguments
    29  // will change when the set of required properties is changed
    30  func NewReplay() *Replay {
    31  	this := Replay{}
    32  	return &this
    33  }
    34  
    35  // NewReplayWithDefaults instantiates a new Replay object
    36  // This constructor will only assign default values to properties that have it defined,
    37  // but it doesn't guarantee that properties required by API are set
    38  func NewReplayWithDefaults() *Replay {
    39  	this := Replay{}
    40  	return &this
    41  }
    42  
    43  // GetTitle returns the Title field value if set, zero value otherwise.
    44  func (o *Replay) GetTitle() string {
    45  	if o == nil || o.Title == nil {
    46  		var ret string
    47  		return ret
    48  	}
    49  	return *o.Title
    50  }
    51  
    52  // GetTitleOk returns a tuple with the Title field value if set, nil otherwise
    53  // and a boolean to check if the value has been set.
    54  func (o *Replay) GetTitleOk() (*string, bool) {
    55  	if o == nil || o.Title == nil {
    56  		return nil, false
    57  	}
    58  	return o.Title, true
    59  }
    60  
    61  // HasTitle returns a boolean if a field has been set.
    62  func (o *Replay) HasTitle() bool {
    63  	if o != nil && o.Title != nil {
    64  		return true
    65  	}
    66  
    67  	return false
    68  }
    69  
    70  // SetTitle gets a reference to the given string and assigns it to the Title field.
    71  func (o *Replay) SetTitle(v string) {
    72  	o.Title = &v
    73  }
    74  
    75  // GetGameMap returns the GameMap field value if set, zero value otherwise.
    76  func (o *Replay) GetGameMap() float32 {
    77  	if o == nil || o.GameMap == nil {
    78  		var ret float32
    79  		return ret
    80  	}
    81  	return *o.GameMap
    82  }
    83  
    84  // GetGameMapOk returns a tuple with the GameMap field value if set, nil otherwise
    85  // and a boolean to check if the value has been set.
    86  func (o *Replay) GetGameMapOk() (*float32, bool) {
    87  	if o == nil || o.GameMap == nil {
    88  		return nil, false
    89  	}
    90  	return o.GameMap, true
    91  }
    92  
    93  // HasGameMap returns a boolean if a field has been set.
    94  func (o *Replay) HasGameMap() bool {
    95  	if o != nil && o.GameMap != nil {
    96  		return true
    97  	}
    98  
    99  	return false
   100  }
   101  
   102  // SetGameMap gets a reference to the given float32 and assigns it to the GameMap field.
   103  func (o *Replay) SetGameMap(v float32) {
   104  	o.GameMap = &v
   105  }
   106  
   107  // GetTime returns the Time field value if set, zero value otherwise.
   108  func (o *Replay) GetTime() float32 {
   109  	if o == nil || o.Time == nil {
   110  		var ret float32
   111  		return ret
   112  	}
   113  	return *o.Time
   114  }
   115  
   116  // GetTimeOk returns a tuple with the Time field value if set, nil otherwise
   117  // and a boolean to check if the value has been set.
   118  func (o *Replay) GetTimeOk() (*float32, bool) {
   119  	if o == nil || o.Time == nil {
   120  		return nil, false
   121  	}
   122  	return o.Time, true
   123  }
   124  
   125  // HasTime returns a boolean if a field has been set.
   126  func (o *Replay) HasTime() bool {
   127  	if o != nil && o.Time != nil {
   128  		return true
   129  	}
   130  
   131  	return false
   132  }
   133  
   134  // SetTime gets a reference to the given float32 and assigns it to the Time field.
   135  func (o *Replay) SetTime(v float32) {
   136  	o.Time = &v
   137  }
   138  
   139  // GetLap returns the Lap field value if set, zero value otherwise.
   140  func (o *Replay) GetLap() float32 {
   141  	if o == nil || o.Lap == nil {
   142  		var ret float32
   143  		return ret
   144  	}
   145  	return *o.Lap
   146  }
   147  
   148  // GetLapOk returns a tuple with the Lap field value if set, nil otherwise
   149  // and a boolean to check if the value has been set.
   150  func (o *Replay) GetLapOk() (*float32, bool) {
   151  	if o == nil || o.Lap == nil {
   152  		return nil, false
   153  	}
   154  	return o.Lap, true
   155  }
   156  
   157  // HasLap returns a boolean if a field has been set.
   158  func (o *Replay) HasLap() bool {
   159  	if o != nil && o.Lap != nil {
   160  		return true
   161  	}
   162  
   163  	return false
   164  }
   165  
   166  // SetLap gets a reference to the given float32 and assigns it to the Lap field.
   167  func (o *Replay) SetLap(v float32) {
   168  	o.Lap = &v
   169  }
   170  
   171  // GetPlayerEntries returns the PlayerEntries field value if set, zero value otherwise.
   172  func (o *Replay) GetPlayerEntries() []PlayerEntry {
   173  	if o == nil || o.PlayerEntries == nil {
   174  		var ret []PlayerEntry
   175  		return ret
   176  	}
   177  	return o.PlayerEntries
   178  }
   179  
   180  // GetPlayerEntriesOk returns a tuple with the PlayerEntries field value if set, nil otherwise
   181  // and a boolean to check if the value has been set.
   182  func (o *Replay) GetPlayerEntriesOk() ([]PlayerEntry, bool) {
   183  	if o == nil || o.PlayerEntries == nil {
   184  		return nil, false
   185  	}
   186  	return o.PlayerEntries, true
   187  }
   188  
   189  // HasPlayerEntries returns a boolean if a field has been set.
   190  func (o *Replay) HasPlayerEntries() bool {
   191  	if o != nil && o.PlayerEntries != nil {
   192  		return true
   193  	}
   194  
   195  	return false
   196  }
   197  
   198  // SetPlayerEntries gets a reference to the given []PlayerEntry and assigns it to the PlayerEntries field.
   199  func (o *Replay) SetPlayerEntries(v []PlayerEntry) {
   200  	o.PlayerEntries = v
   201  }
   202  
   203  func (o Replay) MarshalJSON() ([]byte, error) {
   204  	toSerialize := map[string]interface{}{}
   205  	if o.Title != nil {
   206  		toSerialize["Title"] = o.Title
   207  	}
   208  	if o.GameMap != nil {
   209  		toSerialize["GameMap"] = o.GameMap
   210  	}
   211  	if o.Time != nil {
   212  		toSerialize["Time"] = o.Time
   213  	}
   214  	if o.Lap != nil {
   215  		toSerialize["Lap"] = o.Lap
   216  	}
   217  	if o.PlayerEntries != nil {
   218  		toSerialize["PlayerEntries"] = o.PlayerEntries
   219  	}
   220  	return json.Marshal(toSerialize)
   221  }
   222  
   223  type NullableReplay struct {
   224  	value *Replay
   225  	isSet bool
   226  }
   227  
   228  func (v NullableReplay) Get() *Replay {
   229  	return v.value
   230  }
   231  
   232  func (v *NullableReplay) Set(val *Replay) {
   233  	v.value = val
   234  	v.isSet = true
   235  }
   236  
   237  func (v NullableReplay) IsSet() bool {
   238  	return v.isSet
   239  }
   240  
   241  func (v *NullableReplay) Unset() {
   242  	v.value = nil
   243  	v.isSet = false
   244  }
   245  
   246  func NewNullableReplay(val *Replay) *NullableReplay {
   247  	return &NullableReplay{value: val, isSet: true}
   248  }
   249  
   250  func (v NullableReplay) MarshalJSON() ([]byte, error) {
   251  	return json.Marshal(v.value)
   252  }
   253  
   254  func (v *NullableReplay) UnmarshalJSON(src []byte) error {
   255  	v.isSet = true
   256  	return json.Unmarshal(src, &v.value)
   257  }
   258  
   259  
   260  

View as plain text