github.com/optim-corp/cios-golang-sdk@v0.5.1/cios/model_location.go (about) 1 /* 2 * Cios Openapi 3 * 4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 5 * 6 * API version: 1.0.1 7 */ 8 9 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. 10 11 package cios 12 13 import ( 14 "encoding/json" 15 ) 16 17 // Location struct for Location 18 type Location struct { 19 Latitude float32 `json:"latitude"` 20 Longitude float32 `json:"longitude"` 21 } 22 23 // NewLocation instantiates a new Location object 24 // This constructor will assign default values to properties that have it defined, 25 // and makes sure properties required by API are set, but the set of arguments 26 // will change when the set of required properties is changed 27 func NewLocation(latitude float32, longitude float32, ) *Location { 28 this := Location{} 29 this.Latitude = latitude 30 this.Longitude = longitude 31 return &this 32 } 33 34 // NewLocationWithDefaults instantiates a new Location object 35 // This constructor will only assign default values to properties that have it defined, 36 // but it doesn't guarantee that properties required by API are set 37 func NewLocationWithDefaults() *Location { 38 this := Location{} 39 return &this 40 } 41 42 // GetLatitude returns the Latitude field value 43 func (o *Location) GetLatitude() float32 { 44 if o == nil { 45 var ret float32 46 return ret 47 } 48 49 return o.Latitude 50 } 51 52 // GetLatitudeOk returns a tuple with the Latitude field value 53 // and a boolean to check if the value has been set. 54 func (o *Location) GetLatitudeOk() (*float32, bool) { 55 if o == nil { 56 return nil, false 57 } 58 return &o.Latitude, true 59 } 60 61 // SetLatitude sets field value 62 func (o *Location) SetLatitude(v float32) { 63 o.Latitude = v 64 } 65 66 // GetLongitude returns the Longitude field value 67 func (o *Location) GetLongitude() float32 { 68 if o == nil { 69 var ret float32 70 return ret 71 } 72 73 return o.Longitude 74 } 75 76 // GetLongitudeOk returns a tuple with the Longitude field value 77 // and a boolean to check if the value has been set. 78 func (o *Location) GetLongitudeOk() (*float32, bool) { 79 if o == nil { 80 return nil, false 81 } 82 return &o.Longitude, true 83 } 84 85 // SetLongitude sets field value 86 func (o *Location) SetLongitude(v float32) { 87 o.Longitude = v 88 } 89 90 func (o Location) MarshalJSON() ([]byte, error) { 91 toSerialize := map[string]interface{}{} 92 if true { 93 toSerialize["latitude"] = o.Latitude 94 } 95 if true { 96 toSerialize["longitude"] = o.Longitude 97 } 98 return json.Marshal(toSerialize) 99 } 100 101 type NullableLocation struct { 102 value *Location 103 isSet bool 104 } 105 106 func (v NullableLocation) Get() *Location { 107 return v.value 108 } 109 110 func (v *NullableLocation) Set(val *Location) { 111 v.value = val 112 v.isSet = true 113 } 114 115 func (v NullableLocation) IsSet() bool { 116 return v.isSet 117 } 118 119 func (v *NullableLocation) Unset() { 120 v.value = nil 121 v.isSet = false 122 } 123 124 func NewNullableLocation(val *Location) *NullableLocation { 125 return &NullableLocation{value: val, isSet: true} 126 } 127 128 func (v NullableLocation) MarshalJSON() ([]byte, error) { 129 return json.Marshal(v.value) 130 } 131 132 func (v *NullableLocation) UnmarshalJSON(src []byte) error { 133 v.isSet = true 134 return json.Unmarshal(src, &v.value) 135 } 136 137