/* API Яндекс Маркета для продавцов API Яндекс Маркета помогает продавцам автоматизировать и упростить работу с маркетплейсом. В числе возможностей интеграции: * управление каталогом товаров и витриной, * обработка заказов, * изменение настроек магазина, * получение отчетов. API version: LATEST */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package ymclient import ( "encoding/json" ) // checks if the TrackDTO type satisfies the MappedNullable interface at compile time var _ MappedNullable = &TrackDTO{} // TrackDTO Информация о трек-номерах. type TrackDTO struct { // Трек-код почтового отправления. TrackCode *string `json:"trackCode,omitempty"` AdditionalProperties map[string]interface{} } type _TrackDTO TrackDTO // NewTrackDTO instantiates a new TrackDTO 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 NewTrackDTO() *TrackDTO { this := TrackDTO{} return &this } // NewTrackDTOWithDefaults instantiates a new TrackDTO 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 NewTrackDTOWithDefaults() *TrackDTO { this := TrackDTO{} return &this } // GetTrackCode returns the TrackCode field value if set, zero value otherwise. func (o *TrackDTO) GetTrackCode() string { if o == nil || IsNil(o.TrackCode) { var ret string return ret } return *o.TrackCode } // GetTrackCodeOk returns a tuple with the TrackCode field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *TrackDTO) GetTrackCodeOk() (*string, bool) { if o == nil || IsNil(o.TrackCode) { return nil, false } return o.TrackCode, true } // HasTrackCode returns a boolean if a field has been set. func (o *TrackDTO) HasTrackCode() bool { if o != nil && !IsNil(o.TrackCode) { return true } return false } // SetTrackCode gets a reference to the given string and assigns it to the TrackCode field. func (o *TrackDTO) SetTrackCode(v string) { o.TrackCode = &v } func (o TrackDTO) MarshalJSON() ([]byte, error) { toSerialize, err := o.ToMap() if err != nil { return []byte{}, err } return json.Marshal(toSerialize) } func (o TrackDTO) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if !IsNil(o.TrackCode) { toSerialize["trackCode"] = o.TrackCode } for key, value := range o.AdditionalProperties { toSerialize[key] = value } return toSerialize, nil } func (o *TrackDTO) UnmarshalJSON(data []byte) (err error) { varTrackDTO := _TrackDTO{} err = json.Unmarshal(data, &varTrackDTO) if err != nil { return err } *o = TrackDTO(varTrackDTO) additionalProperties := make(map[string]interface{}) if err = json.Unmarshal(data, &additionalProperties); err == nil { delete(additionalProperties, "trackCode") o.AdditionalProperties = additionalProperties } return err } type NullableTrackDTO struct { value *TrackDTO isSet bool } func (v NullableTrackDTO) Get() *TrackDTO { return v.value } func (v *NullableTrackDTO) Set(val *TrackDTO) { v.value = val v.isSet = true } func (v NullableTrackDTO) IsSet() bool { return v.isSet } func (v *NullableTrackDTO) Unset() { v.value = nil v.isSet = false } func NewNullableTrackDTO(val *TrackDTO) *NullableTrackDTO { return &NullableTrackDTO{value: val, isSet: true} } func (v NullableTrackDTO) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } func (v *NullableTrackDTO) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) }