Files
Sipro-Marketplaces/pkg/api/yandex/ymclient/model_uin_dto.go
2025-08-15 11:10:28 +03:00

197 lines
4.7 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
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 UinDTO type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &UinDTO{}
// UinDTO Статус проверки УИНа.
type UinDTO struct {
// УИН товара.
Value string `json:"value"`
Status UinStatusType `json:"status"`
AdditionalProperties map[string]interface{}
}
type _UinDTO UinDTO
// NewUinDTO instantiates a new UinDTO 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 NewUinDTO(value string, status UinStatusType) *UinDTO {
this := UinDTO{}
this.Value = value
this.Status = status
return &this
}
// NewUinDTOWithDefaults instantiates a new UinDTO 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 NewUinDTOWithDefaults() *UinDTO {
this := UinDTO{}
return &this
}
// GetValue returns the Value field value
func (o *UinDTO) GetValue() string {
if o == nil {
var ret string
return ret
}
return o.Value
}
// GetValueOk returns a tuple with the Value field value
// and a boolean to check if the value has been set.
func (o *UinDTO) GetValueOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Value, true
}
// SetValue sets field value
func (o *UinDTO) SetValue(v string) {
o.Value = v
}
// GetStatus returns the Status field value
func (o *UinDTO) GetStatus() UinStatusType {
if o == nil {
var ret UinStatusType
return ret
}
return o.Status
}
// GetStatusOk returns a tuple with the Status field value
// and a boolean to check if the value has been set.
func (o *UinDTO) GetStatusOk() (*UinStatusType, bool) {
if o == nil {
return nil, false
}
return &o.Status, true
}
// SetStatus sets field value
func (o *UinDTO) SetStatus(v UinStatusType) {
o.Status = v
}
func (o UinDTO) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o UinDTO) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["value"] = o.Value
toSerialize["status"] = o.Status
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *UinDTO) 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{
"value",
"status",
}
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)
}
}
varUinDTO := _UinDTO{}
err = json.Unmarshal(data, &varUinDTO)
if err != nil {
return err
}
*o = UinDTO(varUinDTO)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "value")
delete(additionalProperties, "status")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableUinDTO struct {
value *UinDTO
isSet bool
}
func (v NullableUinDTO) Get() *UinDTO {
return v.value
}
func (v *NullableUinDTO) Set(val *UinDTO) {
v.value = val
v.isSet = true
}
func (v NullableUinDTO) IsSet() bool {
return v.isSet
}
func (v *NullableUinDTO) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableUinDTO(val *UinDTO) *NullableUinDTO {
return &NullableUinDTO{value: val, isSet: true}
}
func (v NullableUinDTO) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableUinDTO) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}