feat: shit shit
This commit is contained in:
297
pkg/api/yandex/ymclient/model_tariff_dto.go
Normal file
297
pkg/api/yandex/ymclient/model_tariff_dto.go
Normal file
@@ -0,0 +1,297 @@
|
||||
/*
|
||||
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 TariffDTO type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &TariffDTO{}
|
||||
|
||||
// TariffDTO Информация о тарифах, по которым нужно заплатить за услуги Маркета.
|
||||
type TariffDTO struct {
|
||||
Type TariffType `json:"type"`
|
||||
// Значение тарифа в процентах.
|
||||
// Deprecated
|
||||
Percent *float32 `json:"percent,omitempty"`
|
||||
// Значение тарифа.
|
||||
Amount float32 `json:"amount"`
|
||||
Currency CurrencyType `json:"currency"`
|
||||
// Параметры расчета тарифа.
|
||||
Parameters []TariffParameterDTO `json:"parameters"`
|
||||
AdditionalProperties map[string]interface{}
|
||||
}
|
||||
|
||||
type _TariffDTO TariffDTO
|
||||
|
||||
// NewTariffDTO instantiates a new TariffDTO 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 NewTariffDTO(type_ TariffType, amount float32, currency CurrencyType, parameters []TariffParameterDTO) *TariffDTO {
|
||||
this := TariffDTO{}
|
||||
this.Type = type_
|
||||
this.Amount = amount
|
||||
this.Currency = currency
|
||||
this.Parameters = parameters
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewTariffDTOWithDefaults instantiates a new TariffDTO 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 NewTariffDTOWithDefaults() *TariffDTO {
|
||||
this := TariffDTO{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetType returns the Type field value
|
||||
func (o *TariffDTO) GetType() TariffType {
|
||||
if o == nil {
|
||||
var ret TariffType
|
||||
return ret
|
||||
}
|
||||
|
||||
return o.Type
|
||||
}
|
||||
|
||||
// GetTypeOk returns a tuple with the Type field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *TariffDTO) GetTypeOk() (*TariffType, bool) {
|
||||
if o == nil {
|
||||
return nil, false
|
||||
}
|
||||
return &o.Type, true
|
||||
}
|
||||
|
||||
// SetType sets field value
|
||||
func (o *TariffDTO) SetType(v TariffType) {
|
||||
o.Type = v
|
||||
}
|
||||
|
||||
// GetPercent returns the Percent field value if set, zero value otherwise.
|
||||
// Deprecated
|
||||
func (o *TariffDTO) GetPercent() float32 {
|
||||
if o == nil || IsNil(o.Percent) {
|
||||
var ret float32
|
||||
return ret
|
||||
}
|
||||
return *o.Percent
|
||||
}
|
||||
|
||||
// GetPercentOk returns a tuple with the Percent field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
// Deprecated
|
||||
func (o *TariffDTO) GetPercentOk() (*float32, bool) {
|
||||
if o == nil || IsNil(o.Percent) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Percent, true
|
||||
}
|
||||
|
||||
// HasPercent returns a boolean if a field has been set.
|
||||
func (o *TariffDTO) HasPercent() bool {
|
||||
if o != nil && !IsNil(o.Percent) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetPercent gets a reference to the given float32 and assigns it to the Percent field.
|
||||
// Deprecated
|
||||
func (o *TariffDTO) SetPercent(v float32) {
|
||||
o.Percent = &v
|
||||
}
|
||||
|
||||
// GetAmount returns the Amount field value
|
||||
func (o *TariffDTO) GetAmount() float32 {
|
||||
if o == nil {
|
||||
var ret float32
|
||||
return ret
|
||||
}
|
||||
|
||||
return o.Amount
|
||||
}
|
||||
|
||||
// GetAmountOk returns a tuple with the Amount field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *TariffDTO) GetAmountOk() (*float32, bool) {
|
||||
if o == nil {
|
||||
return nil, false
|
||||
}
|
||||
return &o.Amount, true
|
||||
}
|
||||
|
||||
// SetAmount sets field value
|
||||
func (o *TariffDTO) SetAmount(v float32) {
|
||||
o.Amount = v
|
||||
}
|
||||
|
||||
// GetCurrency returns the Currency field value
|
||||
func (o *TariffDTO) GetCurrency() CurrencyType {
|
||||
if o == nil {
|
||||
var ret CurrencyType
|
||||
return ret
|
||||
}
|
||||
|
||||
return o.Currency
|
||||
}
|
||||
|
||||
// GetCurrencyOk returns a tuple with the Currency field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *TariffDTO) GetCurrencyOk() (*CurrencyType, bool) {
|
||||
if o == nil {
|
||||
return nil, false
|
||||
}
|
||||
return &o.Currency, true
|
||||
}
|
||||
|
||||
// SetCurrency sets field value
|
||||
func (o *TariffDTO) SetCurrency(v CurrencyType) {
|
||||
o.Currency = v
|
||||
}
|
||||
|
||||
// GetParameters returns the Parameters field value
|
||||
func (o *TariffDTO) GetParameters() []TariffParameterDTO {
|
||||
if o == nil {
|
||||
var ret []TariffParameterDTO
|
||||
return ret
|
||||
}
|
||||
|
||||
return o.Parameters
|
||||
}
|
||||
|
||||
// GetParametersOk returns a tuple with the Parameters field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *TariffDTO) GetParametersOk() ([]TariffParameterDTO, bool) {
|
||||
if o == nil {
|
||||
return nil, false
|
||||
}
|
||||
return o.Parameters, true
|
||||
}
|
||||
|
||||
// SetParameters sets field value
|
||||
func (o *TariffDTO) SetParameters(v []TariffParameterDTO) {
|
||||
o.Parameters = v
|
||||
}
|
||||
|
||||
func (o TariffDTO) MarshalJSON() ([]byte, error) {
|
||||
toSerialize, err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o TariffDTO) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
toSerialize["type"] = o.Type
|
||||
if !IsNil(o.Percent) {
|
||||
toSerialize["percent"] = o.Percent
|
||||
}
|
||||
toSerialize["amount"] = o.Amount
|
||||
toSerialize["currency"] = o.Currency
|
||||
toSerialize["parameters"] = o.Parameters
|
||||
|
||||
for key, value := range o.AdditionalProperties {
|
||||
toSerialize[key] = value
|
||||
}
|
||||
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
func (o *TariffDTO) 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{
|
||||
"type",
|
||||
"amount",
|
||||
"currency",
|
||||
"parameters",
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
||||
varTariffDTO := _TariffDTO{}
|
||||
|
||||
err = json.Unmarshal(data, &varTariffDTO)
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
*o = TariffDTO(varTariffDTO)
|
||||
|
||||
additionalProperties := make(map[string]interface{})
|
||||
|
||||
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
||||
delete(additionalProperties, "type")
|
||||
delete(additionalProperties, "percent")
|
||||
delete(additionalProperties, "amount")
|
||||
delete(additionalProperties, "currency")
|
||||
delete(additionalProperties, "parameters")
|
||||
o.AdditionalProperties = additionalProperties
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
type NullableTariffDTO struct {
|
||||
value *TariffDTO
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableTariffDTO) Get() *TariffDTO {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableTariffDTO) Set(val *TariffDTO) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableTariffDTO) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableTariffDTO) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableTariffDTO(val *TariffDTO) *NullableTariffDTO {
|
||||
return &NullableTariffDTO{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableTariffDTO) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableTariffDTO) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
Reference in New Issue
Block a user