168 lines
		
	
	
		
			4.4 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			168 lines
		
	
	
		
			4.4 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
/*
 | 
						||
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 SignatureDTO type satisfies the MappedNullable interface at compile time
 | 
						||
var _ MappedNullable = &SignatureDTO{}
 | 
						||
 | 
						||
// SignatureDTO Информация о подписи акта приема-передачи.
 | 
						||
type SignatureDTO struct {
 | 
						||
	// Подписан ли акт приема-передачи.
 | 
						||
	Signed               bool `json:"signed"`
 | 
						||
	AdditionalProperties map[string]interface{}
 | 
						||
}
 | 
						||
 | 
						||
type _SignatureDTO SignatureDTO
 | 
						||
 | 
						||
// NewSignatureDTO instantiates a new SignatureDTO 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 NewSignatureDTO(signed bool) *SignatureDTO {
 | 
						||
	this := SignatureDTO{}
 | 
						||
	this.Signed = signed
 | 
						||
	return &this
 | 
						||
}
 | 
						||
 | 
						||
// NewSignatureDTOWithDefaults instantiates a new SignatureDTO 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 NewSignatureDTOWithDefaults() *SignatureDTO {
 | 
						||
	this := SignatureDTO{}
 | 
						||
	return &this
 | 
						||
}
 | 
						||
 | 
						||
// GetSigned returns the Signed field value
 | 
						||
func (o *SignatureDTO) GetSigned() bool {
 | 
						||
	if o == nil {
 | 
						||
		var ret bool
 | 
						||
		return ret
 | 
						||
	}
 | 
						||
 | 
						||
	return o.Signed
 | 
						||
}
 | 
						||
 | 
						||
// GetSignedOk returns a tuple with the Signed field value
 | 
						||
// and a boolean to check if the value has been set.
 | 
						||
func (o *SignatureDTO) GetSignedOk() (*bool, bool) {
 | 
						||
	if o == nil {
 | 
						||
		return nil, false
 | 
						||
	}
 | 
						||
	return &o.Signed, true
 | 
						||
}
 | 
						||
 | 
						||
// SetSigned sets field value
 | 
						||
func (o *SignatureDTO) SetSigned(v bool) {
 | 
						||
	o.Signed = v
 | 
						||
}
 | 
						||
 | 
						||
func (o SignatureDTO) MarshalJSON() ([]byte, error) {
 | 
						||
	toSerialize, err := o.ToMap()
 | 
						||
	if err != nil {
 | 
						||
		return []byte{}, err
 | 
						||
	}
 | 
						||
	return json.Marshal(toSerialize)
 | 
						||
}
 | 
						||
 | 
						||
func (o SignatureDTO) ToMap() (map[string]interface{}, error) {
 | 
						||
	toSerialize := map[string]interface{}{}
 | 
						||
	toSerialize["signed"] = o.Signed
 | 
						||
 | 
						||
	for key, value := range o.AdditionalProperties {
 | 
						||
		toSerialize[key] = value
 | 
						||
	}
 | 
						||
 | 
						||
	return toSerialize, nil
 | 
						||
}
 | 
						||
 | 
						||
func (o *SignatureDTO) 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{
 | 
						||
		"signed",
 | 
						||
	}
 | 
						||
 | 
						||
	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)
 | 
						||
		}
 | 
						||
	}
 | 
						||
 | 
						||
	varSignatureDTO := _SignatureDTO{}
 | 
						||
 | 
						||
	err = json.Unmarshal(data, &varSignatureDTO)
 | 
						||
 | 
						||
	if err != nil {
 | 
						||
		return err
 | 
						||
	}
 | 
						||
 | 
						||
	*o = SignatureDTO(varSignatureDTO)
 | 
						||
 | 
						||
	additionalProperties := make(map[string]interface{})
 | 
						||
 | 
						||
	if err = json.Unmarshal(data, &additionalProperties); err == nil {
 | 
						||
		delete(additionalProperties, "signed")
 | 
						||
		o.AdditionalProperties = additionalProperties
 | 
						||
	}
 | 
						||
 | 
						||
	return err
 | 
						||
}
 | 
						||
 | 
						||
type NullableSignatureDTO struct {
 | 
						||
	value *SignatureDTO
 | 
						||
	isSet bool
 | 
						||
}
 | 
						||
 | 
						||
func (v NullableSignatureDTO) Get() *SignatureDTO {
 | 
						||
	return v.value
 | 
						||
}
 | 
						||
 | 
						||
func (v *NullableSignatureDTO) Set(val *SignatureDTO) {
 | 
						||
	v.value = val
 | 
						||
	v.isSet = true
 | 
						||
}
 | 
						||
 | 
						||
func (v NullableSignatureDTO) IsSet() bool {
 | 
						||
	return v.isSet
 | 
						||
}
 | 
						||
 | 
						||
func (v *NullableSignatureDTO) Unset() {
 | 
						||
	v.value = nil
 | 
						||
	v.isSet = false
 | 
						||
}
 | 
						||
 | 
						||
func NewNullableSignatureDTO(val *SignatureDTO) *NullableSignatureDTO {
 | 
						||
	return &NullableSignatureDTO{value: val, isSet: true}
 | 
						||
}
 | 
						||
 | 
						||
func (v NullableSignatureDTO) MarshalJSON() ([]byte, error) {
 | 
						||
	return json.Marshal(v.value)
 | 
						||
}
 | 
						||
 | 
						||
func (v *NullableSignatureDTO) UnmarshalJSON(src []byte) error {
 | 
						||
	v.isSet = true
 | 
						||
	return json.Unmarshal(src, &v.value)
 | 
						||
}
 |