/* 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 ModelDTO type satisfies the MappedNullable interface at compile time var _ MappedNullable = &ModelDTO{} // ModelDTO Модель товара. type ModelDTO struct { // Идентификатор модели товара. Id *int64 `json:"id,omitempty"` // Название модели товара. Name *string `json:"name,omitempty"` Prices *ModelPriceDTO `json:"prices,omitempty"` AdditionalProperties map[string]interface{} } type _ModelDTO ModelDTO // NewModelDTO instantiates a new ModelDTO 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 NewModelDTO() *ModelDTO { this := ModelDTO{} return &this } // NewModelDTOWithDefaults instantiates a new ModelDTO 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 NewModelDTOWithDefaults() *ModelDTO { this := ModelDTO{} return &this } // GetId returns the Id field value if set, zero value otherwise. func (o *ModelDTO) GetId() int64 { if o == nil || IsNil(o.Id) { var ret int64 return ret } return *o.Id } // GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ModelDTO) GetIdOk() (*int64, bool) { if o == nil || IsNil(o.Id) { return nil, false } return o.Id, true } // HasId returns a boolean if a field has been set. func (o *ModelDTO) HasId() bool { if o != nil && !IsNil(o.Id) { return true } return false } // SetId gets a reference to the given int64 and assigns it to the Id field. func (o *ModelDTO) SetId(v int64) { o.Id = &v } // GetName returns the Name field value if set, zero value otherwise. func (o *ModelDTO) GetName() string { if o == nil || IsNil(o.Name) { var ret string return ret } return *o.Name } // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ModelDTO) GetNameOk() (*string, bool) { if o == nil || IsNil(o.Name) { return nil, false } return o.Name, true } // HasName returns a boolean if a field has been set. func (o *ModelDTO) HasName() bool { if o != nil && !IsNil(o.Name) { return true } return false } // SetName gets a reference to the given string and assigns it to the Name field. func (o *ModelDTO) SetName(v string) { o.Name = &v } // GetPrices returns the Prices field value if set, zero value otherwise. func (o *ModelDTO) GetPrices() ModelPriceDTO { if o == nil || IsNil(o.Prices) { var ret ModelPriceDTO return ret } return *o.Prices } // GetPricesOk returns a tuple with the Prices field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ModelDTO) GetPricesOk() (*ModelPriceDTO, bool) { if o == nil || IsNil(o.Prices) { return nil, false } return o.Prices, true } // HasPrices returns a boolean if a field has been set. func (o *ModelDTO) HasPrices() bool { if o != nil && !IsNil(o.Prices) { return true } return false } // SetPrices gets a reference to the given ModelPriceDTO and assigns it to the Prices field. func (o *ModelDTO) SetPrices(v ModelPriceDTO) { o.Prices = &v } func (o ModelDTO) MarshalJSON() ([]byte, error) { toSerialize, err := o.ToMap() if err != nil { return []byte{}, err } return json.Marshal(toSerialize) } func (o ModelDTO) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if !IsNil(o.Id) { toSerialize["id"] = o.Id } if !IsNil(o.Name) { toSerialize["name"] = o.Name } if !IsNil(o.Prices) { toSerialize["prices"] = o.Prices } for key, value := range o.AdditionalProperties { toSerialize[key] = value } return toSerialize, nil } func (o *ModelDTO) UnmarshalJSON(data []byte) (err error) { varModelDTO := _ModelDTO{} err = json.Unmarshal(data, &varModelDTO) if err != nil { return err } *o = ModelDTO(varModelDTO) additionalProperties := make(map[string]interface{}) if err = json.Unmarshal(data, &additionalProperties); err == nil { delete(additionalProperties, "id") delete(additionalProperties, "name") delete(additionalProperties, "prices") o.AdditionalProperties = additionalProperties } return err } type NullableModelDTO struct { value *ModelDTO isSet bool } func (v NullableModelDTO) Get() *ModelDTO { return v.value } func (v *NullableModelDTO) Set(val *ModelDTO) { v.value = val v.isSet = true } func (v NullableModelDTO) IsSet() bool { return v.isSet } func (v *NullableModelDTO) Unset() { v.value = nil v.isSet = false } func NewNullableModelDTO(val *ModelDTO) *NullableModelDTO { return &NullableModelDTO{value: val, isSet: true} } func (v NullableModelDTO) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } func (v *NullableModelDTO) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) }