/* API Яндекс Маркета для продавцов API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. API version: LATEST */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package ymclient import ( "encoding/json" "fmt" ) // checks if the GpsDTO type satisfies the MappedNullable interface at compile time var _ MappedNullable = &GpsDTO{} // GpsDTO GPS-координаты широты и долготы. type GpsDTO struct { // Широта. Latitude float32 `json:"latitude"` // Долгота. Longitude float32 `json:"longitude"` AdditionalProperties map[string]interface{} } type _GpsDTO GpsDTO // NewGpsDTO instantiates a new GpsDTO 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 NewGpsDTO(latitude float32, longitude float32) *GpsDTO { this := GpsDTO{} this.Latitude = latitude this.Longitude = longitude return &this } // NewGpsDTOWithDefaults instantiates a new GpsDTO 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 NewGpsDTOWithDefaults() *GpsDTO { this := GpsDTO{} return &this } // GetLatitude returns the Latitude field value func (o *GpsDTO) GetLatitude() float32 { if o == nil { var ret float32 return ret } return o.Latitude } // GetLatitudeOk returns a tuple with the Latitude field value // and a boolean to check if the value has been set. func (o *GpsDTO) GetLatitudeOk() (*float32, bool) { if o == nil { return nil, false } return &o.Latitude, true } // SetLatitude sets field value func (o *GpsDTO) SetLatitude(v float32) { o.Latitude = v } // GetLongitude returns the Longitude field value func (o *GpsDTO) GetLongitude() float32 { if o == nil { var ret float32 return ret } return o.Longitude } // GetLongitudeOk returns a tuple with the Longitude field value // and a boolean to check if the value has been set. func (o *GpsDTO) GetLongitudeOk() (*float32, bool) { if o == nil { return nil, false } return &o.Longitude, true } // SetLongitude sets field value func (o *GpsDTO) SetLongitude(v float32) { o.Longitude = v } func (o GpsDTO) MarshalJSON() ([]byte, error) { toSerialize, err := o.ToMap() if err != nil { return []byte{}, err } return json.Marshal(toSerialize) } func (o GpsDTO) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["latitude"] = o.Latitude toSerialize["longitude"] = o.Longitude for key, value := range o.AdditionalProperties { toSerialize[key] = value } return toSerialize, nil } func (o *GpsDTO) UnmarshalJSON(data []byte) (err error) { // This validates that all required properties are included in the JSON object // by unmarshalling the object into a generic map with string keys and checking // that every required field exists as a key in the generic map. requiredProperties := []string{ "latitude", "longitude", } allProperties := make(map[string]interface{}) err = json.Unmarshal(data, &allProperties) if err != nil { return err } for _, requiredProperty := range requiredProperties { if _, exists := allProperties[requiredProperty]; !exists { return fmt.Errorf("no value given for required property %v", requiredProperty) } } varGpsDTO := _GpsDTO{} err = json.Unmarshal(data, &varGpsDTO) if err != nil { return err } *o = GpsDTO(varGpsDTO) additionalProperties := make(map[string]interface{}) if err = json.Unmarshal(data, &additionalProperties); err == nil { delete(additionalProperties, "latitude") delete(additionalProperties, "longitude") o.AdditionalProperties = additionalProperties } return err } type NullableGpsDTO struct { value *GpsDTO isSet bool } func (v NullableGpsDTO) Get() *GpsDTO { return v.value } func (v *NullableGpsDTO) Set(val *GpsDTO) { v.value = val v.isSet = true } func (v NullableGpsDTO) IsSet() bool { return v.isSet } func (v *NullableGpsDTO) Unset() { v.value = nil v.isSet = false } func NewNullableGpsDTO(val *GpsDTO) *NullableGpsDTO { return &NullableGpsDTO{value: val, isSet: true} } func (v NullableGpsDTO) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } func (v *NullableGpsDTO) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) }