feat: shit shit
This commit is contained in:
192
pkg/api/yandex/ymclient/model_quantum_dto.go
Normal file
192
pkg/api/yandex/ymclient/model_quantum_dto.go
Normal file
@@ -0,0 +1,192 @@
|
||||
/*
|
||||
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 QuantumDTO type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &QuantumDTO{}
|
||||
|
||||
// QuantumDTO Настройка продажи квантами. Чтобы сбросить установленные ранее значения, передайте пустой параметр `quantum`. {% cut \"Пример\" %} ```json translate=no { \"offers\": [ { \"offerId\": \"08e35dc1-89a2-11e3-8055-0015e9b8c48d\", \"quantum\": {} } ] } ``` {% endcut %}
|
||||
type QuantumDTO struct {
|
||||
// Минимальное количество единиц товара в заказе. Например, если указать 10, покупатель сможет добавить в корзину не меньше 10 единиц. ⚠️ Если количество товара на складе меньше заданного, ограничение не сработает и покупатель сможет его заказать.
|
||||
MinQuantity *int32 `json:"minQuantity,omitempty"`
|
||||
// На сколько единиц покупатель сможет увеличить количество товара в корзине. Например, если задать 5, покупатель сможет добавить к заказу только 5, 10, 15, ... единиц товара. ⚠️ Если количество товара на складе не дотягивает до кванта, ограничение не сработает и покупатель сможет заказать количество, не кратное кванту.
|
||||
StepQuantity *int32 `json:"stepQuantity,omitempty"`
|
||||
AdditionalProperties map[string]interface{}
|
||||
}
|
||||
|
||||
type _QuantumDTO QuantumDTO
|
||||
|
||||
// NewQuantumDTO instantiates a new QuantumDTO 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 NewQuantumDTO() *QuantumDTO {
|
||||
this := QuantumDTO{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewQuantumDTOWithDefaults instantiates a new QuantumDTO 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 NewQuantumDTOWithDefaults() *QuantumDTO {
|
||||
this := QuantumDTO{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetMinQuantity returns the MinQuantity field value if set, zero value otherwise.
|
||||
func (o *QuantumDTO) GetMinQuantity() int32 {
|
||||
if o == nil || IsNil(o.MinQuantity) {
|
||||
var ret int32
|
||||
return ret
|
||||
}
|
||||
return *o.MinQuantity
|
||||
}
|
||||
|
||||
// GetMinQuantityOk returns a tuple with the MinQuantity field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *QuantumDTO) GetMinQuantityOk() (*int32, bool) {
|
||||
if o == nil || IsNil(o.MinQuantity) {
|
||||
return nil, false
|
||||
}
|
||||
return o.MinQuantity, true
|
||||
}
|
||||
|
||||
// HasMinQuantity returns a boolean if a field has been set.
|
||||
func (o *QuantumDTO) HasMinQuantity() bool {
|
||||
if o != nil && !IsNil(o.MinQuantity) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetMinQuantity gets a reference to the given int32 and assigns it to the MinQuantity field.
|
||||
func (o *QuantumDTO) SetMinQuantity(v int32) {
|
||||
o.MinQuantity = &v
|
||||
}
|
||||
|
||||
// GetStepQuantity returns the StepQuantity field value if set, zero value otherwise.
|
||||
func (o *QuantumDTO) GetStepQuantity() int32 {
|
||||
if o == nil || IsNil(o.StepQuantity) {
|
||||
var ret int32
|
||||
return ret
|
||||
}
|
||||
return *o.StepQuantity
|
||||
}
|
||||
|
||||
// GetStepQuantityOk returns a tuple with the StepQuantity field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *QuantumDTO) GetStepQuantityOk() (*int32, bool) {
|
||||
if o == nil || IsNil(o.StepQuantity) {
|
||||
return nil, false
|
||||
}
|
||||
return o.StepQuantity, true
|
||||
}
|
||||
|
||||
// HasStepQuantity returns a boolean if a field has been set.
|
||||
func (o *QuantumDTO) HasStepQuantity() bool {
|
||||
if o != nil && !IsNil(o.StepQuantity) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetStepQuantity gets a reference to the given int32 and assigns it to the StepQuantity field.
|
||||
func (o *QuantumDTO) SetStepQuantity(v int32) {
|
||||
o.StepQuantity = &v
|
||||
}
|
||||
|
||||
func (o QuantumDTO) MarshalJSON() ([]byte, error) {
|
||||
toSerialize, err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o QuantumDTO) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if !IsNil(o.MinQuantity) {
|
||||
toSerialize["minQuantity"] = o.MinQuantity
|
||||
}
|
||||
if !IsNil(o.StepQuantity) {
|
||||
toSerialize["stepQuantity"] = o.StepQuantity
|
||||
}
|
||||
|
||||
for key, value := range o.AdditionalProperties {
|
||||
toSerialize[key] = value
|
||||
}
|
||||
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
func (o *QuantumDTO) UnmarshalJSON(data []byte) (err error) {
|
||||
varQuantumDTO := _QuantumDTO{}
|
||||
|
||||
err = json.Unmarshal(data, &varQuantumDTO)
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
*o = QuantumDTO(varQuantumDTO)
|
||||
|
||||
additionalProperties := make(map[string]interface{})
|
||||
|
||||
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
||||
delete(additionalProperties, "minQuantity")
|
||||
delete(additionalProperties, "stepQuantity")
|
||||
o.AdditionalProperties = additionalProperties
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
type NullableQuantumDTO struct {
|
||||
value *QuantumDTO
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableQuantumDTO) Get() *QuantumDTO {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableQuantumDTO) Set(val *QuantumDTO) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableQuantumDTO) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableQuantumDTO) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableQuantumDTO(val *QuantumDTO) *NullableQuantumDTO {
|
||||
return &NullableQuantumDTO{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableQuantumDTO) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableQuantumDTO) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
Reference in New Issue
Block a user