// Code generated by thriftgo (0.3.18). DO NOT EDIT.

package openapi

import (
	"bytes"
	"fmt"
	thrift "github.com/cloudwego/kitex/pkg/protocol/bthrift/apache"
	"strings"
)

type __ServiceOptions struct {
	Document *Document `thrift:"document,1,required" frugal:"1,required,Document" json:"document"`
}

func New__ServiceOptions() *__ServiceOptions {
	return &__ServiceOptions{}
}

func (p *__ServiceOptions) InitDefault() {
}

var __ServiceOptions_Document_DEFAULT *Document

func (p *__ServiceOptions) GetDocument() (v *Document) {
	if !p.IsSetDocument() {
		return __ServiceOptions_Document_DEFAULT
	}
	return p.Document
}
func (p *__ServiceOptions) SetDocument(val *Document) {
	p.Document = val
}

var fieldIDToName___ServiceOptions = map[int16]string{
	1: "document",
}

func (p *__ServiceOptions) IsSetDocument() bool {
	return p.Document != nil
}

func (p *__ServiceOptions) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16
	var issetDocument bool = false

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
				issetDocument = true
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}
		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	if !issetDocument {
		fieldId = 1
		goto RequiredFieldNotSetError
	}
	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName___ServiceOptions[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
RequiredFieldNotSetError:
	return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName___ServiceOptions[fieldId]))
}

func (p *__ServiceOptions) ReadField1(iprot thrift.TProtocol) error {
	_field := NewDocument()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Document = _field
	return nil
}

func (p *__ServiceOptions) Write(oprot thrift.TProtocol) (err error) {

	var fieldId int16
	if err = oprot.WriteStructBegin("_ServiceOptions"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *__ServiceOptions) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("document", thrift.STRUCT, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Document.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *__ServiceOptions) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("__ServiceOptions(%+v)", *p)

}

func (p *__ServiceOptions) DeepEqual(ano *__ServiceOptions) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.Document) {
		return false
	}
	return true
}

func (p *__ServiceOptions) Field1DeepEqual(src *Document) bool {

	if !p.Document.DeepEqual(src) {
		return false
	}
	return true
}

type __StructOptions struct {
	Schema *Schema `thrift:"schema,1,required" frugal:"1,required,Schema" json:"schema"`
}

func New__StructOptions() *__StructOptions {
	return &__StructOptions{}
}

func (p *__StructOptions) InitDefault() {
}

var __StructOptions_Schema_DEFAULT *Schema

func (p *__StructOptions) GetSchema() (v *Schema) {
	if !p.IsSetSchema() {
		return __StructOptions_Schema_DEFAULT
	}
	return p.Schema
}
func (p *__StructOptions) SetSchema(val *Schema) {
	p.Schema = val
}

var fieldIDToName___StructOptions = map[int16]string{
	1: "schema",
}

func (p *__StructOptions) IsSetSchema() bool {
	return p.Schema != nil
}

func (p *__StructOptions) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16
	var issetSchema bool = false

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
				issetSchema = true
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}
		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	if !issetSchema {
		fieldId = 1
		goto RequiredFieldNotSetError
	}
	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName___StructOptions[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
RequiredFieldNotSetError:
	return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName___StructOptions[fieldId]))
}

func (p *__StructOptions) ReadField1(iprot thrift.TProtocol) error {
	_field := NewSchema()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Schema = _field
	return nil
}

func (p *__StructOptions) Write(oprot thrift.TProtocol) (err error) {

	var fieldId int16
	if err = oprot.WriteStructBegin("_StructOptions"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *__StructOptions) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("schema", thrift.STRUCT, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Schema.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *__StructOptions) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("__StructOptions(%+v)", *p)

}

func (p *__StructOptions) DeepEqual(ano *__StructOptions) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.Schema) {
		return false
	}
	return true
}

func (p *__StructOptions) Field1DeepEqual(src *Schema) bool {

	if !p.Schema.DeepEqual(src) {
		return false
	}
	return true
}

type __MethodOptions struct {
	Operation *Operation `thrift:"operation,1,required" frugal:"1,required,Operation" json:"operation"`
}

func New__MethodOptions() *__MethodOptions {
	return &__MethodOptions{}
}

func (p *__MethodOptions) InitDefault() {
}

var __MethodOptions_Operation_DEFAULT *Operation

func (p *__MethodOptions) GetOperation() (v *Operation) {
	if !p.IsSetOperation() {
		return __MethodOptions_Operation_DEFAULT
	}
	return p.Operation
}
func (p *__MethodOptions) SetOperation(val *Operation) {
	p.Operation = val
}

var fieldIDToName___MethodOptions = map[int16]string{
	1: "operation",
}

func (p *__MethodOptions) IsSetOperation() bool {
	return p.Operation != nil
}

func (p *__MethodOptions) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16
	var issetOperation bool = false

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
				issetOperation = true
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}
		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	if !issetOperation {
		fieldId = 1
		goto RequiredFieldNotSetError
	}
	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName___MethodOptions[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
RequiredFieldNotSetError:
	return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName___MethodOptions[fieldId]))
}

func (p *__MethodOptions) ReadField1(iprot thrift.TProtocol) error {
	_field := NewOperation()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Operation = _field
	return nil
}

func (p *__MethodOptions) Write(oprot thrift.TProtocol) (err error) {

	var fieldId int16
	if err = oprot.WriteStructBegin("_MethodOptions"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *__MethodOptions) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("operation", thrift.STRUCT, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Operation.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *__MethodOptions) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("__MethodOptions(%+v)", *p)

}

func (p *__MethodOptions) DeepEqual(ano *__MethodOptions) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.Operation) {
		return false
	}
	return true
}

func (p *__MethodOptions) Field1DeepEqual(src *Operation) bool {

	if !p.Operation.DeepEqual(src) {
		return false
	}
	return true
}

type __FieldOptions struct {
	Parameter *Parameter `thrift:"parameter,1,required" frugal:"1,required,Parameter" json:"parameter"`
	Property  *Schema    `thrift:"property,2,required" frugal:"2,required,Schema" json:"property"`
}

func New__FieldOptions() *__FieldOptions {
	return &__FieldOptions{}
}

func (p *__FieldOptions) InitDefault() {
}

var __FieldOptions_Parameter_DEFAULT *Parameter

func (p *__FieldOptions) GetParameter() (v *Parameter) {
	if !p.IsSetParameter() {
		return __FieldOptions_Parameter_DEFAULT
	}
	return p.Parameter
}

var __FieldOptions_Property_DEFAULT *Schema

func (p *__FieldOptions) GetProperty() (v *Schema) {
	if !p.IsSetProperty() {
		return __FieldOptions_Property_DEFAULT
	}
	return p.Property
}
func (p *__FieldOptions) SetParameter(val *Parameter) {
	p.Parameter = val
}
func (p *__FieldOptions) SetProperty(val *Schema) {
	p.Property = val
}

var fieldIDToName___FieldOptions = map[int16]string{
	1: "parameter",
	2: "property",
}

func (p *__FieldOptions) IsSetParameter() bool {
	return p.Parameter != nil
}

func (p *__FieldOptions) IsSetProperty() bool {
	return p.Property != nil
}

func (p *__FieldOptions) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16
	var issetParameter bool = false
	var issetProperty bool = false

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
				issetParameter = true
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 2:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField2(iprot); err != nil {
					goto ReadFieldError
				}
				issetProperty = true
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}
		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	if !issetParameter {
		fieldId = 1
		goto RequiredFieldNotSetError
	}

	if !issetProperty {
		fieldId = 2
		goto RequiredFieldNotSetError
	}
	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName___FieldOptions[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
RequiredFieldNotSetError:
	return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName___FieldOptions[fieldId]))
}

func (p *__FieldOptions) ReadField1(iprot thrift.TProtocol) error {
	_field := NewParameter()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Parameter = _field
	return nil
}
func (p *__FieldOptions) ReadField2(iprot thrift.TProtocol) error {
	_field := NewSchema()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Property = _field
	return nil
}

func (p *__FieldOptions) Write(oprot thrift.TProtocol) (err error) {

	var fieldId int16
	if err = oprot.WriteStructBegin("_FieldOptions"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
		if err = p.writeField2(oprot); err != nil {
			fieldId = 2
			goto WriteFieldError
		}
	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *__FieldOptions) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("parameter", thrift.STRUCT, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Parameter.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *__FieldOptions) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("property", thrift.STRUCT, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Property.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err)
}

func (p *__FieldOptions) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("__FieldOptions(%+v)", *p)

}

func (p *__FieldOptions) DeepEqual(ano *__FieldOptions) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.Parameter) {
		return false
	}
	if !p.Field2DeepEqual(ano.Property) {
		return false
	}
	return true
}

func (p *__FieldOptions) Field1DeepEqual(src *Parameter) bool {

	if !p.Parameter.DeepEqual(src) {
		return false
	}
	return true
}
func (p *__FieldOptions) Field2DeepEqual(src *Schema) bool {

	if !p.Property.DeepEqual(src) {
		return false
	}
	return true
}

type AdditionalPropertiesItem struct {
	SchemaOrReference *SchemaOrReference `thrift:"schema_or_reference,1" frugal:"1,default,SchemaOrReference" json:"schema_or_reference"`
	Boolean           bool               `thrift:"boolean,2" frugal:"2,default,bool" json:"boolean"`
}

func NewAdditionalPropertiesItem() *AdditionalPropertiesItem {
	return &AdditionalPropertiesItem{}
}

func (p *AdditionalPropertiesItem) InitDefault() {
}

var AdditionalPropertiesItem_SchemaOrReference_DEFAULT *SchemaOrReference

func (p *AdditionalPropertiesItem) GetSchemaOrReference() (v *SchemaOrReference) {
	if !p.IsSetSchemaOrReference() {
		return AdditionalPropertiesItem_SchemaOrReference_DEFAULT
	}
	return p.SchemaOrReference
}

func (p *AdditionalPropertiesItem) GetBoolean() (v bool) {
	return p.Boolean
}
func (p *AdditionalPropertiesItem) SetSchemaOrReference(val *SchemaOrReference) {
	p.SchemaOrReference = val
}
func (p *AdditionalPropertiesItem) SetBoolean(val bool) {
	p.Boolean = val
}

var fieldIDToName_AdditionalPropertiesItem = map[int16]string{
	1: "schema_or_reference",
	2: "boolean",
}

func (p *AdditionalPropertiesItem) IsSetSchemaOrReference() bool {
	return p.SchemaOrReference != nil
}

func (p *AdditionalPropertiesItem) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 2:
			if fieldTypeId == thrift.BOOL {
				if err = p.ReadField2(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}
		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_AdditionalPropertiesItem[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *AdditionalPropertiesItem) ReadField1(iprot thrift.TProtocol) error {
	_field := NewSchemaOrReference()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.SchemaOrReference = _field
	return nil
}
func (p *AdditionalPropertiesItem) ReadField2(iprot thrift.TProtocol) error {

	var _field bool
	if v, err := iprot.ReadBool(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Boolean = _field
	return nil
}

func (p *AdditionalPropertiesItem) Write(oprot thrift.TProtocol) (err error) {

	var fieldId int16
	if err = oprot.WriteStructBegin("AdditionalPropertiesItem"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
		if err = p.writeField2(oprot); err != nil {
			fieldId = 2
			goto WriteFieldError
		}
	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *AdditionalPropertiesItem) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("schema_or_reference", thrift.STRUCT, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.SchemaOrReference.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *AdditionalPropertiesItem) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("boolean", thrift.BOOL, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteBool(p.Boolean); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err)
}

func (p *AdditionalPropertiesItem) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("AdditionalPropertiesItem(%+v)", *p)

}

func (p *AdditionalPropertiesItem) DeepEqual(ano *AdditionalPropertiesItem) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.SchemaOrReference) {
		return false
	}
	if !p.Field2DeepEqual(ano.Boolean) {
		return false
	}
	return true
}

func (p *AdditionalPropertiesItem) Field1DeepEqual(src *SchemaOrReference) bool {

	if !p.SchemaOrReference.DeepEqual(src) {
		return false
	}
	return true
}
func (p *AdditionalPropertiesItem) Field2DeepEqual(src bool) bool {

	if p.Boolean != src {
		return false
	}
	return true
}

type Any struct {
	Value *__Any `thrift:"value,1" frugal:"1,default,__Any" json:"value"`
	Yaml  string `thrift:"yaml,2" frugal:"2,default,string" json:"yaml"`
}

func NewAny() *Any {
	return &Any{}
}

func (p *Any) InitDefault() {
}

var Any_Value_DEFAULT *__Any

func (p *Any) GetValue() (v *__Any) {
	if !p.IsSetValue() {
		return Any_Value_DEFAULT
	}
	return p.Value
}

func (p *Any) GetYaml() (v string) {
	return p.Yaml
}
func (p *Any) SetValue(val *__Any) {
	p.Value = val
}
func (p *Any) SetYaml(val string) {
	p.Yaml = val
}

var fieldIDToName_Any = map[int16]string{
	1: "value",
	2: "yaml",
}

func (p *Any) IsSetValue() bool {
	return p.Value != nil
}

func (p *Any) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 2:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField2(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}
		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_Any[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *Any) ReadField1(iprot thrift.TProtocol) error {
	_field := New__Any()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Value = _field
	return nil
}
func (p *Any) ReadField2(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Yaml = _field
	return nil
}

func (p *Any) Write(oprot thrift.TProtocol) (err error) {

	var fieldId int16
	if err = oprot.WriteStructBegin("Any"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
		if err = p.writeField2(oprot); err != nil {
			fieldId = 2
			goto WriteFieldError
		}
	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *Any) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("value", thrift.STRUCT, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Value.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *Any) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("yaml", thrift.STRING, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.Yaml); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err)
}

func (p *Any) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("Any(%+v)", *p)

}

func (p *Any) DeepEqual(ano *Any) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.Value) {
		return false
	}
	if !p.Field2DeepEqual(ano.Yaml) {
		return false
	}
	return true
}

func (p *Any) Field1DeepEqual(src *__Any) bool {

	if !p.Value.DeepEqual(src) {
		return false
	}
	return true
}
func (p *Any) Field2DeepEqual(src string) bool {

	if strings.Compare(p.Yaml, src) != 0 {
		return false
	}
	return true
}

type __Any struct {
	TypeUrl string `thrift:"type_url,1" frugal:"1,default,string" json:"type_url"`
	Value   []byte `thrift:"value,2" frugal:"2,default,binary" json:"value"`
}

func New__Any() *__Any {
	return &__Any{}
}

func (p *__Any) InitDefault() {
}

func (p *__Any) GetTypeUrl() (v string) {
	return p.TypeUrl
}

func (p *__Any) GetValue() (v []byte) {
	return p.Value
}
func (p *__Any) SetTypeUrl(val string) {
	p.TypeUrl = val
}
func (p *__Any) SetValue(val []byte) {
	p.Value = val
}

var fieldIDToName___Any = map[int16]string{
	1: "type_url",
	2: "value",
}

func (p *__Any) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 2:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField2(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}
		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName___Any[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *__Any) ReadField1(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p.TypeUrl = _field
	return nil
}
func (p *__Any) ReadField2(iprot thrift.TProtocol) error {

	var _field []byte
	if v, err := iprot.ReadBinary(); err != nil {
		return err
	} else {
		_field = []byte(v)
	}
	p.Value = _field
	return nil
}

func (p *__Any) Write(oprot thrift.TProtocol) (err error) {

	var fieldId int16
	if err = oprot.WriteStructBegin("_Any"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
		if err = p.writeField2(oprot); err != nil {
			fieldId = 2
			goto WriteFieldError
		}
	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *__Any) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("type_url", thrift.STRING, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.TypeUrl); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *__Any) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("value", thrift.STRING, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteBinary([]byte(p.Value)); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err)
}

func (p *__Any) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("__Any(%+v)", *p)

}

func (p *__Any) DeepEqual(ano *__Any) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.TypeUrl) {
		return false
	}
	if !p.Field2DeepEqual(ano.Value) {
		return false
	}
	return true
}

func (p *__Any) Field1DeepEqual(src string) bool {

	if strings.Compare(p.TypeUrl, src) != 0 {
		return false
	}
	return true
}
func (p *__Any) Field2DeepEqual(src []byte) bool {

	if bytes.Compare(p.Value, src) != 0 {
		return false
	}
	return true
}

type AnyOrExpression struct {
	Any        *Any        `thrift:"any,1" frugal:"1,default,Any" json:"any"`
	Expression *Expression `thrift:"expression,2" frugal:"2,default,Expression" json:"expression"`
}

func NewAnyOrExpression() *AnyOrExpression {
	return &AnyOrExpression{}
}

func (p *AnyOrExpression) InitDefault() {
}

var AnyOrExpression_Any_DEFAULT *Any

func (p *AnyOrExpression) GetAny() (v *Any) {
	if !p.IsSetAny() {
		return AnyOrExpression_Any_DEFAULT
	}
	return p.Any
}

var AnyOrExpression_Expression_DEFAULT *Expression

func (p *AnyOrExpression) GetExpression() (v *Expression) {
	if !p.IsSetExpression() {
		return AnyOrExpression_Expression_DEFAULT
	}
	return p.Expression
}
func (p *AnyOrExpression) SetAny(val *Any) {
	p.Any = val
}
func (p *AnyOrExpression) SetExpression(val *Expression) {
	p.Expression = val
}

var fieldIDToName_AnyOrExpression = map[int16]string{
	1: "any",
	2: "expression",
}

func (p *AnyOrExpression) IsSetAny() bool {
	return p.Any != nil
}

func (p *AnyOrExpression) IsSetExpression() bool {
	return p.Expression != nil
}

func (p *AnyOrExpression) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 2:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField2(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}
		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_AnyOrExpression[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *AnyOrExpression) ReadField1(iprot thrift.TProtocol) error {
	_field := NewAny()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Any = _field
	return nil
}
func (p *AnyOrExpression) ReadField2(iprot thrift.TProtocol) error {
	_field := NewExpression()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Expression = _field
	return nil
}

func (p *AnyOrExpression) Write(oprot thrift.TProtocol) (err error) {

	var fieldId int16
	if err = oprot.WriteStructBegin("AnyOrExpression"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
		if err = p.writeField2(oprot); err != nil {
			fieldId = 2
			goto WriteFieldError
		}
	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *AnyOrExpression) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("any", thrift.STRUCT, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Any.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *AnyOrExpression) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("expression", thrift.STRUCT, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Expression.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err)
}

func (p *AnyOrExpression) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("AnyOrExpression(%+v)", *p)

}

func (p *AnyOrExpression) DeepEqual(ano *AnyOrExpression) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.Any) {
		return false
	}
	if !p.Field2DeepEqual(ano.Expression) {
		return false
	}
	return true
}

func (p *AnyOrExpression) Field1DeepEqual(src *Any) bool {

	if !p.Any.DeepEqual(src) {
		return false
	}
	return true
}
func (p *AnyOrExpression) Field2DeepEqual(src *Expression) bool {

	if !p.Expression.DeepEqual(src) {
		return false
	}
	return true
}

type Callback struct {
	Path                   []*NamedPathItem `thrift:"path,1" frugal:"1,default,list<NamedPathItem>" json:"path"`
	SpecificationExtension []*NamedAny      `thrift:"specification_extension,2" frugal:"2,default,list<NamedAny>" json:"specification_extension"`
}

func NewCallback() *Callback {
	return &Callback{}
}

func (p *Callback) InitDefault() {
}

func (p *Callback) GetPath() (v []*NamedPathItem) {
	return p.Path
}

func (p *Callback) GetSpecificationExtension() (v []*NamedAny) {
	return p.SpecificationExtension
}
func (p *Callback) SetPath(val []*NamedPathItem) {
	p.Path = val
}
func (p *Callback) SetSpecificationExtension(val []*NamedAny) {
	p.SpecificationExtension = val
}

var fieldIDToName_Callback = map[int16]string{
	1: "path",
	2: "specification_extension",
}

func (p *Callback) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.LIST {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 2:
			if fieldTypeId == thrift.LIST {
				if err = p.ReadField2(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}
		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_Callback[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *Callback) ReadField1(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	_field := make([]*NamedPathItem, 0, size)
	values := make([]NamedPathItem, size)
	for i := 0; i < size; i++ {
		_elem := &values[i]
		_elem.InitDefault()

		if err := _elem.Read(iprot); err != nil {
			return err
		}

		_field = append(_field, _elem)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return err
	}
	p.Path = _field
	return nil
}
func (p *Callback) ReadField2(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	_field := make([]*NamedAny, 0, size)
	values := make([]NamedAny, size)
	for i := 0; i < size; i++ {
		_elem := &values[i]
		_elem.InitDefault()

		if err := _elem.Read(iprot); err != nil {
			return err
		}

		_field = append(_field, _elem)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return err
	}
	p.SpecificationExtension = _field
	return nil
}

func (p *Callback) Write(oprot thrift.TProtocol) (err error) {

	var fieldId int16
	if err = oprot.WriteStructBegin("Callback"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
		if err = p.writeField2(oprot); err != nil {
			fieldId = 2
			goto WriteFieldError
		}
	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *Callback) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("path", thrift.LIST, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Path)); err != nil {
		return err
	}
	for _, v := range p.Path {
		if err := v.Write(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *Callback) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("specification_extension", thrift.LIST, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.SpecificationExtension)); err != nil {
		return err
	}
	for _, v := range p.SpecificationExtension {
		if err := v.Write(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err)
}

func (p *Callback) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("Callback(%+v)", *p)

}

func (p *Callback) DeepEqual(ano *Callback) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.Path) {
		return false
	}
	if !p.Field2DeepEqual(ano.SpecificationExtension) {
		return false
	}
	return true
}

func (p *Callback) Field1DeepEqual(src []*NamedPathItem) bool {

	if len(p.Path) != len(src) {
		return false
	}
	for i, v := range p.Path {
		_src := src[i]
		if !v.DeepEqual(_src) {
			return false
		}
	}
	return true
}
func (p *Callback) Field2DeepEqual(src []*NamedAny) bool {

	if len(p.SpecificationExtension) != len(src) {
		return false
	}
	for i, v := range p.SpecificationExtension {
		_src := src[i]
		if !v.DeepEqual(_src) {
			return false
		}
	}
	return true
}

type CallbackOrReference struct {
	Callback  *Callback  `thrift:"callback,1" frugal:"1,default,Callback" json:"callback"`
	Reference *Reference `thrift:"reference,2" frugal:"2,default,Reference" json:"reference"`
}

func NewCallbackOrReference() *CallbackOrReference {
	return &CallbackOrReference{}
}

func (p *CallbackOrReference) InitDefault() {
}

var CallbackOrReference_Callback_DEFAULT *Callback

func (p *CallbackOrReference) GetCallback() (v *Callback) {
	if !p.IsSetCallback() {
		return CallbackOrReference_Callback_DEFAULT
	}
	return p.Callback
}

var CallbackOrReference_Reference_DEFAULT *Reference

func (p *CallbackOrReference) GetReference() (v *Reference) {
	if !p.IsSetReference() {
		return CallbackOrReference_Reference_DEFAULT
	}
	return p.Reference
}
func (p *CallbackOrReference) SetCallback(val *Callback) {
	p.Callback = val
}
func (p *CallbackOrReference) SetReference(val *Reference) {
	p.Reference = val
}

var fieldIDToName_CallbackOrReference = map[int16]string{
	1: "callback",
	2: "reference",
}

func (p *CallbackOrReference) IsSetCallback() bool {
	return p.Callback != nil
}

func (p *CallbackOrReference) IsSetReference() bool {
	return p.Reference != nil
}

func (p *CallbackOrReference) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 2:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField2(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}
		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_CallbackOrReference[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *CallbackOrReference) ReadField1(iprot thrift.TProtocol) error {
	_field := NewCallback()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Callback = _field
	return nil
}
func (p *CallbackOrReference) ReadField2(iprot thrift.TProtocol) error {
	_field := NewReference()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Reference = _field
	return nil
}

func (p *CallbackOrReference) Write(oprot thrift.TProtocol) (err error) {

	var fieldId int16
	if err = oprot.WriteStructBegin("CallbackOrReference"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
		if err = p.writeField2(oprot); err != nil {
			fieldId = 2
			goto WriteFieldError
		}
	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *CallbackOrReference) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("callback", thrift.STRUCT, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Callback.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *CallbackOrReference) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("reference", thrift.STRUCT, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Reference.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err)
}

func (p *CallbackOrReference) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("CallbackOrReference(%+v)", *p)

}

func (p *CallbackOrReference) DeepEqual(ano *CallbackOrReference) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.Callback) {
		return false
	}
	if !p.Field2DeepEqual(ano.Reference) {
		return false
	}
	return true
}

func (p *CallbackOrReference) Field1DeepEqual(src *Callback) bool {

	if !p.Callback.DeepEqual(src) {
		return false
	}
	return true
}
func (p *CallbackOrReference) Field2DeepEqual(src *Reference) bool {

	if !p.Reference.DeepEqual(src) {
		return false
	}
	return true
}

type CallbacksOrReferences struct {
	AdditionalProperties []*NamedCallbackOrReference `thrift:"additional_properties,1" frugal:"1,default,list<NamedCallbackOrReference>" json:"additional_properties"`
}

func NewCallbacksOrReferences() *CallbacksOrReferences {
	return &CallbacksOrReferences{}
}

func (p *CallbacksOrReferences) InitDefault() {
}

func (p *CallbacksOrReferences) GetAdditionalProperties() (v []*NamedCallbackOrReference) {
	return p.AdditionalProperties
}
func (p *CallbacksOrReferences) SetAdditionalProperties(val []*NamedCallbackOrReference) {
	p.AdditionalProperties = val
}

var fieldIDToName_CallbacksOrReferences = map[int16]string{
	1: "additional_properties",
}

func (p *CallbacksOrReferences) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.LIST {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}
		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_CallbacksOrReferences[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *CallbacksOrReferences) ReadField1(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	_field := make([]*NamedCallbackOrReference, 0, size)
	values := make([]NamedCallbackOrReference, size)
	for i := 0; i < size; i++ {
		_elem := &values[i]
		_elem.InitDefault()

		if err := _elem.Read(iprot); err != nil {
			return err
		}

		_field = append(_field, _elem)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return err
	}
	p.AdditionalProperties = _field
	return nil
}

func (p *CallbacksOrReferences) Write(oprot thrift.TProtocol) (err error) {

	var fieldId int16
	if err = oprot.WriteStructBegin("CallbacksOrReferences"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *CallbacksOrReferences) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("additional_properties", thrift.LIST, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.AdditionalProperties)); err != nil {
		return err
	}
	for _, v := range p.AdditionalProperties {
		if err := v.Write(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *CallbacksOrReferences) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("CallbacksOrReferences(%+v)", *p)

}

func (p *CallbacksOrReferences) DeepEqual(ano *CallbacksOrReferences) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.AdditionalProperties) {
		return false
	}
	return true
}

func (p *CallbacksOrReferences) Field1DeepEqual(src []*NamedCallbackOrReference) bool {

	if len(p.AdditionalProperties) != len(src) {
		return false
	}
	for i, v := range p.AdditionalProperties {
		_src := src[i]
		if !v.DeepEqual(_src) {
			return false
		}
	}
	return true
}

type Components struct {
	Schemas                *SchemasOrReferences         `thrift:"schemas,1" frugal:"1,default,SchemasOrReferences" json:"schemas"`
	Responses              *ResponsesOrReferences       `thrift:"responses,2" frugal:"2,default,ResponsesOrReferences" json:"responses"`
	Parameters             *ParametersOrReferences      `thrift:"parameters,3" frugal:"3,default,ParametersOrReferences" json:"parameters"`
	Examples               *ExamplesOrReferences        `thrift:"examples,4" frugal:"4,default,ExamplesOrReferences" json:"examples"`
	RequestBodies          *RequestBodiesOrReferences   `thrift:"request_bodies,5" frugal:"5,default,RequestBodiesOrReferences" json:"request_bodies"`
	Headers                *HeadersOrReferences         `thrift:"headers,6" frugal:"6,default,HeadersOrReferences" json:"headers"`
	SecuritySchemes        *SecuritySchemesOrReferences `thrift:"security_schemes,7" frugal:"7,default,SecuritySchemesOrReferences" json:"security_schemes"`
	Links                  *LinksOrReferences           `thrift:"links,8" frugal:"8,default,LinksOrReferences" json:"links"`
	Callbacks              *CallbacksOrReferences       `thrift:"callbacks,9" frugal:"9,default,CallbacksOrReferences" json:"callbacks"`
	SpecificationExtension []*NamedAny                  `thrift:"specification_extension,10" frugal:"10,default,list<NamedAny>" json:"specification_extension"`
}

func NewComponents() *Components {
	return &Components{}
}

func (p *Components) InitDefault() {
}

var Components_Schemas_DEFAULT *SchemasOrReferences

func (p *Components) GetSchemas() (v *SchemasOrReferences) {
	if !p.IsSetSchemas() {
		return Components_Schemas_DEFAULT
	}
	return p.Schemas
}

var Components_Responses_DEFAULT *ResponsesOrReferences

func (p *Components) GetResponses() (v *ResponsesOrReferences) {
	if !p.IsSetResponses() {
		return Components_Responses_DEFAULT
	}
	return p.Responses
}

var Components_Parameters_DEFAULT *ParametersOrReferences

func (p *Components) GetParameters() (v *ParametersOrReferences) {
	if !p.IsSetParameters() {
		return Components_Parameters_DEFAULT
	}
	return p.Parameters
}

var Components_Examples_DEFAULT *ExamplesOrReferences

func (p *Components) GetExamples() (v *ExamplesOrReferences) {
	if !p.IsSetExamples() {
		return Components_Examples_DEFAULT
	}
	return p.Examples
}

var Components_RequestBodies_DEFAULT *RequestBodiesOrReferences

func (p *Components) GetRequestBodies() (v *RequestBodiesOrReferences) {
	if !p.IsSetRequestBodies() {
		return Components_RequestBodies_DEFAULT
	}
	return p.RequestBodies
}

var Components_Headers_DEFAULT *HeadersOrReferences

func (p *Components) GetHeaders() (v *HeadersOrReferences) {
	if !p.IsSetHeaders() {
		return Components_Headers_DEFAULT
	}
	return p.Headers
}

var Components_SecuritySchemes_DEFAULT *SecuritySchemesOrReferences

func (p *Components) GetSecuritySchemes() (v *SecuritySchemesOrReferences) {
	if !p.IsSetSecuritySchemes() {
		return Components_SecuritySchemes_DEFAULT
	}
	return p.SecuritySchemes
}

var Components_Links_DEFAULT *LinksOrReferences

func (p *Components) GetLinks() (v *LinksOrReferences) {
	if !p.IsSetLinks() {
		return Components_Links_DEFAULT
	}
	return p.Links
}

var Components_Callbacks_DEFAULT *CallbacksOrReferences

func (p *Components) GetCallbacks() (v *CallbacksOrReferences) {
	if !p.IsSetCallbacks() {
		return Components_Callbacks_DEFAULT
	}
	return p.Callbacks
}

func (p *Components) GetSpecificationExtension() (v []*NamedAny) {
	return p.SpecificationExtension
}
func (p *Components) SetSchemas(val *SchemasOrReferences) {
	p.Schemas = val
}
func (p *Components) SetResponses(val *ResponsesOrReferences) {
	p.Responses = val
}
func (p *Components) SetParameters(val *ParametersOrReferences) {
	p.Parameters = val
}
func (p *Components) SetExamples(val *ExamplesOrReferences) {
	p.Examples = val
}
func (p *Components) SetRequestBodies(val *RequestBodiesOrReferences) {
	p.RequestBodies = val
}
func (p *Components) SetHeaders(val *HeadersOrReferences) {
	p.Headers = val
}
func (p *Components) SetSecuritySchemes(val *SecuritySchemesOrReferences) {
	p.SecuritySchemes = val
}
func (p *Components) SetLinks(val *LinksOrReferences) {
	p.Links = val
}
func (p *Components) SetCallbacks(val *CallbacksOrReferences) {
	p.Callbacks = val
}
func (p *Components) SetSpecificationExtension(val []*NamedAny) {
	p.SpecificationExtension = val
}

var fieldIDToName_Components = map[int16]string{
	1:  "schemas",
	2:  "responses",
	3:  "parameters",
	4:  "examples",
	5:  "request_bodies",
	6:  "headers",
	7:  "security_schemes",
	8:  "links",
	9:  "callbacks",
	10: "specification_extension",
}

func (p *Components) IsSetSchemas() bool {
	return p.Schemas != nil
}

func (p *Components) IsSetResponses() bool {
	return p.Responses != nil
}

func (p *Components) IsSetParameters() bool {
	return p.Parameters != nil
}

func (p *Components) IsSetExamples() bool {
	return p.Examples != nil
}

func (p *Components) IsSetRequestBodies() bool {
	return p.RequestBodies != nil
}

func (p *Components) IsSetHeaders() bool {
	return p.Headers != nil
}

func (p *Components) IsSetSecuritySchemes() bool {
	return p.SecuritySchemes != nil
}

func (p *Components) IsSetLinks() bool {
	return p.Links != nil
}

func (p *Components) IsSetCallbacks() bool {
	return p.Callbacks != nil
}

func (p *Components) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 2:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField2(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 3:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField3(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 4:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField4(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 5:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField5(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 6:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField6(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 7:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField7(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 8:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField8(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 9:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField9(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 10:
			if fieldTypeId == thrift.LIST {
				if err = p.ReadField10(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}
		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_Components[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *Components) ReadField1(iprot thrift.TProtocol) error {
	_field := NewSchemasOrReferences()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Schemas = _field
	return nil
}
func (p *Components) ReadField2(iprot thrift.TProtocol) error {
	_field := NewResponsesOrReferences()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Responses = _field
	return nil
}
func (p *Components) ReadField3(iprot thrift.TProtocol) error {
	_field := NewParametersOrReferences()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Parameters = _field
	return nil
}
func (p *Components) ReadField4(iprot thrift.TProtocol) error {
	_field := NewExamplesOrReferences()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Examples = _field
	return nil
}
func (p *Components) ReadField5(iprot thrift.TProtocol) error {
	_field := NewRequestBodiesOrReferences()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.RequestBodies = _field
	return nil
}
func (p *Components) ReadField6(iprot thrift.TProtocol) error {
	_field := NewHeadersOrReferences()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Headers = _field
	return nil
}
func (p *Components) ReadField7(iprot thrift.TProtocol) error {
	_field := NewSecuritySchemesOrReferences()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.SecuritySchemes = _field
	return nil
}
func (p *Components) ReadField8(iprot thrift.TProtocol) error {
	_field := NewLinksOrReferences()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Links = _field
	return nil
}
func (p *Components) ReadField9(iprot thrift.TProtocol) error {
	_field := NewCallbacksOrReferences()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Callbacks = _field
	return nil
}
func (p *Components) ReadField10(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	_field := make([]*NamedAny, 0, size)
	values := make([]NamedAny, size)
	for i := 0; i < size; i++ {
		_elem := &values[i]
		_elem.InitDefault()

		if err := _elem.Read(iprot); err != nil {
			return err
		}

		_field = append(_field, _elem)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return err
	}
	p.SpecificationExtension = _field
	return nil
}

func (p *Components) Write(oprot thrift.TProtocol) (err error) {

	var fieldId int16
	if err = oprot.WriteStructBegin("Components"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
		if err = p.writeField2(oprot); err != nil {
			fieldId = 2
			goto WriteFieldError
		}
		if err = p.writeField3(oprot); err != nil {
			fieldId = 3
			goto WriteFieldError
		}
		if err = p.writeField4(oprot); err != nil {
			fieldId = 4
			goto WriteFieldError
		}
		if err = p.writeField5(oprot); err != nil {
			fieldId = 5
			goto WriteFieldError
		}
		if err = p.writeField6(oprot); err != nil {
			fieldId = 6
			goto WriteFieldError
		}
		if err = p.writeField7(oprot); err != nil {
			fieldId = 7
			goto WriteFieldError
		}
		if err = p.writeField8(oprot); err != nil {
			fieldId = 8
			goto WriteFieldError
		}
		if err = p.writeField9(oprot); err != nil {
			fieldId = 9
			goto WriteFieldError
		}
		if err = p.writeField10(oprot); err != nil {
			fieldId = 10
			goto WriteFieldError
		}
	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *Components) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("schemas", thrift.STRUCT, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Schemas.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *Components) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("responses", thrift.STRUCT, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Responses.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err)
}

func (p *Components) writeField3(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("parameters", thrift.STRUCT, 3); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Parameters.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err)
}

func (p *Components) writeField4(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("examples", thrift.STRUCT, 4); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Examples.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err)
}

func (p *Components) writeField5(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("request_bodies", thrift.STRUCT, 5); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.RequestBodies.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err)
}

func (p *Components) writeField6(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("headers", thrift.STRUCT, 6); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Headers.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 6 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err)
}

func (p *Components) writeField7(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("security_schemes", thrift.STRUCT, 7); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.SecuritySchemes.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 7 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 7 end error: ", p), err)
}

func (p *Components) writeField8(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("links", thrift.STRUCT, 8); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Links.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 8 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 8 end error: ", p), err)
}

func (p *Components) writeField9(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("callbacks", thrift.STRUCT, 9); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Callbacks.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 9 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 9 end error: ", p), err)
}

func (p *Components) writeField10(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("specification_extension", thrift.LIST, 10); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.SpecificationExtension)); err != nil {
		return err
	}
	for _, v := range p.SpecificationExtension {
		if err := v.Write(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 10 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 10 end error: ", p), err)
}

func (p *Components) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("Components(%+v)", *p)

}

func (p *Components) DeepEqual(ano *Components) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.Schemas) {
		return false
	}
	if !p.Field2DeepEqual(ano.Responses) {
		return false
	}
	if !p.Field3DeepEqual(ano.Parameters) {
		return false
	}
	if !p.Field4DeepEqual(ano.Examples) {
		return false
	}
	if !p.Field5DeepEqual(ano.RequestBodies) {
		return false
	}
	if !p.Field6DeepEqual(ano.Headers) {
		return false
	}
	if !p.Field7DeepEqual(ano.SecuritySchemes) {
		return false
	}
	if !p.Field8DeepEqual(ano.Links) {
		return false
	}
	if !p.Field9DeepEqual(ano.Callbacks) {
		return false
	}
	if !p.Field10DeepEqual(ano.SpecificationExtension) {
		return false
	}
	return true
}

func (p *Components) Field1DeepEqual(src *SchemasOrReferences) bool {

	if !p.Schemas.DeepEqual(src) {
		return false
	}
	return true
}
func (p *Components) Field2DeepEqual(src *ResponsesOrReferences) bool {

	if !p.Responses.DeepEqual(src) {
		return false
	}
	return true
}
func (p *Components) Field3DeepEqual(src *ParametersOrReferences) bool {

	if !p.Parameters.DeepEqual(src) {
		return false
	}
	return true
}
func (p *Components) Field4DeepEqual(src *ExamplesOrReferences) bool {

	if !p.Examples.DeepEqual(src) {
		return false
	}
	return true
}
func (p *Components) Field5DeepEqual(src *RequestBodiesOrReferences) bool {

	if !p.RequestBodies.DeepEqual(src) {
		return false
	}
	return true
}
func (p *Components) Field6DeepEqual(src *HeadersOrReferences) bool {

	if !p.Headers.DeepEqual(src) {
		return false
	}
	return true
}
func (p *Components) Field7DeepEqual(src *SecuritySchemesOrReferences) bool {

	if !p.SecuritySchemes.DeepEqual(src) {
		return false
	}
	return true
}
func (p *Components) Field8DeepEqual(src *LinksOrReferences) bool {

	if !p.Links.DeepEqual(src) {
		return false
	}
	return true
}
func (p *Components) Field9DeepEqual(src *CallbacksOrReferences) bool {

	if !p.Callbacks.DeepEqual(src) {
		return false
	}
	return true
}
func (p *Components) Field10DeepEqual(src []*NamedAny) bool {

	if len(p.SpecificationExtension) != len(src) {
		return false
	}
	for i, v := range p.SpecificationExtension {
		_src := src[i]
		if !v.DeepEqual(_src) {
			return false
		}
	}
	return true
}

type Contact struct {
	Name                   string      `thrift:"name,1" frugal:"1,default,string" json:"name"`
	Url                    string      `thrift:"url,2" frugal:"2,default,string" json:"url"`
	Email                  string      `thrift:"email,3" frugal:"3,default,string" json:"email"`
	SpecificationExtension []*NamedAny `thrift:"specification_extension,4" frugal:"4,default,list<NamedAny>" json:"specification_extension"`
}

func NewContact() *Contact {
	return &Contact{}
}

func (p *Contact) InitDefault() {
}

func (p *Contact) GetName() (v string) {
	return p.Name
}

func (p *Contact) GetUrl() (v string) {
	return p.Url
}

func (p *Contact) GetEmail() (v string) {
	return p.Email
}

func (p *Contact) GetSpecificationExtension() (v []*NamedAny) {
	return p.SpecificationExtension
}
func (p *Contact) SetName(val string) {
	p.Name = val
}
func (p *Contact) SetUrl(val string) {
	p.Url = val
}
func (p *Contact) SetEmail(val string) {
	p.Email = val
}
func (p *Contact) SetSpecificationExtension(val []*NamedAny) {
	p.SpecificationExtension = val
}

var fieldIDToName_Contact = map[int16]string{
	1: "name",
	2: "url",
	3: "email",
	4: "specification_extension",
}

func (p *Contact) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 2:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField2(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 3:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField3(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 4:
			if fieldTypeId == thrift.LIST {
				if err = p.ReadField4(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}
		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_Contact[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *Contact) ReadField1(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Name = _field
	return nil
}
func (p *Contact) ReadField2(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Url = _field
	return nil
}
func (p *Contact) ReadField3(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Email = _field
	return nil
}
func (p *Contact) ReadField4(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	_field := make([]*NamedAny, 0, size)
	values := make([]NamedAny, size)
	for i := 0; i < size; i++ {
		_elem := &values[i]
		_elem.InitDefault()

		if err := _elem.Read(iprot); err != nil {
			return err
		}

		_field = append(_field, _elem)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return err
	}
	p.SpecificationExtension = _field
	return nil
}

func (p *Contact) Write(oprot thrift.TProtocol) (err error) {

	var fieldId int16
	if err = oprot.WriteStructBegin("Contact"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
		if err = p.writeField2(oprot); err != nil {
			fieldId = 2
			goto WriteFieldError
		}
		if err = p.writeField3(oprot); err != nil {
			fieldId = 3
			goto WriteFieldError
		}
		if err = p.writeField4(oprot); err != nil {
			fieldId = 4
			goto WriteFieldError
		}
	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *Contact) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("name", thrift.STRING, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.Name); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *Contact) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("url", thrift.STRING, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.Url); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err)
}

func (p *Contact) writeField3(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("email", thrift.STRING, 3); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.Email); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err)
}

func (p *Contact) writeField4(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("specification_extension", thrift.LIST, 4); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.SpecificationExtension)); err != nil {
		return err
	}
	for _, v := range p.SpecificationExtension {
		if err := v.Write(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err)
}

func (p *Contact) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("Contact(%+v)", *p)

}

func (p *Contact) DeepEqual(ano *Contact) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.Name) {
		return false
	}
	if !p.Field2DeepEqual(ano.Url) {
		return false
	}
	if !p.Field3DeepEqual(ano.Email) {
		return false
	}
	if !p.Field4DeepEqual(ano.SpecificationExtension) {
		return false
	}
	return true
}

func (p *Contact) Field1DeepEqual(src string) bool {

	if strings.Compare(p.Name, src) != 0 {
		return false
	}
	return true
}
func (p *Contact) Field2DeepEqual(src string) bool {

	if strings.Compare(p.Url, src) != 0 {
		return false
	}
	return true
}
func (p *Contact) Field3DeepEqual(src string) bool {

	if strings.Compare(p.Email, src) != 0 {
		return false
	}
	return true
}
func (p *Contact) Field4DeepEqual(src []*NamedAny) bool {

	if len(p.SpecificationExtension) != len(src) {
		return false
	}
	for i, v := range p.SpecificationExtension {
		_src := src[i]
		if !v.DeepEqual(_src) {
			return false
		}
	}
	return true
}

type DefaultType struct {
	Number  float64 `thrift:"number,1" frugal:"1,default,double" json:"number"`
	Boolean bool    `thrift:"boolean,2" frugal:"2,default,bool" json:"boolean"`
	String_ string  `thrift:"string,3" frugal:"3,default,string" json:"string"`
}

func NewDefaultType() *DefaultType {
	return &DefaultType{}
}

func (p *DefaultType) InitDefault() {
}

func (p *DefaultType) GetNumber() (v float64) {
	return p.Number
}

func (p *DefaultType) GetBoolean() (v bool) {
	return p.Boolean
}

func (p *DefaultType) GetString() (v string) {
	return p.String_
}
func (p *DefaultType) SetNumber(val float64) {
	p.Number = val
}
func (p *DefaultType) SetBoolean(val bool) {
	p.Boolean = val
}
func (p *DefaultType) SetString(val string) {
	p.String_ = val
}

var fieldIDToName_DefaultType = map[int16]string{
	1: "number",
	2: "boolean",
	3: "string",
}

func (p *DefaultType) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.DOUBLE {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 2:
			if fieldTypeId == thrift.BOOL {
				if err = p.ReadField2(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 3:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField3(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}
		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_DefaultType[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *DefaultType) ReadField1(iprot thrift.TProtocol) error {

	var _field float64
	if v, err := iprot.ReadDouble(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Number = _field
	return nil
}
func (p *DefaultType) ReadField2(iprot thrift.TProtocol) error {

	var _field bool
	if v, err := iprot.ReadBool(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Boolean = _field
	return nil
}
func (p *DefaultType) ReadField3(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p.String_ = _field
	return nil
}

func (p *DefaultType) Write(oprot thrift.TProtocol) (err error) {

	var fieldId int16
	if err = oprot.WriteStructBegin("DefaultType"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
		if err = p.writeField2(oprot); err != nil {
			fieldId = 2
			goto WriteFieldError
		}
		if err = p.writeField3(oprot); err != nil {
			fieldId = 3
			goto WriteFieldError
		}
	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *DefaultType) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("number", thrift.DOUBLE, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteDouble(p.Number); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *DefaultType) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("boolean", thrift.BOOL, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteBool(p.Boolean); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err)
}

func (p *DefaultType) writeField3(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("string", thrift.STRING, 3); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.String_); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err)
}

func (p *DefaultType) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("DefaultType(%+v)", *p)

}

func (p *DefaultType) DeepEqual(ano *DefaultType) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.Number) {
		return false
	}
	if !p.Field2DeepEqual(ano.Boolean) {
		return false
	}
	if !p.Field3DeepEqual(ano.String_) {
		return false
	}
	return true
}

func (p *DefaultType) Field1DeepEqual(src float64) bool {

	if p.Number != src {
		return false
	}
	return true
}
func (p *DefaultType) Field2DeepEqual(src bool) bool {

	if p.Boolean != src {
		return false
	}
	return true
}
func (p *DefaultType) Field3DeepEqual(src string) bool {

	if strings.Compare(p.String_, src) != 0 {
		return false
	}
	return true
}

type Discriminator struct {
	PropertyName           string      `thrift:"property_name,1" frugal:"1,default,string" json:"property_name"`
	Mapping                *Strings    `thrift:"mapping,2" frugal:"2,default,Strings" json:"mapping"`
	SpecificationExtension []*NamedAny `thrift:"specification_extension,3" frugal:"3,default,list<NamedAny>" json:"specification_extension"`
}

func NewDiscriminator() *Discriminator {
	return &Discriminator{}
}

func (p *Discriminator) InitDefault() {
}

func (p *Discriminator) GetPropertyName() (v string) {
	return p.PropertyName
}

var Discriminator_Mapping_DEFAULT *Strings

func (p *Discriminator) GetMapping() (v *Strings) {
	if !p.IsSetMapping() {
		return Discriminator_Mapping_DEFAULT
	}
	return p.Mapping
}

func (p *Discriminator) GetSpecificationExtension() (v []*NamedAny) {
	return p.SpecificationExtension
}
func (p *Discriminator) SetPropertyName(val string) {
	p.PropertyName = val
}
func (p *Discriminator) SetMapping(val *Strings) {
	p.Mapping = val
}
func (p *Discriminator) SetSpecificationExtension(val []*NamedAny) {
	p.SpecificationExtension = val
}

var fieldIDToName_Discriminator = map[int16]string{
	1: "property_name",
	2: "mapping",
	3: "specification_extension",
}

func (p *Discriminator) IsSetMapping() bool {
	return p.Mapping != nil
}

func (p *Discriminator) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 2:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField2(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 3:
			if fieldTypeId == thrift.LIST {
				if err = p.ReadField3(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}
		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_Discriminator[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *Discriminator) ReadField1(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p.PropertyName = _field
	return nil
}
func (p *Discriminator) ReadField2(iprot thrift.TProtocol) error {
	_field := NewStrings()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Mapping = _field
	return nil
}
func (p *Discriminator) ReadField3(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	_field := make([]*NamedAny, 0, size)
	values := make([]NamedAny, size)
	for i := 0; i < size; i++ {
		_elem := &values[i]
		_elem.InitDefault()

		if err := _elem.Read(iprot); err != nil {
			return err
		}

		_field = append(_field, _elem)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return err
	}
	p.SpecificationExtension = _field
	return nil
}

func (p *Discriminator) Write(oprot thrift.TProtocol) (err error) {

	var fieldId int16
	if err = oprot.WriteStructBegin("Discriminator"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
		if err = p.writeField2(oprot); err != nil {
			fieldId = 2
			goto WriteFieldError
		}
		if err = p.writeField3(oprot); err != nil {
			fieldId = 3
			goto WriteFieldError
		}
	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *Discriminator) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("property_name", thrift.STRING, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.PropertyName); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *Discriminator) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("mapping", thrift.STRUCT, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Mapping.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err)
}

func (p *Discriminator) writeField3(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("specification_extension", thrift.LIST, 3); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.SpecificationExtension)); err != nil {
		return err
	}
	for _, v := range p.SpecificationExtension {
		if err := v.Write(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err)
}

func (p *Discriminator) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("Discriminator(%+v)", *p)

}

func (p *Discriminator) DeepEqual(ano *Discriminator) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.PropertyName) {
		return false
	}
	if !p.Field2DeepEqual(ano.Mapping) {
		return false
	}
	if !p.Field3DeepEqual(ano.SpecificationExtension) {
		return false
	}
	return true
}

func (p *Discriminator) Field1DeepEqual(src string) bool {

	if strings.Compare(p.PropertyName, src) != 0 {
		return false
	}
	return true
}
func (p *Discriminator) Field2DeepEqual(src *Strings) bool {

	if !p.Mapping.DeepEqual(src) {
		return false
	}
	return true
}
func (p *Discriminator) Field3DeepEqual(src []*NamedAny) bool {

	if len(p.SpecificationExtension) != len(src) {
		return false
	}
	for i, v := range p.SpecificationExtension {
		_src := src[i]
		if !v.DeepEqual(_src) {
			return false
		}
	}
	return true
}

type Document struct {
	Openapi                string                 `thrift:"openapi,1" frugal:"1,default,string" json:"openapi"`
	Info                   *Info                  `thrift:"info,2" frugal:"2,default,Info" json:"info"`
	Servers                []*Server              `thrift:"servers,3" frugal:"3,default,list<Server>" json:"servers"`
	Paths                  *Paths                 `thrift:"paths,4" frugal:"4,default,Paths" json:"paths"`
	Components             *Components            `thrift:"components,5" frugal:"5,default,Components" json:"components"`
	Security               []*SecurityRequirement `thrift:"security,6" frugal:"6,default,list<SecurityRequirement>" json:"security"`
	Tags                   []*Tag                 `thrift:"tags,7" frugal:"7,default,list<Tag>" json:"tags"`
	ExternalDocs           *ExternalDocs          `thrift:"external_docs,8" frugal:"8,default,ExternalDocs" json:"external_docs"`
	SpecificationExtension []*NamedAny            `thrift:"specification_extension,9" frugal:"9,default,list<NamedAny>" json:"specification_extension"`
}

func NewDocument() *Document {
	return &Document{}
}

func (p *Document) InitDefault() {
}

func (p *Document) GetOpenapi() (v string) {
	return p.Openapi
}

var Document_Info_DEFAULT *Info

func (p *Document) GetInfo() (v *Info) {
	if !p.IsSetInfo() {
		return Document_Info_DEFAULT
	}
	return p.Info
}

func (p *Document) GetServers() (v []*Server) {
	return p.Servers
}

var Document_Paths_DEFAULT *Paths

func (p *Document) GetPaths() (v *Paths) {
	if !p.IsSetPaths() {
		return Document_Paths_DEFAULT
	}
	return p.Paths
}

var Document_Components_DEFAULT *Components

func (p *Document) GetComponents() (v *Components) {
	if !p.IsSetComponents() {
		return Document_Components_DEFAULT
	}
	return p.Components
}

func (p *Document) GetSecurity() (v []*SecurityRequirement) {
	return p.Security
}

func (p *Document) GetTags() (v []*Tag) {
	return p.Tags
}

var Document_ExternalDocs_DEFAULT *ExternalDocs

func (p *Document) GetExternalDocs() (v *ExternalDocs) {
	if !p.IsSetExternalDocs() {
		return Document_ExternalDocs_DEFAULT
	}
	return p.ExternalDocs
}

func (p *Document) GetSpecificationExtension() (v []*NamedAny) {
	return p.SpecificationExtension
}
func (p *Document) SetOpenapi(val string) {
	p.Openapi = val
}
func (p *Document) SetInfo(val *Info) {
	p.Info = val
}
func (p *Document) SetServers(val []*Server) {
	p.Servers = val
}
func (p *Document) SetPaths(val *Paths) {
	p.Paths = val
}
func (p *Document) SetComponents(val *Components) {
	p.Components = val
}
func (p *Document) SetSecurity(val []*SecurityRequirement) {
	p.Security = val
}
func (p *Document) SetTags(val []*Tag) {
	p.Tags = val
}
func (p *Document) SetExternalDocs(val *ExternalDocs) {
	p.ExternalDocs = val
}
func (p *Document) SetSpecificationExtension(val []*NamedAny) {
	p.SpecificationExtension = val
}

var fieldIDToName_Document = map[int16]string{
	1: "openapi",
	2: "info",
	3: "servers",
	4: "paths",
	5: "components",
	6: "security",
	7: "tags",
	8: "external_docs",
	9: "specification_extension",
}

func (p *Document) IsSetInfo() bool {
	return p.Info != nil
}

func (p *Document) IsSetPaths() bool {
	return p.Paths != nil
}

func (p *Document) IsSetComponents() bool {
	return p.Components != nil
}

func (p *Document) IsSetExternalDocs() bool {
	return p.ExternalDocs != nil
}

func (p *Document) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 2:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField2(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 3:
			if fieldTypeId == thrift.LIST {
				if err = p.ReadField3(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 4:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField4(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 5:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField5(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 6:
			if fieldTypeId == thrift.LIST {
				if err = p.ReadField6(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 7:
			if fieldTypeId == thrift.LIST {
				if err = p.ReadField7(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 8:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField8(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 9:
			if fieldTypeId == thrift.LIST {
				if err = p.ReadField9(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}
		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_Document[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *Document) ReadField1(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Openapi = _field
	return nil
}
func (p *Document) ReadField2(iprot thrift.TProtocol) error {
	_field := NewInfo()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Info = _field
	return nil
}
func (p *Document) ReadField3(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	_field := make([]*Server, 0, size)
	values := make([]Server, size)
	for i := 0; i < size; i++ {
		_elem := &values[i]
		_elem.InitDefault()

		if err := _elem.Read(iprot); err != nil {
			return err
		}

		_field = append(_field, _elem)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return err
	}
	p.Servers = _field
	return nil
}
func (p *Document) ReadField4(iprot thrift.TProtocol) error {
	_field := NewPaths()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Paths = _field
	return nil
}
func (p *Document) ReadField5(iprot thrift.TProtocol) error {
	_field := NewComponents()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Components = _field
	return nil
}
func (p *Document) ReadField6(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	_field := make([]*SecurityRequirement, 0, size)
	values := make([]SecurityRequirement, size)
	for i := 0; i < size; i++ {
		_elem := &values[i]
		_elem.InitDefault()

		if err := _elem.Read(iprot); err != nil {
			return err
		}

		_field = append(_field, _elem)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return err
	}
	p.Security = _field
	return nil
}
func (p *Document) ReadField7(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	_field := make([]*Tag, 0, size)
	values := make([]Tag, size)
	for i := 0; i < size; i++ {
		_elem := &values[i]
		_elem.InitDefault()

		if err := _elem.Read(iprot); err != nil {
			return err
		}

		_field = append(_field, _elem)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return err
	}
	p.Tags = _field
	return nil
}
func (p *Document) ReadField8(iprot thrift.TProtocol) error {
	_field := NewExternalDocs()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.ExternalDocs = _field
	return nil
}
func (p *Document) ReadField9(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	_field := make([]*NamedAny, 0, size)
	values := make([]NamedAny, size)
	for i := 0; i < size; i++ {
		_elem := &values[i]
		_elem.InitDefault()

		if err := _elem.Read(iprot); err != nil {
			return err
		}

		_field = append(_field, _elem)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return err
	}
	p.SpecificationExtension = _field
	return nil
}

func (p *Document) Write(oprot thrift.TProtocol) (err error) {

	var fieldId int16
	if err = oprot.WriteStructBegin("Document"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
		if err = p.writeField2(oprot); err != nil {
			fieldId = 2
			goto WriteFieldError
		}
		if err = p.writeField3(oprot); err != nil {
			fieldId = 3
			goto WriteFieldError
		}
		if err = p.writeField4(oprot); err != nil {
			fieldId = 4
			goto WriteFieldError
		}
		if err = p.writeField5(oprot); err != nil {
			fieldId = 5
			goto WriteFieldError
		}
		if err = p.writeField6(oprot); err != nil {
			fieldId = 6
			goto WriteFieldError
		}
		if err = p.writeField7(oprot); err != nil {
			fieldId = 7
			goto WriteFieldError
		}
		if err = p.writeField8(oprot); err != nil {
			fieldId = 8
			goto WriteFieldError
		}
		if err = p.writeField9(oprot); err != nil {
			fieldId = 9
			goto WriteFieldError
		}
	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *Document) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("openapi", thrift.STRING, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.Openapi); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *Document) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("info", thrift.STRUCT, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Info.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err)
}

func (p *Document) writeField3(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("servers", thrift.LIST, 3); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Servers)); err != nil {
		return err
	}
	for _, v := range p.Servers {
		if err := v.Write(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err)
}

func (p *Document) writeField4(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("paths", thrift.STRUCT, 4); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Paths.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err)
}

func (p *Document) writeField5(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("components", thrift.STRUCT, 5); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Components.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err)
}

func (p *Document) writeField6(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("security", thrift.LIST, 6); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Security)); err != nil {
		return err
	}
	for _, v := range p.Security {
		if err := v.Write(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 6 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err)
}

func (p *Document) writeField7(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("tags", thrift.LIST, 7); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Tags)); err != nil {
		return err
	}
	for _, v := range p.Tags {
		if err := v.Write(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 7 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 7 end error: ", p), err)
}

func (p *Document) writeField8(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("external_docs", thrift.STRUCT, 8); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.ExternalDocs.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 8 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 8 end error: ", p), err)
}

func (p *Document) writeField9(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("specification_extension", thrift.LIST, 9); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.SpecificationExtension)); err != nil {
		return err
	}
	for _, v := range p.SpecificationExtension {
		if err := v.Write(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 9 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 9 end error: ", p), err)
}

func (p *Document) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("Document(%+v)", *p)

}

func (p *Document) DeepEqual(ano *Document) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.Openapi) {
		return false
	}
	if !p.Field2DeepEqual(ano.Info) {
		return false
	}
	if !p.Field3DeepEqual(ano.Servers) {
		return false
	}
	if !p.Field4DeepEqual(ano.Paths) {
		return false
	}
	if !p.Field5DeepEqual(ano.Components) {
		return false
	}
	if !p.Field6DeepEqual(ano.Security) {
		return false
	}
	if !p.Field7DeepEqual(ano.Tags) {
		return false
	}
	if !p.Field8DeepEqual(ano.ExternalDocs) {
		return false
	}
	if !p.Field9DeepEqual(ano.SpecificationExtension) {
		return false
	}
	return true
}

func (p *Document) Field1DeepEqual(src string) bool {

	if strings.Compare(p.Openapi, src) != 0 {
		return false
	}
	return true
}
func (p *Document) Field2DeepEqual(src *Info) bool {

	if !p.Info.DeepEqual(src) {
		return false
	}
	return true
}
func (p *Document) Field3DeepEqual(src []*Server) bool {

	if len(p.Servers) != len(src) {
		return false
	}
	for i, v := range p.Servers {
		_src := src[i]
		if !v.DeepEqual(_src) {
			return false
		}
	}
	return true
}
func (p *Document) Field4DeepEqual(src *Paths) bool {

	if !p.Paths.DeepEqual(src) {
		return false
	}
	return true
}
func (p *Document) Field5DeepEqual(src *Components) bool {

	if !p.Components.DeepEqual(src) {
		return false
	}
	return true
}
func (p *Document) Field6DeepEqual(src []*SecurityRequirement) bool {

	if len(p.Security) != len(src) {
		return false
	}
	for i, v := range p.Security {
		_src := src[i]
		if !v.DeepEqual(_src) {
			return false
		}
	}
	return true
}
func (p *Document) Field7DeepEqual(src []*Tag) bool {

	if len(p.Tags) != len(src) {
		return false
	}
	for i, v := range p.Tags {
		_src := src[i]
		if !v.DeepEqual(_src) {
			return false
		}
	}
	return true
}
func (p *Document) Field8DeepEqual(src *ExternalDocs) bool {

	if !p.ExternalDocs.DeepEqual(src) {
		return false
	}
	return true
}
func (p *Document) Field9DeepEqual(src []*NamedAny) bool {

	if len(p.SpecificationExtension) != len(src) {
		return false
	}
	for i, v := range p.SpecificationExtension {
		_src := src[i]
		if !v.DeepEqual(_src) {
			return false
		}
	}
	return true
}

type Encoding struct {
	ContentType            string               `thrift:"content_type,1" frugal:"1,default,string" json:"content_type"`
	Headers                *HeadersOrReferences `thrift:"headers,2" frugal:"2,default,HeadersOrReferences" json:"headers"`
	Style                  string               `thrift:"style,3" frugal:"3,default,string" json:"style"`
	Explode                bool                 `thrift:"explode,4" frugal:"4,default,bool" json:"explode"`
	AllowReserved          bool                 `thrift:"allow_reserved,5" frugal:"5,default,bool" json:"allow_reserved"`
	SpecificationExtension []*NamedAny          `thrift:"specification_extension,6" frugal:"6,default,list<NamedAny>" json:"specification_extension"`
}

func NewEncoding() *Encoding {
	return &Encoding{}
}

func (p *Encoding) InitDefault() {
}

func (p *Encoding) GetContentType() (v string) {
	return p.ContentType
}

var Encoding_Headers_DEFAULT *HeadersOrReferences

func (p *Encoding) GetHeaders() (v *HeadersOrReferences) {
	if !p.IsSetHeaders() {
		return Encoding_Headers_DEFAULT
	}
	return p.Headers
}

func (p *Encoding) GetStyle() (v string) {
	return p.Style
}

func (p *Encoding) GetExplode() (v bool) {
	return p.Explode
}

func (p *Encoding) GetAllowReserved() (v bool) {
	return p.AllowReserved
}

func (p *Encoding) GetSpecificationExtension() (v []*NamedAny) {
	return p.SpecificationExtension
}
func (p *Encoding) SetContentType(val string) {
	p.ContentType = val
}
func (p *Encoding) SetHeaders(val *HeadersOrReferences) {
	p.Headers = val
}
func (p *Encoding) SetStyle(val string) {
	p.Style = val
}
func (p *Encoding) SetExplode(val bool) {
	p.Explode = val
}
func (p *Encoding) SetAllowReserved(val bool) {
	p.AllowReserved = val
}
func (p *Encoding) SetSpecificationExtension(val []*NamedAny) {
	p.SpecificationExtension = val
}

var fieldIDToName_Encoding = map[int16]string{
	1: "content_type",
	2: "headers",
	3: "style",
	4: "explode",
	5: "allow_reserved",
	6: "specification_extension",
}

func (p *Encoding) IsSetHeaders() bool {
	return p.Headers != nil
}

func (p *Encoding) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 2:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField2(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 3:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField3(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 4:
			if fieldTypeId == thrift.BOOL {
				if err = p.ReadField4(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 5:
			if fieldTypeId == thrift.BOOL {
				if err = p.ReadField5(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 6:
			if fieldTypeId == thrift.LIST {
				if err = p.ReadField6(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}
		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_Encoding[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *Encoding) ReadField1(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p.ContentType = _field
	return nil
}
func (p *Encoding) ReadField2(iprot thrift.TProtocol) error {
	_field := NewHeadersOrReferences()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Headers = _field
	return nil
}
func (p *Encoding) ReadField3(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Style = _field
	return nil
}
func (p *Encoding) ReadField4(iprot thrift.TProtocol) error {

	var _field bool
	if v, err := iprot.ReadBool(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Explode = _field
	return nil
}
func (p *Encoding) ReadField5(iprot thrift.TProtocol) error {

	var _field bool
	if v, err := iprot.ReadBool(); err != nil {
		return err
	} else {
		_field = v
	}
	p.AllowReserved = _field
	return nil
}
func (p *Encoding) ReadField6(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	_field := make([]*NamedAny, 0, size)
	values := make([]NamedAny, size)
	for i := 0; i < size; i++ {
		_elem := &values[i]
		_elem.InitDefault()

		if err := _elem.Read(iprot); err != nil {
			return err
		}

		_field = append(_field, _elem)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return err
	}
	p.SpecificationExtension = _field
	return nil
}

func (p *Encoding) Write(oprot thrift.TProtocol) (err error) {

	var fieldId int16
	if err = oprot.WriteStructBegin("Encoding"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
		if err = p.writeField2(oprot); err != nil {
			fieldId = 2
			goto WriteFieldError
		}
		if err = p.writeField3(oprot); err != nil {
			fieldId = 3
			goto WriteFieldError
		}
		if err = p.writeField4(oprot); err != nil {
			fieldId = 4
			goto WriteFieldError
		}
		if err = p.writeField5(oprot); err != nil {
			fieldId = 5
			goto WriteFieldError
		}
		if err = p.writeField6(oprot); err != nil {
			fieldId = 6
			goto WriteFieldError
		}
	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *Encoding) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("content_type", thrift.STRING, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.ContentType); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *Encoding) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("headers", thrift.STRUCT, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Headers.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err)
}

func (p *Encoding) writeField3(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("style", thrift.STRING, 3); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.Style); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err)
}

func (p *Encoding) writeField4(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("explode", thrift.BOOL, 4); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteBool(p.Explode); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err)
}

func (p *Encoding) writeField5(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("allow_reserved", thrift.BOOL, 5); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteBool(p.AllowReserved); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err)
}

func (p *Encoding) writeField6(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("specification_extension", thrift.LIST, 6); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.SpecificationExtension)); err != nil {
		return err
	}
	for _, v := range p.SpecificationExtension {
		if err := v.Write(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 6 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err)
}

func (p *Encoding) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("Encoding(%+v)", *p)

}

func (p *Encoding) DeepEqual(ano *Encoding) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.ContentType) {
		return false
	}
	if !p.Field2DeepEqual(ano.Headers) {
		return false
	}
	if !p.Field3DeepEqual(ano.Style) {
		return false
	}
	if !p.Field4DeepEqual(ano.Explode) {
		return false
	}
	if !p.Field5DeepEqual(ano.AllowReserved) {
		return false
	}
	if !p.Field6DeepEqual(ano.SpecificationExtension) {
		return false
	}
	return true
}

func (p *Encoding) Field1DeepEqual(src string) bool {

	if strings.Compare(p.ContentType, src) != 0 {
		return false
	}
	return true
}
func (p *Encoding) Field2DeepEqual(src *HeadersOrReferences) bool {

	if !p.Headers.DeepEqual(src) {
		return false
	}
	return true
}
func (p *Encoding) Field3DeepEqual(src string) bool {

	if strings.Compare(p.Style, src) != 0 {
		return false
	}
	return true
}
func (p *Encoding) Field4DeepEqual(src bool) bool {

	if p.Explode != src {
		return false
	}
	return true
}
func (p *Encoding) Field5DeepEqual(src bool) bool {

	if p.AllowReserved != src {
		return false
	}
	return true
}
func (p *Encoding) Field6DeepEqual(src []*NamedAny) bool {

	if len(p.SpecificationExtension) != len(src) {
		return false
	}
	for i, v := range p.SpecificationExtension {
		_src := src[i]
		if !v.DeepEqual(_src) {
			return false
		}
	}
	return true
}

type Encodings struct {
	AdditionalProperties []*NamedEncoding `thrift:"additional_properties,1" frugal:"1,default,list<NamedEncoding>" json:"additional_properties"`
}

func NewEncodings() *Encodings {
	return &Encodings{}
}

func (p *Encodings) InitDefault() {
}

func (p *Encodings) GetAdditionalProperties() (v []*NamedEncoding) {
	return p.AdditionalProperties
}
func (p *Encodings) SetAdditionalProperties(val []*NamedEncoding) {
	p.AdditionalProperties = val
}

var fieldIDToName_Encodings = map[int16]string{
	1: "additional_properties",
}

func (p *Encodings) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.LIST {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}
		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_Encodings[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *Encodings) ReadField1(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	_field := make([]*NamedEncoding, 0, size)
	values := make([]NamedEncoding, size)
	for i := 0; i < size; i++ {
		_elem := &values[i]
		_elem.InitDefault()

		if err := _elem.Read(iprot); err != nil {
			return err
		}

		_field = append(_field, _elem)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return err
	}
	p.AdditionalProperties = _field
	return nil
}

func (p *Encodings) Write(oprot thrift.TProtocol) (err error) {

	var fieldId int16
	if err = oprot.WriteStructBegin("Encodings"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *Encodings) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("additional_properties", thrift.LIST, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.AdditionalProperties)); err != nil {
		return err
	}
	for _, v := range p.AdditionalProperties {
		if err := v.Write(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *Encodings) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("Encodings(%+v)", *p)

}

func (p *Encodings) DeepEqual(ano *Encodings) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.AdditionalProperties) {
		return false
	}
	return true
}

func (p *Encodings) Field1DeepEqual(src []*NamedEncoding) bool {

	if len(p.AdditionalProperties) != len(src) {
		return false
	}
	for i, v := range p.AdditionalProperties {
		_src := src[i]
		if !v.DeepEqual(_src) {
			return false
		}
	}
	return true
}

type Example struct {
	Summary                string      `thrift:"summary,1" frugal:"1,default,string" json:"summary"`
	Description            string      `thrift:"description,2" frugal:"2,default,string" json:"description"`
	Value                  *Any        `thrift:"value,3" frugal:"3,default,Any" json:"value"`
	ExternalValue          string      `thrift:"external_value,4" frugal:"4,default,string" json:"external_value"`
	SpecificationExtension []*NamedAny `thrift:"specification_extension,5" frugal:"5,default,list<NamedAny>" json:"specification_extension"`
}

func NewExample() *Example {
	return &Example{}
}

func (p *Example) InitDefault() {
}

func (p *Example) GetSummary() (v string) {
	return p.Summary
}

func (p *Example) GetDescription() (v string) {
	return p.Description
}

var Example_Value_DEFAULT *Any

func (p *Example) GetValue() (v *Any) {
	if !p.IsSetValue() {
		return Example_Value_DEFAULT
	}
	return p.Value
}

func (p *Example) GetExternalValue() (v string) {
	return p.ExternalValue
}

func (p *Example) GetSpecificationExtension() (v []*NamedAny) {
	return p.SpecificationExtension
}
func (p *Example) SetSummary(val string) {
	p.Summary = val
}
func (p *Example) SetDescription(val string) {
	p.Description = val
}
func (p *Example) SetValue(val *Any) {
	p.Value = val
}
func (p *Example) SetExternalValue(val string) {
	p.ExternalValue = val
}
func (p *Example) SetSpecificationExtension(val []*NamedAny) {
	p.SpecificationExtension = val
}

var fieldIDToName_Example = map[int16]string{
	1: "summary",
	2: "description",
	3: "value",
	4: "external_value",
	5: "specification_extension",
}

func (p *Example) IsSetValue() bool {
	return p.Value != nil
}

func (p *Example) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 2:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField2(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 3:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField3(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 4:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField4(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 5:
			if fieldTypeId == thrift.LIST {
				if err = p.ReadField5(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}
		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_Example[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *Example) ReadField1(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Summary = _field
	return nil
}
func (p *Example) ReadField2(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Description = _field
	return nil
}
func (p *Example) ReadField3(iprot thrift.TProtocol) error {
	_field := NewAny()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Value = _field
	return nil
}
func (p *Example) ReadField4(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p.ExternalValue = _field
	return nil
}
func (p *Example) ReadField5(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	_field := make([]*NamedAny, 0, size)
	values := make([]NamedAny, size)
	for i := 0; i < size; i++ {
		_elem := &values[i]
		_elem.InitDefault()

		if err := _elem.Read(iprot); err != nil {
			return err
		}

		_field = append(_field, _elem)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return err
	}
	p.SpecificationExtension = _field
	return nil
}

func (p *Example) Write(oprot thrift.TProtocol) (err error) {

	var fieldId int16
	if err = oprot.WriteStructBegin("Example"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
		if err = p.writeField2(oprot); err != nil {
			fieldId = 2
			goto WriteFieldError
		}
		if err = p.writeField3(oprot); err != nil {
			fieldId = 3
			goto WriteFieldError
		}
		if err = p.writeField4(oprot); err != nil {
			fieldId = 4
			goto WriteFieldError
		}
		if err = p.writeField5(oprot); err != nil {
			fieldId = 5
			goto WriteFieldError
		}
	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *Example) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("summary", thrift.STRING, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.Summary); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *Example) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("description", thrift.STRING, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.Description); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err)
}

func (p *Example) writeField3(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("value", thrift.STRUCT, 3); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Value.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err)
}

func (p *Example) writeField4(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("external_value", thrift.STRING, 4); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.ExternalValue); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err)
}

func (p *Example) writeField5(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("specification_extension", thrift.LIST, 5); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.SpecificationExtension)); err != nil {
		return err
	}
	for _, v := range p.SpecificationExtension {
		if err := v.Write(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err)
}

func (p *Example) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("Example(%+v)", *p)

}

func (p *Example) DeepEqual(ano *Example) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.Summary) {
		return false
	}
	if !p.Field2DeepEqual(ano.Description) {
		return false
	}
	if !p.Field3DeepEqual(ano.Value) {
		return false
	}
	if !p.Field4DeepEqual(ano.ExternalValue) {
		return false
	}
	if !p.Field5DeepEqual(ano.SpecificationExtension) {
		return false
	}
	return true
}

func (p *Example) Field1DeepEqual(src string) bool {

	if strings.Compare(p.Summary, src) != 0 {
		return false
	}
	return true
}
func (p *Example) Field2DeepEqual(src string) bool {

	if strings.Compare(p.Description, src) != 0 {
		return false
	}
	return true
}
func (p *Example) Field3DeepEqual(src *Any) bool {

	if !p.Value.DeepEqual(src) {
		return false
	}
	return true
}
func (p *Example) Field4DeepEqual(src string) bool {

	if strings.Compare(p.ExternalValue, src) != 0 {
		return false
	}
	return true
}
func (p *Example) Field5DeepEqual(src []*NamedAny) bool {

	if len(p.SpecificationExtension) != len(src) {
		return false
	}
	for i, v := range p.SpecificationExtension {
		_src := src[i]
		if !v.DeepEqual(_src) {
			return false
		}
	}
	return true
}

type ExampleOrReference struct {
	Example   *Example   `thrift:"example,1" frugal:"1,default,Example" json:"example"`
	Reference *Reference `thrift:"reference,2" frugal:"2,default,Reference" json:"reference"`
}

func NewExampleOrReference() *ExampleOrReference {
	return &ExampleOrReference{}
}

func (p *ExampleOrReference) InitDefault() {
}

var ExampleOrReference_Example_DEFAULT *Example

func (p *ExampleOrReference) GetExample() (v *Example) {
	if !p.IsSetExample() {
		return ExampleOrReference_Example_DEFAULT
	}
	return p.Example
}

var ExampleOrReference_Reference_DEFAULT *Reference

func (p *ExampleOrReference) GetReference() (v *Reference) {
	if !p.IsSetReference() {
		return ExampleOrReference_Reference_DEFAULT
	}
	return p.Reference
}
func (p *ExampleOrReference) SetExample(val *Example) {
	p.Example = val
}
func (p *ExampleOrReference) SetReference(val *Reference) {
	p.Reference = val
}

var fieldIDToName_ExampleOrReference = map[int16]string{
	1: "example",
	2: "reference",
}

func (p *ExampleOrReference) IsSetExample() bool {
	return p.Example != nil
}

func (p *ExampleOrReference) IsSetReference() bool {
	return p.Reference != nil
}

func (p *ExampleOrReference) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 2:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField2(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}
		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_ExampleOrReference[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *ExampleOrReference) ReadField1(iprot thrift.TProtocol) error {
	_field := NewExample()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Example = _field
	return nil
}
func (p *ExampleOrReference) ReadField2(iprot thrift.TProtocol) error {
	_field := NewReference()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Reference = _field
	return nil
}

func (p *ExampleOrReference) Write(oprot thrift.TProtocol) (err error) {

	var fieldId int16
	if err = oprot.WriteStructBegin("ExampleOrReference"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
		if err = p.writeField2(oprot); err != nil {
			fieldId = 2
			goto WriteFieldError
		}
	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *ExampleOrReference) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("example", thrift.STRUCT, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Example.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *ExampleOrReference) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("reference", thrift.STRUCT, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Reference.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err)
}

func (p *ExampleOrReference) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("ExampleOrReference(%+v)", *p)

}

func (p *ExampleOrReference) DeepEqual(ano *ExampleOrReference) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.Example) {
		return false
	}
	if !p.Field2DeepEqual(ano.Reference) {
		return false
	}
	return true
}

func (p *ExampleOrReference) Field1DeepEqual(src *Example) bool {

	if !p.Example.DeepEqual(src) {
		return false
	}
	return true
}
func (p *ExampleOrReference) Field2DeepEqual(src *Reference) bool {

	if !p.Reference.DeepEqual(src) {
		return false
	}
	return true
}

type ExamplesOrReferences struct {
	AdditionalProperties []*NamedExampleOrReference `thrift:"additional_properties,1" frugal:"1,default,list<NamedExampleOrReference>" json:"additional_properties"`
}

func NewExamplesOrReferences() *ExamplesOrReferences {
	return &ExamplesOrReferences{}
}

func (p *ExamplesOrReferences) InitDefault() {
}

func (p *ExamplesOrReferences) GetAdditionalProperties() (v []*NamedExampleOrReference) {
	return p.AdditionalProperties
}
func (p *ExamplesOrReferences) SetAdditionalProperties(val []*NamedExampleOrReference) {
	p.AdditionalProperties = val
}

var fieldIDToName_ExamplesOrReferences = map[int16]string{
	1: "additional_properties",
}

func (p *ExamplesOrReferences) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.LIST {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}
		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_ExamplesOrReferences[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *ExamplesOrReferences) ReadField1(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	_field := make([]*NamedExampleOrReference, 0, size)
	values := make([]NamedExampleOrReference, size)
	for i := 0; i < size; i++ {
		_elem := &values[i]
		_elem.InitDefault()

		if err := _elem.Read(iprot); err != nil {
			return err
		}

		_field = append(_field, _elem)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return err
	}
	p.AdditionalProperties = _field
	return nil
}

func (p *ExamplesOrReferences) Write(oprot thrift.TProtocol) (err error) {

	var fieldId int16
	if err = oprot.WriteStructBegin("ExamplesOrReferences"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *ExamplesOrReferences) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("additional_properties", thrift.LIST, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.AdditionalProperties)); err != nil {
		return err
	}
	for _, v := range p.AdditionalProperties {
		if err := v.Write(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *ExamplesOrReferences) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("ExamplesOrReferences(%+v)", *p)

}

func (p *ExamplesOrReferences) DeepEqual(ano *ExamplesOrReferences) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.AdditionalProperties) {
		return false
	}
	return true
}

func (p *ExamplesOrReferences) Field1DeepEqual(src []*NamedExampleOrReference) bool {

	if len(p.AdditionalProperties) != len(src) {
		return false
	}
	for i, v := range p.AdditionalProperties {
		_src := src[i]
		if !v.DeepEqual(_src) {
			return false
		}
	}
	return true
}

type Expression struct {
	AdditionalProperties []*NamedAny `thrift:"additional_properties,1" frugal:"1,default,list<NamedAny>" json:"additional_properties"`
}

func NewExpression() *Expression {
	return &Expression{}
}

func (p *Expression) InitDefault() {
}

func (p *Expression) GetAdditionalProperties() (v []*NamedAny) {
	return p.AdditionalProperties
}
func (p *Expression) SetAdditionalProperties(val []*NamedAny) {
	p.AdditionalProperties = val
}

var fieldIDToName_Expression = map[int16]string{
	1: "additional_properties",
}

func (p *Expression) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.LIST {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}
		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_Expression[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *Expression) ReadField1(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	_field := make([]*NamedAny, 0, size)
	values := make([]NamedAny, size)
	for i := 0; i < size; i++ {
		_elem := &values[i]
		_elem.InitDefault()

		if err := _elem.Read(iprot); err != nil {
			return err
		}

		_field = append(_field, _elem)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return err
	}
	p.AdditionalProperties = _field
	return nil
}

func (p *Expression) Write(oprot thrift.TProtocol) (err error) {

	var fieldId int16
	if err = oprot.WriteStructBegin("Expression"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *Expression) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("additional_properties", thrift.LIST, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.AdditionalProperties)); err != nil {
		return err
	}
	for _, v := range p.AdditionalProperties {
		if err := v.Write(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *Expression) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("Expression(%+v)", *p)

}

func (p *Expression) DeepEqual(ano *Expression) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.AdditionalProperties) {
		return false
	}
	return true
}

func (p *Expression) Field1DeepEqual(src []*NamedAny) bool {

	if len(p.AdditionalProperties) != len(src) {
		return false
	}
	for i, v := range p.AdditionalProperties {
		_src := src[i]
		if !v.DeepEqual(_src) {
			return false
		}
	}
	return true
}

type ExternalDocs struct {
	Description            string      `thrift:"description,1" frugal:"1,default,string" json:"description"`
	Url                    string      `thrift:"url,2" frugal:"2,default,string" json:"url"`
	SpecificationExtension []*NamedAny `thrift:"specification_extension,3" frugal:"3,default,list<NamedAny>" json:"specification_extension"`
}

func NewExternalDocs() *ExternalDocs {
	return &ExternalDocs{}
}

func (p *ExternalDocs) InitDefault() {
}

func (p *ExternalDocs) GetDescription() (v string) {
	return p.Description
}

func (p *ExternalDocs) GetUrl() (v string) {
	return p.Url
}

func (p *ExternalDocs) GetSpecificationExtension() (v []*NamedAny) {
	return p.SpecificationExtension
}
func (p *ExternalDocs) SetDescription(val string) {
	p.Description = val
}
func (p *ExternalDocs) SetUrl(val string) {
	p.Url = val
}
func (p *ExternalDocs) SetSpecificationExtension(val []*NamedAny) {
	p.SpecificationExtension = val
}

var fieldIDToName_ExternalDocs = map[int16]string{
	1: "description",
	2: "url",
	3: "specification_extension",
}

func (p *ExternalDocs) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 2:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField2(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 3:
			if fieldTypeId == thrift.LIST {
				if err = p.ReadField3(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}
		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_ExternalDocs[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *ExternalDocs) ReadField1(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Description = _field
	return nil
}
func (p *ExternalDocs) ReadField2(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Url = _field
	return nil
}
func (p *ExternalDocs) ReadField3(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	_field := make([]*NamedAny, 0, size)
	values := make([]NamedAny, size)
	for i := 0; i < size; i++ {
		_elem := &values[i]
		_elem.InitDefault()

		if err := _elem.Read(iprot); err != nil {
			return err
		}

		_field = append(_field, _elem)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return err
	}
	p.SpecificationExtension = _field
	return nil
}

func (p *ExternalDocs) Write(oprot thrift.TProtocol) (err error) {

	var fieldId int16
	if err = oprot.WriteStructBegin("ExternalDocs"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
		if err = p.writeField2(oprot); err != nil {
			fieldId = 2
			goto WriteFieldError
		}
		if err = p.writeField3(oprot); err != nil {
			fieldId = 3
			goto WriteFieldError
		}
	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *ExternalDocs) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("description", thrift.STRING, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.Description); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *ExternalDocs) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("url", thrift.STRING, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.Url); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err)
}

func (p *ExternalDocs) writeField3(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("specification_extension", thrift.LIST, 3); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.SpecificationExtension)); err != nil {
		return err
	}
	for _, v := range p.SpecificationExtension {
		if err := v.Write(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err)
}

func (p *ExternalDocs) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("ExternalDocs(%+v)", *p)

}

func (p *ExternalDocs) DeepEqual(ano *ExternalDocs) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.Description) {
		return false
	}
	if !p.Field2DeepEqual(ano.Url) {
		return false
	}
	if !p.Field3DeepEqual(ano.SpecificationExtension) {
		return false
	}
	return true
}

func (p *ExternalDocs) Field1DeepEqual(src string) bool {

	if strings.Compare(p.Description, src) != 0 {
		return false
	}
	return true
}
func (p *ExternalDocs) Field2DeepEqual(src string) bool {

	if strings.Compare(p.Url, src) != 0 {
		return false
	}
	return true
}
func (p *ExternalDocs) Field3DeepEqual(src []*NamedAny) bool {

	if len(p.SpecificationExtension) != len(src) {
		return false
	}
	for i, v := range p.SpecificationExtension {
		_src := src[i]
		if !v.DeepEqual(_src) {
			return false
		}
	}
	return true
}

type Header struct {
	Description            string                `thrift:"description,1" frugal:"1,default,string" json:"description"`
	Required               bool                  `thrift:"required,2" frugal:"2,default,bool" json:"required"`
	Deprecated             bool                  `thrift:"deprecated,3" frugal:"3,default,bool" json:"deprecated"`
	AllowEmptyValue        bool                  `thrift:"allow_empty_value,4" frugal:"4,default,bool" json:"allow_empty_value"`
	Style                  string                `thrift:"style,5" frugal:"5,default,string" json:"style"`
	Explode                bool                  `thrift:"explode,6" frugal:"6,default,bool" json:"explode"`
	AllowReserved          bool                  `thrift:"allow_reserved,7" frugal:"7,default,bool" json:"allow_reserved"`
	Schema                 *SchemaOrReference    `thrift:"schema,8" frugal:"8,default,SchemaOrReference" json:"schema"`
	Example                *Any                  `thrift:"example,9" frugal:"9,default,Any" json:"example"`
	Examples               *ExamplesOrReferences `thrift:"examples,10" frugal:"10,default,ExamplesOrReferences" json:"examples"`
	Content                *MediaTypes           `thrift:"content,11" frugal:"11,default,MediaTypes" json:"content"`
	SpecificationExtension []*NamedAny           `thrift:"specification_extension,12" frugal:"12,default,list<NamedAny>" json:"specification_extension"`
}

func NewHeader() *Header {
	return &Header{}
}

func (p *Header) InitDefault() {
}

func (p *Header) GetDescription() (v string) {
	return p.Description
}

func (p *Header) GetRequired() (v bool) {
	return p.Required
}

func (p *Header) GetDeprecated() (v bool) {
	return p.Deprecated
}

func (p *Header) GetAllowEmptyValue() (v bool) {
	return p.AllowEmptyValue
}

func (p *Header) GetStyle() (v string) {
	return p.Style
}

func (p *Header) GetExplode() (v bool) {
	return p.Explode
}

func (p *Header) GetAllowReserved() (v bool) {
	return p.AllowReserved
}

var Header_Schema_DEFAULT *SchemaOrReference

func (p *Header) GetSchema() (v *SchemaOrReference) {
	if !p.IsSetSchema() {
		return Header_Schema_DEFAULT
	}
	return p.Schema
}

var Header_Example_DEFAULT *Any

func (p *Header) GetExample() (v *Any) {
	if !p.IsSetExample() {
		return Header_Example_DEFAULT
	}
	return p.Example
}

var Header_Examples_DEFAULT *ExamplesOrReferences

func (p *Header) GetExamples() (v *ExamplesOrReferences) {
	if !p.IsSetExamples() {
		return Header_Examples_DEFAULT
	}
	return p.Examples
}

var Header_Content_DEFAULT *MediaTypes

func (p *Header) GetContent() (v *MediaTypes) {
	if !p.IsSetContent() {
		return Header_Content_DEFAULT
	}
	return p.Content
}

func (p *Header) GetSpecificationExtension() (v []*NamedAny) {
	return p.SpecificationExtension
}
func (p *Header) SetDescription(val string) {
	p.Description = val
}
func (p *Header) SetRequired(val bool) {
	p.Required = val
}
func (p *Header) SetDeprecated(val bool) {
	p.Deprecated = val
}
func (p *Header) SetAllowEmptyValue(val bool) {
	p.AllowEmptyValue = val
}
func (p *Header) SetStyle(val string) {
	p.Style = val
}
func (p *Header) SetExplode(val bool) {
	p.Explode = val
}
func (p *Header) SetAllowReserved(val bool) {
	p.AllowReserved = val
}
func (p *Header) SetSchema(val *SchemaOrReference) {
	p.Schema = val
}
func (p *Header) SetExample(val *Any) {
	p.Example = val
}
func (p *Header) SetExamples(val *ExamplesOrReferences) {
	p.Examples = val
}
func (p *Header) SetContent(val *MediaTypes) {
	p.Content = val
}
func (p *Header) SetSpecificationExtension(val []*NamedAny) {
	p.SpecificationExtension = val
}

var fieldIDToName_Header = map[int16]string{
	1:  "description",
	2:  "required",
	3:  "deprecated",
	4:  "allow_empty_value",
	5:  "style",
	6:  "explode",
	7:  "allow_reserved",
	8:  "schema",
	9:  "example",
	10: "examples",
	11: "content",
	12: "specification_extension",
}

func (p *Header) IsSetSchema() bool {
	return p.Schema != nil
}

func (p *Header) IsSetExample() bool {
	return p.Example != nil
}

func (p *Header) IsSetExamples() bool {
	return p.Examples != nil
}

func (p *Header) IsSetContent() bool {
	return p.Content != nil
}

func (p *Header) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 2:
			if fieldTypeId == thrift.BOOL {
				if err = p.ReadField2(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 3:
			if fieldTypeId == thrift.BOOL {
				if err = p.ReadField3(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 4:
			if fieldTypeId == thrift.BOOL {
				if err = p.ReadField4(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 5:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField5(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 6:
			if fieldTypeId == thrift.BOOL {
				if err = p.ReadField6(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 7:
			if fieldTypeId == thrift.BOOL {
				if err = p.ReadField7(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 8:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField8(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 9:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField9(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 10:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField10(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 11:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField11(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 12:
			if fieldTypeId == thrift.LIST {
				if err = p.ReadField12(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}
		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_Header[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *Header) ReadField1(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Description = _field
	return nil
}
func (p *Header) ReadField2(iprot thrift.TProtocol) error {

	var _field bool
	if v, err := iprot.ReadBool(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Required = _field
	return nil
}
func (p *Header) ReadField3(iprot thrift.TProtocol) error {

	var _field bool
	if v, err := iprot.ReadBool(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Deprecated = _field
	return nil
}
func (p *Header) ReadField4(iprot thrift.TProtocol) error {

	var _field bool
	if v, err := iprot.ReadBool(); err != nil {
		return err
	} else {
		_field = v
	}
	p.AllowEmptyValue = _field
	return nil
}
func (p *Header) ReadField5(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Style = _field
	return nil
}
func (p *Header) ReadField6(iprot thrift.TProtocol) error {

	var _field bool
	if v, err := iprot.ReadBool(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Explode = _field
	return nil
}
func (p *Header) ReadField7(iprot thrift.TProtocol) error {

	var _field bool
	if v, err := iprot.ReadBool(); err != nil {
		return err
	} else {
		_field = v
	}
	p.AllowReserved = _field
	return nil
}
func (p *Header) ReadField8(iprot thrift.TProtocol) error {
	_field := NewSchemaOrReference()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Schema = _field
	return nil
}
func (p *Header) ReadField9(iprot thrift.TProtocol) error {
	_field := NewAny()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Example = _field
	return nil
}
func (p *Header) ReadField10(iprot thrift.TProtocol) error {
	_field := NewExamplesOrReferences()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Examples = _field
	return nil
}
func (p *Header) ReadField11(iprot thrift.TProtocol) error {
	_field := NewMediaTypes()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Content = _field
	return nil
}
func (p *Header) ReadField12(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	_field := make([]*NamedAny, 0, size)
	values := make([]NamedAny, size)
	for i := 0; i < size; i++ {
		_elem := &values[i]
		_elem.InitDefault()

		if err := _elem.Read(iprot); err != nil {
			return err
		}

		_field = append(_field, _elem)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return err
	}
	p.SpecificationExtension = _field
	return nil
}

func (p *Header) Write(oprot thrift.TProtocol) (err error) {

	var fieldId int16
	if err = oprot.WriteStructBegin("Header"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
		if err = p.writeField2(oprot); err != nil {
			fieldId = 2
			goto WriteFieldError
		}
		if err = p.writeField3(oprot); err != nil {
			fieldId = 3
			goto WriteFieldError
		}
		if err = p.writeField4(oprot); err != nil {
			fieldId = 4
			goto WriteFieldError
		}
		if err = p.writeField5(oprot); err != nil {
			fieldId = 5
			goto WriteFieldError
		}
		if err = p.writeField6(oprot); err != nil {
			fieldId = 6
			goto WriteFieldError
		}
		if err = p.writeField7(oprot); err != nil {
			fieldId = 7
			goto WriteFieldError
		}
		if err = p.writeField8(oprot); err != nil {
			fieldId = 8
			goto WriteFieldError
		}
		if err = p.writeField9(oprot); err != nil {
			fieldId = 9
			goto WriteFieldError
		}
		if err = p.writeField10(oprot); err != nil {
			fieldId = 10
			goto WriteFieldError
		}
		if err = p.writeField11(oprot); err != nil {
			fieldId = 11
			goto WriteFieldError
		}
		if err = p.writeField12(oprot); err != nil {
			fieldId = 12
			goto WriteFieldError
		}
	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *Header) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("description", thrift.STRING, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.Description); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *Header) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("required", thrift.BOOL, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteBool(p.Required); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err)
}

func (p *Header) writeField3(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("deprecated", thrift.BOOL, 3); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteBool(p.Deprecated); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err)
}

func (p *Header) writeField4(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("allow_empty_value", thrift.BOOL, 4); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteBool(p.AllowEmptyValue); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err)
}

func (p *Header) writeField5(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("style", thrift.STRING, 5); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.Style); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err)
}

func (p *Header) writeField6(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("explode", thrift.BOOL, 6); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteBool(p.Explode); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 6 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err)
}

func (p *Header) writeField7(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("allow_reserved", thrift.BOOL, 7); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteBool(p.AllowReserved); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 7 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 7 end error: ", p), err)
}

func (p *Header) writeField8(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("schema", thrift.STRUCT, 8); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Schema.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 8 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 8 end error: ", p), err)
}

func (p *Header) writeField9(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("example", thrift.STRUCT, 9); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Example.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 9 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 9 end error: ", p), err)
}

func (p *Header) writeField10(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("examples", thrift.STRUCT, 10); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Examples.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 10 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 10 end error: ", p), err)
}

func (p *Header) writeField11(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("content", thrift.STRUCT, 11); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Content.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 11 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 11 end error: ", p), err)
}

func (p *Header) writeField12(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("specification_extension", thrift.LIST, 12); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.SpecificationExtension)); err != nil {
		return err
	}
	for _, v := range p.SpecificationExtension {
		if err := v.Write(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 12 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 12 end error: ", p), err)
}

func (p *Header) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("Header(%+v)", *p)

}

func (p *Header) DeepEqual(ano *Header) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.Description) {
		return false
	}
	if !p.Field2DeepEqual(ano.Required) {
		return false
	}
	if !p.Field3DeepEqual(ano.Deprecated) {
		return false
	}
	if !p.Field4DeepEqual(ano.AllowEmptyValue) {
		return false
	}
	if !p.Field5DeepEqual(ano.Style) {
		return false
	}
	if !p.Field6DeepEqual(ano.Explode) {
		return false
	}
	if !p.Field7DeepEqual(ano.AllowReserved) {
		return false
	}
	if !p.Field8DeepEqual(ano.Schema) {
		return false
	}
	if !p.Field9DeepEqual(ano.Example) {
		return false
	}
	if !p.Field10DeepEqual(ano.Examples) {
		return false
	}
	if !p.Field11DeepEqual(ano.Content) {
		return false
	}
	if !p.Field12DeepEqual(ano.SpecificationExtension) {
		return false
	}
	return true
}

func (p *Header) Field1DeepEqual(src string) bool {

	if strings.Compare(p.Description, src) != 0 {
		return false
	}
	return true
}
func (p *Header) Field2DeepEqual(src bool) bool {

	if p.Required != src {
		return false
	}
	return true
}
func (p *Header) Field3DeepEqual(src bool) bool {

	if p.Deprecated != src {
		return false
	}
	return true
}
func (p *Header) Field4DeepEqual(src bool) bool {

	if p.AllowEmptyValue != src {
		return false
	}
	return true
}
func (p *Header) Field5DeepEqual(src string) bool {

	if strings.Compare(p.Style, src) != 0 {
		return false
	}
	return true
}
func (p *Header) Field6DeepEqual(src bool) bool {

	if p.Explode != src {
		return false
	}
	return true
}
func (p *Header) Field7DeepEqual(src bool) bool {

	if p.AllowReserved != src {
		return false
	}
	return true
}
func (p *Header) Field8DeepEqual(src *SchemaOrReference) bool {

	if !p.Schema.DeepEqual(src) {
		return false
	}
	return true
}
func (p *Header) Field9DeepEqual(src *Any) bool {

	if !p.Example.DeepEqual(src) {
		return false
	}
	return true
}
func (p *Header) Field10DeepEqual(src *ExamplesOrReferences) bool {

	if !p.Examples.DeepEqual(src) {
		return false
	}
	return true
}
func (p *Header) Field11DeepEqual(src *MediaTypes) bool {

	if !p.Content.DeepEqual(src) {
		return false
	}
	return true
}
func (p *Header) Field12DeepEqual(src []*NamedAny) bool {

	if len(p.SpecificationExtension) != len(src) {
		return false
	}
	for i, v := range p.SpecificationExtension {
		_src := src[i]
		if !v.DeepEqual(_src) {
			return false
		}
	}
	return true
}

type HeaderOrReference struct {
	Header    *Header    `thrift:"header,1" frugal:"1,default,Header" json:"header"`
	Reference *Reference `thrift:"reference,2" frugal:"2,default,Reference" json:"reference"`
}

func NewHeaderOrReference() *HeaderOrReference {
	return &HeaderOrReference{}
}

func (p *HeaderOrReference) InitDefault() {
}

var HeaderOrReference_Header_DEFAULT *Header

func (p *HeaderOrReference) GetHeader() (v *Header) {
	if !p.IsSetHeader() {
		return HeaderOrReference_Header_DEFAULT
	}
	return p.Header
}

var HeaderOrReference_Reference_DEFAULT *Reference

func (p *HeaderOrReference) GetReference() (v *Reference) {
	if !p.IsSetReference() {
		return HeaderOrReference_Reference_DEFAULT
	}
	return p.Reference
}
func (p *HeaderOrReference) SetHeader(val *Header) {
	p.Header = val
}
func (p *HeaderOrReference) SetReference(val *Reference) {
	p.Reference = val
}

var fieldIDToName_HeaderOrReference = map[int16]string{
	1: "header",
	2: "reference",
}

func (p *HeaderOrReference) IsSetHeader() bool {
	return p.Header != nil
}

func (p *HeaderOrReference) IsSetReference() bool {
	return p.Reference != nil
}

func (p *HeaderOrReference) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 2:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField2(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}
		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_HeaderOrReference[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *HeaderOrReference) ReadField1(iprot thrift.TProtocol) error {
	_field := NewHeader()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Header = _field
	return nil
}
func (p *HeaderOrReference) ReadField2(iprot thrift.TProtocol) error {
	_field := NewReference()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Reference = _field
	return nil
}

func (p *HeaderOrReference) Write(oprot thrift.TProtocol) (err error) {

	var fieldId int16
	if err = oprot.WriteStructBegin("HeaderOrReference"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
		if err = p.writeField2(oprot); err != nil {
			fieldId = 2
			goto WriteFieldError
		}
	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *HeaderOrReference) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("header", thrift.STRUCT, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Header.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *HeaderOrReference) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("reference", thrift.STRUCT, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Reference.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err)
}

func (p *HeaderOrReference) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("HeaderOrReference(%+v)", *p)

}

func (p *HeaderOrReference) DeepEqual(ano *HeaderOrReference) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.Header) {
		return false
	}
	if !p.Field2DeepEqual(ano.Reference) {
		return false
	}
	return true
}

func (p *HeaderOrReference) Field1DeepEqual(src *Header) bool {

	if !p.Header.DeepEqual(src) {
		return false
	}
	return true
}
func (p *HeaderOrReference) Field2DeepEqual(src *Reference) bool {

	if !p.Reference.DeepEqual(src) {
		return false
	}
	return true
}

type HeadersOrReferences struct {
	AdditionalProperties []*NamedHeaderOrReference `thrift:"additional_properties,1" frugal:"1,default,list<NamedHeaderOrReference>" json:"additional_properties"`
}

func NewHeadersOrReferences() *HeadersOrReferences {
	return &HeadersOrReferences{}
}

func (p *HeadersOrReferences) InitDefault() {
}

func (p *HeadersOrReferences) GetAdditionalProperties() (v []*NamedHeaderOrReference) {
	return p.AdditionalProperties
}
func (p *HeadersOrReferences) SetAdditionalProperties(val []*NamedHeaderOrReference) {
	p.AdditionalProperties = val
}

var fieldIDToName_HeadersOrReferences = map[int16]string{
	1: "additional_properties",
}

func (p *HeadersOrReferences) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.LIST {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}
		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_HeadersOrReferences[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *HeadersOrReferences) ReadField1(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	_field := make([]*NamedHeaderOrReference, 0, size)
	values := make([]NamedHeaderOrReference, size)
	for i := 0; i < size; i++ {
		_elem := &values[i]
		_elem.InitDefault()

		if err := _elem.Read(iprot); err != nil {
			return err
		}

		_field = append(_field, _elem)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return err
	}
	p.AdditionalProperties = _field
	return nil
}

func (p *HeadersOrReferences) Write(oprot thrift.TProtocol) (err error) {

	var fieldId int16
	if err = oprot.WriteStructBegin("HeadersOrReferences"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *HeadersOrReferences) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("additional_properties", thrift.LIST, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.AdditionalProperties)); err != nil {
		return err
	}
	for _, v := range p.AdditionalProperties {
		if err := v.Write(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *HeadersOrReferences) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("HeadersOrReferences(%+v)", *p)

}

func (p *HeadersOrReferences) DeepEqual(ano *HeadersOrReferences) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.AdditionalProperties) {
		return false
	}
	return true
}

func (p *HeadersOrReferences) Field1DeepEqual(src []*NamedHeaderOrReference) bool {

	if len(p.AdditionalProperties) != len(src) {
		return false
	}
	for i, v := range p.AdditionalProperties {
		_src := src[i]
		if !v.DeepEqual(_src) {
			return false
		}
	}
	return true
}

type Info struct {
	Title                  string      `thrift:"title,1" frugal:"1,default,string" json:"title"`
	Description            string      `thrift:"description,2" frugal:"2,default,string" json:"description"`
	TermsOfService         string      `thrift:"terms_of_service,3" frugal:"3,default,string" json:"terms_of_service"`
	Contact                *Contact    `thrift:"contact,4" frugal:"4,default,Contact" json:"contact"`
	License                *License    `thrift:"license,5" frugal:"5,default,License" json:"license"`
	Version                string      `thrift:"version,6" frugal:"6,default,string" json:"version"`
	SpecificationExtension []*NamedAny `thrift:"specification_extension,7" frugal:"7,default,list<NamedAny>" json:"specification_extension"`
	Summary                string      `thrift:"summary,8" frugal:"8,default,string" json:"summary"`
}

func NewInfo() *Info {
	return &Info{}
}

func (p *Info) InitDefault() {
}

func (p *Info) GetTitle() (v string) {
	return p.Title
}

func (p *Info) GetDescription() (v string) {
	return p.Description
}

func (p *Info) GetTermsOfService() (v string) {
	return p.TermsOfService
}

var Info_Contact_DEFAULT *Contact

func (p *Info) GetContact() (v *Contact) {
	if !p.IsSetContact() {
		return Info_Contact_DEFAULT
	}
	return p.Contact
}

var Info_License_DEFAULT *License

func (p *Info) GetLicense() (v *License) {
	if !p.IsSetLicense() {
		return Info_License_DEFAULT
	}
	return p.License
}

func (p *Info) GetVersion() (v string) {
	return p.Version
}

func (p *Info) GetSpecificationExtension() (v []*NamedAny) {
	return p.SpecificationExtension
}

func (p *Info) GetSummary() (v string) {
	return p.Summary
}
func (p *Info) SetTitle(val string) {
	p.Title = val
}
func (p *Info) SetDescription(val string) {
	p.Description = val
}
func (p *Info) SetTermsOfService(val string) {
	p.TermsOfService = val
}
func (p *Info) SetContact(val *Contact) {
	p.Contact = val
}
func (p *Info) SetLicense(val *License) {
	p.License = val
}
func (p *Info) SetVersion(val string) {
	p.Version = val
}
func (p *Info) SetSpecificationExtension(val []*NamedAny) {
	p.SpecificationExtension = val
}
func (p *Info) SetSummary(val string) {
	p.Summary = val
}

var fieldIDToName_Info = map[int16]string{
	1: "title",
	2: "description",
	3: "terms_of_service",
	4: "contact",
	5: "license",
	6: "version",
	7: "specification_extension",
	8: "summary",
}

func (p *Info) IsSetContact() bool {
	return p.Contact != nil
}

func (p *Info) IsSetLicense() bool {
	return p.License != nil
}

func (p *Info) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 2:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField2(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 3:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField3(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 4:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField4(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 5:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField5(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 6:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField6(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 7:
			if fieldTypeId == thrift.LIST {
				if err = p.ReadField7(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 8:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField8(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}
		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_Info[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *Info) ReadField1(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Title = _field
	return nil
}
func (p *Info) ReadField2(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Description = _field
	return nil
}
func (p *Info) ReadField3(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p.TermsOfService = _field
	return nil
}
func (p *Info) ReadField4(iprot thrift.TProtocol) error {
	_field := NewContact()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Contact = _field
	return nil
}
func (p *Info) ReadField5(iprot thrift.TProtocol) error {
	_field := NewLicense()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.License = _field
	return nil
}
func (p *Info) ReadField6(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Version = _field
	return nil
}
func (p *Info) ReadField7(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	_field := make([]*NamedAny, 0, size)
	values := make([]NamedAny, size)
	for i := 0; i < size; i++ {
		_elem := &values[i]
		_elem.InitDefault()

		if err := _elem.Read(iprot); err != nil {
			return err
		}

		_field = append(_field, _elem)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return err
	}
	p.SpecificationExtension = _field
	return nil
}
func (p *Info) ReadField8(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Summary = _field
	return nil
}

func (p *Info) Write(oprot thrift.TProtocol) (err error) {

	var fieldId int16
	if err = oprot.WriteStructBegin("Info"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
		if err = p.writeField2(oprot); err != nil {
			fieldId = 2
			goto WriteFieldError
		}
		if err = p.writeField3(oprot); err != nil {
			fieldId = 3
			goto WriteFieldError
		}
		if err = p.writeField4(oprot); err != nil {
			fieldId = 4
			goto WriteFieldError
		}
		if err = p.writeField5(oprot); err != nil {
			fieldId = 5
			goto WriteFieldError
		}
		if err = p.writeField6(oprot); err != nil {
			fieldId = 6
			goto WriteFieldError
		}
		if err = p.writeField7(oprot); err != nil {
			fieldId = 7
			goto WriteFieldError
		}
		if err = p.writeField8(oprot); err != nil {
			fieldId = 8
			goto WriteFieldError
		}
	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *Info) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("title", thrift.STRING, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.Title); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *Info) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("description", thrift.STRING, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.Description); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err)
}

func (p *Info) writeField3(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("terms_of_service", thrift.STRING, 3); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.TermsOfService); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err)
}

func (p *Info) writeField4(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("contact", thrift.STRUCT, 4); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Contact.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err)
}

func (p *Info) writeField5(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("license", thrift.STRUCT, 5); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.License.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err)
}

func (p *Info) writeField6(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("version", thrift.STRING, 6); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.Version); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 6 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err)
}

func (p *Info) writeField7(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("specification_extension", thrift.LIST, 7); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.SpecificationExtension)); err != nil {
		return err
	}
	for _, v := range p.SpecificationExtension {
		if err := v.Write(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 7 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 7 end error: ", p), err)
}

func (p *Info) writeField8(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("summary", thrift.STRING, 8); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.Summary); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 8 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 8 end error: ", p), err)
}

func (p *Info) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("Info(%+v)", *p)

}

func (p *Info) DeepEqual(ano *Info) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.Title) {
		return false
	}
	if !p.Field2DeepEqual(ano.Description) {
		return false
	}
	if !p.Field3DeepEqual(ano.TermsOfService) {
		return false
	}
	if !p.Field4DeepEqual(ano.Contact) {
		return false
	}
	if !p.Field5DeepEqual(ano.License) {
		return false
	}
	if !p.Field6DeepEqual(ano.Version) {
		return false
	}
	if !p.Field7DeepEqual(ano.SpecificationExtension) {
		return false
	}
	if !p.Field8DeepEqual(ano.Summary) {
		return false
	}
	return true
}

func (p *Info) Field1DeepEqual(src string) bool {

	if strings.Compare(p.Title, src) != 0 {
		return false
	}
	return true
}
func (p *Info) Field2DeepEqual(src string) bool {

	if strings.Compare(p.Description, src) != 0 {
		return false
	}
	return true
}
func (p *Info) Field3DeepEqual(src string) bool {

	if strings.Compare(p.TermsOfService, src) != 0 {
		return false
	}
	return true
}
func (p *Info) Field4DeepEqual(src *Contact) bool {

	if !p.Contact.DeepEqual(src) {
		return false
	}
	return true
}
func (p *Info) Field5DeepEqual(src *License) bool {

	if !p.License.DeepEqual(src) {
		return false
	}
	return true
}
func (p *Info) Field6DeepEqual(src string) bool {

	if strings.Compare(p.Version, src) != 0 {
		return false
	}
	return true
}
func (p *Info) Field7DeepEqual(src []*NamedAny) bool {

	if len(p.SpecificationExtension) != len(src) {
		return false
	}
	for i, v := range p.SpecificationExtension {
		_src := src[i]
		if !v.DeepEqual(_src) {
			return false
		}
	}
	return true
}
func (p *Info) Field8DeepEqual(src string) bool {

	if strings.Compare(p.Summary, src) != 0 {
		return false
	}
	return true
}

type ItemsItem struct {
	SchemaOrReference []*SchemaOrReference `thrift:"schema_or_reference,1" frugal:"1,default,list<SchemaOrReference>" json:"schema_or_reference"`
}

func NewItemsItem() *ItemsItem {
	return &ItemsItem{}
}

func (p *ItemsItem) InitDefault() {
}

func (p *ItemsItem) GetSchemaOrReference() (v []*SchemaOrReference) {
	return p.SchemaOrReference
}
func (p *ItemsItem) SetSchemaOrReference(val []*SchemaOrReference) {
	p.SchemaOrReference = val
}

var fieldIDToName_ItemsItem = map[int16]string{
	1: "schema_or_reference",
}

func (p *ItemsItem) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.LIST {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}
		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_ItemsItem[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *ItemsItem) ReadField1(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	_field := make([]*SchemaOrReference, 0, size)
	values := make([]SchemaOrReference, size)
	for i := 0; i < size; i++ {
		_elem := &values[i]
		_elem.InitDefault()

		if err := _elem.Read(iprot); err != nil {
			return err
		}

		_field = append(_field, _elem)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return err
	}
	p.SchemaOrReference = _field
	return nil
}

func (p *ItemsItem) Write(oprot thrift.TProtocol) (err error) {

	var fieldId int16
	if err = oprot.WriteStructBegin("ItemsItem"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *ItemsItem) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("schema_or_reference", thrift.LIST, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.SchemaOrReference)); err != nil {
		return err
	}
	for _, v := range p.SchemaOrReference {
		if err := v.Write(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *ItemsItem) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("ItemsItem(%+v)", *p)

}

func (p *ItemsItem) DeepEqual(ano *ItemsItem) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.SchemaOrReference) {
		return false
	}
	return true
}

func (p *ItemsItem) Field1DeepEqual(src []*SchemaOrReference) bool {

	if len(p.SchemaOrReference) != len(src) {
		return false
	}
	for i, v := range p.SchemaOrReference {
		_src := src[i]
		if !v.DeepEqual(_src) {
			return false
		}
	}
	return true
}

type License struct {
	Name                   string      `thrift:"name,1" frugal:"1,default,string" json:"name"`
	Url                    string      `thrift:"url,2" frugal:"2,default,string" json:"url"`
	SpecificationExtension []*NamedAny `thrift:"specification_extension,3" frugal:"3,default,list<NamedAny>" json:"specification_extension"`
}

func NewLicense() *License {
	return &License{}
}

func (p *License) InitDefault() {
}

func (p *License) GetName() (v string) {
	return p.Name
}

func (p *License) GetUrl() (v string) {
	return p.Url
}

func (p *License) GetSpecificationExtension() (v []*NamedAny) {
	return p.SpecificationExtension
}
func (p *License) SetName(val string) {
	p.Name = val
}
func (p *License) SetUrl(val string) {
	p.Url = val
}
func (p *License) SetSpecificationExtension(val []*NamedAny) {
	p.SpecificationExtension = val
}

var fieldIDToName_License = map[int16]string{
	1: "name",
	2: "url",
	3: "specification_extension",
}

func (p *License) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 2:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField2(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 3:
			if fieldTypeId == thrift.LIST {
				if err = p.ReadField3(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}
		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_License[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *License) ReadField1(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Name = _field
	return nil
}
func (p *License) ReadField2(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Url = _field
	return nil
}
func (p *License) ReadField3(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	_field := make([]*NamedAny, 0, size)
	values := make([]NamedAny, size)
	for i := 0; i < size; i++ {
		_elem := &values[i]
		_elem.InitDefault()

		if err := _elem.Read(iprot); err != nil {
			return err
		}

		_field = append(_field, _elem)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return err
	}
	p.SpecificationExtension = _field
	return nil
}

func (p *License) Write(oprot thrift.TProtocol) (err error) {

	var fieldId int16
	if err = oprot.WriteStructBegin("License"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
		if err = p.writeField2(oprot); err != nil {
			fieldId = 2
			goto WriteFieldError
		}
		if err = p.writeField3(oprot); err != nil {
			fieldId = 3
			goto WriteFieldError
		}
	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *License) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("name", thrift.STRING, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.Name); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *License) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("url", thrift.STRING, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.Url); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err)
}

func (p *License) writeField3(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("specification_extension", thrift.LIST, 3); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.SpecificationExtension)); err != nil {
		return err
	}
	for _, v := range p.SpecificationExtension {
		if err := v.Write(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err)
}

func (p *License) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("License(%+v)", *p)

}

func (p *License) DeepEqual(ano *License) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.Name) {
		return false
	}
	if !p.Field2DeepEqual(ano.Url) {
		return false
	}
	if !p.Field3DeepEqual(ano.SpecificationExtension) {
		return false
	}
	return true
}

func (p *License) Field1DeepEqual(src string) bool {

	if strings.Compare(p.Name, src) != 0 {
		return false
	}
	return true
}
func (p *License) Field2DeepEqual(src string) bool {

	if strings.Compare(p.Url, src) != 0 {
		return false
	}
	return true
}
func (p *License) Field3DeepEqual(src []*NamedAny) bool {

	if len(p.SpecificationExtension) != len(src) {
		return false
	}
	for i, v := range p.SpecificationExtension {
		_src := src[i]
		if !v.DeepEqual(_src) {
			return false
		}
	}
	return true
}

type Link struct {
	OperationRef           string           `thrift:"operation_ref,1" frugal:"1,default,string" json:"operation_ref"`
	OperationId            string           `thrift:"operation_id,2" frugal:"2,default,string" json:"operation_id"`
	Parameters             *AnyOrExpression `thrift:"parameters,3" frugal:"3,default,AnyOrExpression" json:"parameters"`
	RequestBody            *AnyOrExpression `thrift:"request_body,4" frugal:"4,default,AnyOrExpression" json:"request_body"`
	Description            string           `thrift:"description,5" frugal:"5,default,string" json:"description"`
	Server                 *Server          `thrift:"server,6" frugal:"6,default,Server" json:"server"`
	SpecificationExtension []*NamedAny      `thrift:"specification_extension,7" frugal:"7,default,list<NamedAny>" json:"specification_extension"`
}

func NewLink() *Link {
	return &Link{}
}

func (p *Link) InitDefault() {
}

func (p *Link) GetOperationRef() (v string) {
	return p.OperationRef
}

func (p *Link) GetOperationId() (v string) {
	return p.OperationId
}

var Link_Parameters_DEFAULT *AnyOrExpression

func (p *Link) GetParameters() (v *AnyOrExpression) {
	if !p.IsSetParameters() {
		return Link_Parameters_DEFAULT
	}
	return p.Parameters
}

var Link_RequestBody_DEFAULT *AnyOrExpression

func (p *Link) GetRequestBody() (v *AnyOrExpression) {
	if !p.IsSetRequestBody() {
		return Link_RequestBody_DEFAULT
	}
	return p.RequestBody
}

func (p *Link) GetDescription() (v string) {
	return p.Description
}

var Link_Server_DEFAULT *Server

func (p *Link) GetServer() (v *Server) {
	if !p.IsSetServer() {
		return Link_Server_DEFAULT
	}
	return p.Server
}

func (p *Link) GetSpecificationExtension() (v []*NamedAny) {
	return p.SpecificationExtension
}
func (p *Link) SetOperationRef(val string) {
	p.OperationRef = val
}
func (p *Link) SetOperationId(val string) {
	p.OperationId = val
}
func (p *Link) SetParameters(val *AnyOrExpression) {
	p.Parameters = val
}
func (p *Link) SetRequestBody(val *AnyOrExpression) {
	p.RequestBody = val
}
func (p *Link) SetDescription(val string) {
	p.Description = val
}
func (p *Link) SetServer(val *Server) {
	p.Server = val
}
func (p *Link) SetSpecificationExtension(val []*NamedAny) {
	p.SpecificationExtension = val
}

var fieldIDToName_Link = map[int16]string{
	1: "operation_ref",
	2: "operation_id",
	3: "parameters",
	4: "request_body",
	5: "description",
	6: "server",
	7: "specification_extension",
}

func (p *Link) IsSetParameters() bool {
	return p.Parameters != nil
}

func (p *Link) IsSetRequestBody() bool {
	return p.RequestBody != nil
}

func (p *Link) IsSetServer() bool {
	return p.Server != nil
}

func (p *Link) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 2:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField2(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 3:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField3(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 4:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField4(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 5:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField5(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 6:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField6(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 7:
			if fieldTypeId == thrift.LIST {
				if err = p.ReadField7(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}
		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_Link[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *Link) ReadField1(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p.OperationRef = _field
	return nil
}
func (p *Link) ReadField2(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p.OperationId = _field
	return nil
}
func (p *Link) ReadField3(iprot thrift.TProtocol) error {
	_field := NewAnyOrExpression()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Parameters = _field
	return nil
}
func (p *Link) ReadField4(iprot thrift.TProtocol) error {
	_field := NewAnyOrExpression()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.RequestBody = _field
	return nil
}
func (p *Link) ReadField5(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Description = _field
	return nil
}
func (p *Link) ReadField6(iprot thrift.TProtocol) error {
	_field := NewServer()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Server = _field
	return nil
}
func (p *Link) ReadField7(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	_field := make([]*NamedAny, 0, size)
	values := make([]NamedAny, size)
	for i := 0; i < size; i++ {
		_elem := &values[i]
		_elem.InitDefault()

		if err := _elem.Read(iprot); err != nil {
			return err
		}

		_field = append(_field, _elem)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return err
	}
	p.SpecificationExtension = _field
	return nil
}

func (p *Link) Write(oprot thrift.TProtocol) (err error) {

	var fieldId int16
	if err = oprot.WriteStructBegin("Link"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
		if err = p.writeField2(oprot); err != nil {
			fieldId = 2
			goto WriteFieldError
		}
		if err = p.writeField3(oprot); err != nil {
			fieldId = 3
			goto WriteFieldError
		}
		if err = p.writeField4(oprot); err != nil {
			fieldId = 4
			goto WriteFieldError
		}
		if err = p.writeField5(oprot); err != nil {
			fieldId = 5
			goto WriteFieldError
		}
		if err = p.writeField6(oprot); err != nil {
			fieldId = 6
			goto WriteFieldError
		}
		if err = p.writeField7(oprot); err != nil {
			fieldId = 7
			goto WriteFieldError
		}
	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *Link) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("operation_ref", thrift.STRING, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.OperationRef); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *Link) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("operation_id", thrift.STRING, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.OperationId); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err)
}

func (p *Link) writeField3(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("parameters", thrift.STRUCT, 3); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Parameters.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err)
}

func (p *Link) writeField4(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("request_body", thrift.STRUCT, 4); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.RequestBody.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err)
}

func (p *Link) writeField5(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("description", thrift.STRING, 5); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.Description); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err)
}

func (p *Link) writeField6(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("server", thrift.STRUCT, 6); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Server.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 6 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err)
}

func (p *Link) writeField7(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("specification_extension", thrift.LIST, 7); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.SpecificationExtension)); err != nil {
		return err
	}
	for _, v := range p.SpecificationExtension {
		if err := v.Write(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 7 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 7 end error: ", p), err)
}

func (p *Link) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("Link(%+v)", *p)

}

func (p *Link) DeepEqual(ano *Link) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.OperationRef) {
		return false
	}
	if !p.Field2DeepEqual(ano.OperationId) {
		return false
	}
	if !p.Field3DeepEqual(ano.Parameters) {
		return false
	}
	if !p.Field4DeepEqual(ano.RequestBody) {
		return false
	}
	if !p.Field5DeepEqual(ano.Description) {
		return false
	}
	if !p.Field6DeepEqual(ano.Server) {
		return false
	}
	if !p.Field7DeepEqual(ano.SpecificationExtension) {
		return false
	}
	return true
}

func (p *Link) Field1DeepEqual(src string) bool {

	if strings.Compare(p.OperationRef, src) != 0 {
		return false
	}
	return true
}
func (p *Link) Field2DeepEqual(src string) bool {

	if strings.Compare(p.OperationId, src) != 0 {
		return false
	}
	return true
}
func (p *Link) Field3DeepEqual(src *AnyOrExpression) bool {

	if !p.Parameters.DeepEqual(src) {
		return false
	}
	return true
}
func (p *Link) Field4DeepEqual(src *AnyOrExpression) bool {

	if !p.RequestBody.DeepEqual(src) {
		return false
	}
	return true
}
func (p *Link) Field5DeepEqual(src string) bool {

	if strings.Compare(p.Description, src) != 0 {
		return false
	}
	return true
}
func (p *Link) Field6DeepEqual(src *Server) bool {

	if !p.Server.DeepEqual(src) {
		return false
	}
	return true
}
func (p *Link) Field7DeepEqual(src []*NamedAny) bool {

	if len(p.SpecificationExtension) != len(src) {
		return false
	}
	for i, v := range p.SpecificationExtension {
		_src := src[i]
		if !v.DeepEqual(_src) {
			return false
		}
	}
	return true
}

type LinkOrReference struct {
	Link      *Link      `thrift:"link,1" frugal:"1,default,Link" json:"link"`
	Reference *Reference `thrift:"reference,2" frugal:"2,default,Reference" json:"reference"`
}

func NewLinkOrReference() *LinkOrReference {
	return &LinkOrReference{}
}

func (p *LinkOrReference) InitDefault() {
}

var LinkOrReference_Link_DEFAULT *Link

func (p *LinkOrReference) GetLink() (v *Link) {
	if !p.IsSetLink() {
		return LinkOrReference_Link_DEFAULT
	}
	return p.Link
}

var LinkOrReference_Reference_DEFAULT *Reference

func (p *LinkOrReference) GetReference() (v *Reference) {
	if !p.IsSetReference() {
		return LinkOrReference_Reference_DEFAULT
	}
	return p.Reference
}
func (p *LinkOrReference) SetLink(val *Link) {
	p.Link = val
}
func (p *LinkOrReference) SetReference(val *Reference) {
	p.Reference = val
}

var fieldIDToName_LinkOrReference = map[int16]string{
	1: "link",
	2: "reference",
}

func (p *LinkOrReference) IsSetLink() bool {
	return p.Link != nil
}

func (p *LinkOrReference) IsSetReference() bool {
	return p.Reference != nil
}

func (p *LinkOrReference) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 2:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField2(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}
		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_LinkOrReference[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *LinkOrReference) ReadField1(iprot thrift.TProtocol) error {
	_field := NewLink()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Link = _field
	return nil
}
func (p *LinkOrReference) ReadField2(iprot thrift.TProtocol) error {
	_field := NewReference()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Reference = _field
	return nil
}

func (p *LinkOrReference) Write(oprot thrift.TProtocol) (err error) {

	var fieldId int16
	if err = oprot.WriteStructBegin("LinkOrReference"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
		if err = p.writeField2(oprot); err != nil {
			fieldId = 2
			goto WriteFieldError
		}
	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *LinkOrReference) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("link", thrift.STRUCT, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Link.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *LinkOrReference) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("reference", thrift.STRUCT, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Reference.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err)
}

func (p *LinkOrReference) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("LinkOrReference(%+v)", *p)

}

func (p *LinkOrReference) DeepEqual(ano *LinkOrReference) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.Link) {
		return false
	}
	if !p.Field2DeepEqual(ano.Reference) {
		return false
	}
	return true
}

func (p *LinkOrReference) Field1DeepEqual(src *Link) bool {

	if !p.Link.DeepEqual(src) {
		return false
	}
	return true
}
func (p *LinkOrReference) Field2DeepEqual(src *Reference) bool {

	if !p.Reference.DeepEqual(src) {
		return false
	}
	return true
}

type LinksOrReferences struct {
	AdditionalProperties []*NamedLinkOrReference `thrift:"additional_properties,1" frugal:"1,default,list<NamedLinkOrReference>" json:"additional_properties"`
}

func NewLinksOrReferences() *LinksOrReferences {
	return &LinksOrReferences{}
}

func (p *LinksOrReferences) InitDefault() {
}

func (p *LinksOrReferences) GetAdditionalProperties() (v []*NamedLinkOrReference) {
	return p.AdditionalProperties
}
func (p *LinksOrReferences) SetAdditionalProperties(val []*NamedLinkOrReference) {
	p.AdditionalProperties = val
}

var fieldIDToName_LinksOrReferences = map[int16]string{
	1: "additional_properties",
}

func (p *LinksOrReferences) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.LIST {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}
		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_LinksOrReferences[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *LinksOrReferences) ReadField1(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	_field := make([]*NamedLinkOrReference, 0, size)
	values := make([]NamedLinkOrReference, size)
	for i := 0; i < size; i++ {
		_elem := &values[i]
		_elem.InitDefault()

		if err := _elem.Read(iprot); err != nil {
			return err
		}

		_field = append(_field, _elem)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return err
	}
	p.AdditionalProperties = _field
	return nil
}

func (p *LinksOrReferences) Write(oprot thrift.TProtocol) (err error) {

	var fieldId int16
	if err = oprot.WriteStructBegin("LinksOrReferences"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *LinksOrReferences) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("additional_properties", thrift.LIST, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.AdditionalProperties)); err != nil {
		return err
	}
	for _, v := range p.AdditionalProperties {
		if err := v.Write(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *LinksOrReferences) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("LinksOrReferences(%+v)", *p)

}

func (p *LinksOrReferences) DeepEqual(ano *LinksOrReferences) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.AdditionalProperties) {
		return false
	}
	return true
}

func (p *LinksOrReferences) Field1DeepEqual(src []*NamedLinkOrReference) bool {

	if len(p.AdditionalProperties) != len(src) {
		return false
	}
	for i, v := range p.AdditionalProperties {
		_src := src[i]
		if !v.DeepEqual(_src) {
			return false
		}
	}
	return true
}

type MediaType struct {
	Schema                 *SchemaOrReference    `thrift:"schema,1" frugal:"1,default,SchemaOrReference" json:"schema"`
	Example                *Any                  `thrift:"example,2" frugal:"2,default,Any" json:"example"`
	Examples               *ExamplesOrReferences `thrift:"examples,3" frugal:"3,default,ExamplesOrReferences" json:"examples"`
	Encoding               *Encodings            `thrift:"encoding,4" frugal:"4,default,Encodings" json:"encoding"`
	SpecificationExtension []*NamedAny           `thrift:"specification_extension,5" frugal:"5,default,list<NamedAny>" json:"specification_extension"`
}

func NewMediaType() *MediaType {
	return &MediaType{}
}

func (p *MediaType) InitDefault() {
}

var MediaType_Schema_DEFAULT *SchemaOrReference

func (p *MediaType) GetSchema() (v *SchemaOrReference) {
	if !p.IsSetSchema() {
		return MediaType_Schema_DEFAULT
	}
	return p.Schema
}

var MediaType_Example_DEFAULT *Any

func (p *MediaType) GetExample() (v *Any) {
	if !p.IsSetExample() {
		return MediaType_Example_DEFAULT
	}
	return p.Example
}

var MediaType_Examples_DEFAULT *ExamplesOrReferences

func (p *MediaType) GetExamples() (v *ExamplesOrReferences) {
	if !p.IsSetExamples() {
		return MediaType_Examples_DEFAULT
	}
	return p.Examples
}

var MediaType_Encoding_DEFAULT *Encodings

func (p *MediaType) GetEncoding() (v *Encodings) {
	if !p.IsSetEncoding() {
		return MediaType_Encoding_DEFAULT
	}
	return p.Encoding
}

func (p *MediaType) GetSpecificationExtension() (v []*NamedAny) {
	return p.SpecificationExtension
}
func (p *MediaType) SetSchema(val *SchemaOrReference) {
	p.Schema = val
}
func (p *MediaType) SetExample(val *Any) {
	p.Example = val
}
func (p *MediaType) SetExamples(val *ExamplesOrReferences) {
	p.Examples = val
}
func (p *MediaType) SetEncoding(val *Encodings) {
	p.Encoding = val
}
func (p *MediaType) SetSpecificationExtension(val []*NamedAny) {
	p.SpecificationExtension = val
}

var fieldIDToName_MediaType = map[int16]string{
	1: "schema",
	2: "example",
	3: "examples",
	4: "encoding",
	5: "specification_extension",
}

func (p *MediaType) IsSetSchema() bool {
	return p.Schema != nil
}

func (p *MediaType) IsSetExample() bool {
	return p.Example != nil
}

func (p *MediaType) IsSetExamples() bool {
	return p.Examples != nil
}

func (p *MediaType) IsSetEncoding() bool {
	return p.Encoding != nil
}

func (p *MediaType) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 2:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField2(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 3:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField3(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 4:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField4(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 5:
			if fieldTypeId == thrift.LIST {
				if err = p.ReadField5(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}
		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_MediaType[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *MediaType) ReadField1(iprot thrift.TProtocol) error {
	_field := NewSchemaOrReference()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Schema = _field
	return nil
}
func (p *MediaType) ReadField2(iprot thrift.TProtocol) error {
	_field := NewAny()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Example = _field
	return nil
}
func (p *MediaType) ReadField3(iprot thrift.TProtocol) error {
	_field := NewExamplesOrReferences()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Examples = _field
	return nil
}
func (p *MediaType) ReadField4(iprot thrift.TProtocol) error {
	_field := NewEncodings()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Encoding = _field
	return nil
}
func (p *MediaType) ReadField5(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	_field := make([]*NamedAny, 0, size)
	values := make([]NamedAny, size)
	for i := 0; i < size; i++ {
		_elem := &values[i]
		_elem.InitDefault()

		if err := _elem.Read(iprot); err != nil {
			return err
		}

		_field = append(_field, _elem)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return err
	}
	p.SpecificationExtension = _field
	return nil
}

func (p *MediaType) Write(oprot thrift.TProtocol) (err error) {

	var fieldId int16
	if err = oprot.WriteStructBegin("MediaType"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
		if err = p.writeField2(oprot); err != nil {
			fieldId = 2
			goto WriteFieldError
		}
		if err = p.writeField3(oprot); err != nil {
			fieldId = 3
			goto WriteFieldError
		}
		if err = p.writeField4(oprot); err != nil {
			fieldId = 4
			goto WriteFieldError
		}
		if err = p.writeField5(oprot); err != nil {
			fieldId = 5
			goto WriteFieldError
		}
	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *MediaType) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("schema", thrift.STRUCT, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Schema.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *MediaType) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("example", thrift.STRUCT, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Example.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err)
}

func (p *MediaType) writeField3(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("examples", thrift.STRUCT, 3); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Examples.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err)
}

func (p *MediaType) writeField4(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("encoding", thrift.STRUCT, 4); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Encoding.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err)
}

func (p *MediaType) writeField5(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("specification_extension", thrift.LIST, 5); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.SpecificationExtension)); err != nil {
		return err
	}
	for _, v := range p.SpecificationExtension {
		if err := v.Write(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err)
}

func (p *MediaType) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("MediaType(%+v)", *p)

}

func (p *MediaType) DeepEqual(ano *MediaType) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.Schema) {
		return false
	}
	if !p.Field2DeepEqual(ano.Example) {
		return false
	}
	if !p.Field3DeepEqual(ano.Examples) {
		return false
	}
	if !p.Field4DeepEqual(ano.Encoding) {
		return false
	}
	if !p.Field5DeepEqual(ano.SpecificationExtension) {
		return false
	}
	return true
}

func (p *MediaType) Field1DeepEqual(src *SchemaOrReference) bool {

	if !p.Schema.DeepEqual(src) {
		return false
	}
	return true
}
func (p *MediaType) Field2DeepEqual(src *Any) bool {

	if !p.Example.DeepEqual(src) {
		return false
	}
	return true
}
func (p *MediaType) Field3DeepEqual(src *ExamplesOrReferences) bool {

	if !p.Examples.DeepEqual(src) {
		return false
	}
	return true
}
func (p *MediaType) Field4DeepEqual(src *Encodings) bool {

	if !p.Encoding.DeepEqual(src) {
		return false
	}
	return true
}
func (p *MediaType) Field5DeepEqual(src []*NamedAny) bool {

	if len(p.SpecificationExtension) != len(src) {
		return false
	}
	for i, v := range p.SpecificationExtension {
		_src := src[i]
		if !v.DeepEqual(_src) {
			return false
		}
	}
	return true
}

type MediaTypes struct {
	AdditionalProperties []*NamedMediaType `thrift:"additional_properties,1" frugal:"1,default,list<NamedMediaType>" json:"additional_properties"`
}

func NewMediaTypes() *MediaTypes {
	return &MediaTypes{}
}

func (p *MediaTypes) InitDefault() {
}

func (p *MediaTypes) GetAdditionalProperties() (v []*NamedMediaType) {
	return p.AdditionalProperties
}
func (p *MediaTypes) SetAdditionalProperties(val []*NamedMediaType) {
	p.AdditionalProperties = val
}

var fieldIDToName_MediaTypes = map[int16]string{
	1: "additional_properties",
}

func (p *MediaTypes) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.LIST {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}
		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_MediaTypes[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *MediaTypes) ReadField1(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	_field := make([]*NamedMediaType, 0, size)
	values := make([]NamedMediaType, size)
	for i := 0; i < size; i++ {
		_elem := &values[i]
		_elem.InitDefault()

		if err := _elem.Read(iprot); err != nil {
			return err
		}

		_field = append(_field, _elem)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return err
	}
	p.AdditionalProperties = _field
	return nil
}

func (p *MediaTypes) Write(oprot thrift.TProtocol) (err error) {

	var fieldId int16
	if err = oprot.WriteStructBegin("MediaTypes"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *MediaTypes) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("additional_properties", thrift.LIST, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.AdditionalProperties)); err != nil {
		return err
	}
	for _, v := range p.AdditionalProperties {
		if err := v.Write(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *MediaTypes) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("MediaTypes(%+v)", *p)

}

func (p *MediaTypes) DeepEqual(ano *MediaTypes) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.AdditionalProperties) {
		return false
	}
	return true
}

func (p *MediaTypes) Field1DeepEqual(src []*NamedMediaType) bool {

	if len(p.AdditionalProperties) != len(src) {
		return false
	}
	for i, v := range p.AdditionalProperties {
		_src := src[i]
		if !v.DeepEqual(_src) {
			return false
		}
	}
	return true
}

type NamedAny struct {
	Name  string `thrift:"name,1" frugal:"1,default,string" json:"name"`
	Value *Any   `thrift:"value,2" frugal:"2,default,Any" json:"value"`
}

func NewNamedAny() *NamedAny {
	return &NamedAny{}
}

func (p *NamedAny) InitDefault() {
}

func (p *NamedAny) GetName() (v string) {
	return p.Name
}

var NamedAny_Value_DEFAULT *Any

func (p *NamedAny) GetValue() (v *Any) {
	if !p.IsSetValue() {
		return NamedAny_Value_DEFAULT
	}
	return p.Value
}
func (p *NamedAny) SetName(val string) {
	p.Name = val
}
func (p *NamedAny) SetValue(val *Any) {
	p.Value = val
}

var fieldIDToName_NamedAny = map[int16]string{
	1: "name",
	2: "value",
}

func (p *NamedAny) IsSetValue() bool {
	return p.Value != nil
}

func (p *NamedAny) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 2:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField2(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}
		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_NamedAny[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *NamedAny) ReadField1(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Name = _field
	return nil
}
func (p *NamedAny) ReadField2(iprot thrift.TProtocol) error {
	_field := NewAny()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Value = _field
	return nil
}

func (p *NamedAny) Write(oprot thrift.TProtocol) (err error) {

	var fieldId int16
	if err = oprot.WriteStructBegin("NamedAny"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
		if err = p.writeField2(oprot); err != nil {
			fieldId = 2
			goto WriteFieldError
		}
	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *NamedAny) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("name", thrift.STRING, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.Name); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *NamedAny) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("value", thrift.STRUCT, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Value.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err)
}

func (p *NamedAny) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("NamedAny(%+v)", *p)

}

func (p *NamedAny) DeepEqual(ano *NamedAny) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.Name) {
		return false
	}
	if !p.Field2DeepEqual(ano.Value) {
		return false
	}
	return true
}

func (p *NamedAny) Field1DeepEqual(src string) bool {

	if strings.Compare(p.Name, src) != 0 {
		return false
	}
	return true
}
func (p *NamedAny) Field2DeepEqual(src *Any) bool {

	if !p.Value.DeepEqual(src) {
		return false
	}
	return true
}

type NamedCallbackOrReference struct {
	Name  string               `thrift:"name,1" frugal:"1,default,string" json:"name"`
	Value *CallbackOrReference `thrift:"value,2" frugal:"2,default,CallbackOrReference" json:"value"`
}

func NewNamedCallbackOrReference() *NamedCallbackOrReference {
	return &NamedCallbackOrReference{}
}

func (p *NamedCallbackOrReference) InitDefault() {
}

func (p *NamedCallbackOrReference) GetName() (v string) {
	return p.Name
}

var NamedCallbackOrReference_Value_DEFAULT *CallbackOrReference

func (p *NamedCallbackOrReference) GetValue() (v *CallbackOrReference) {
	if !p.IsSetValue() {
		return NamedCallbackOrReference_Value_DEFAULT
	}
	return p.Value
}
func (p *NamedCallbackOrReference) SetName(val string) {
	p.Name = val
}
func (p *NamedCallbackOrReference) SetValue(val *CallbackOrReference) {
	p.Value = val
}

var fieldIDToName_NamedCallbackOrReference = map[int16]string{
	1: "name",
	2: "value",
}

func (p *NamedCallbackOrReference) IsSetValue() bool {
	return p.Value != nil
}

func (p *NamedCallbackOrReference) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 2:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField2(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}
		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_NamedCallbackOrReference[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *NamedCallbackOrReference) ReadField1(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Name = _field
	return nil
}
func (p *NamedCallbackOrReference) ReadField2(iprot thrift.TProtocol) error {
	_field := NewCallbackOrReference()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Value = _field
	return nil
}

func (p *NamedCallbackOrReference) Write(oprot thrift.TProtocol) (err error) {

	var fieldId int16
	if err = oprot.WriteStructBegin("NamedCallbackOrReference"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
		if err = p.writeField2(oprot); err != nil {
			fieldId = 2
			goto WriteFieldError
		}
	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *NamedCallbackOrReference) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("name", thrift.STRING, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.Name); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *NamedCallbackOrReference) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("value", thrift.STRUCT, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Value.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err)
}

func (p *NamedCallbackOrReference) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("NamedCallbackOrReference(%+v)", *p)

}

func (p *NamedCallbackOrReference) DeepEqual(ano *NamedCallbackOrReference) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.Name) {
		return false
	}
	if !p.Field2DeepEqual(ano.Value) {
		return false
	}
	return true
}

func (p *NamedCallbackOrReference) Field1DeepEqual(src string) bool {

	if strings.Compare(p.Name, src) != 0 {
		return false
	}
	return true
}
func (p *NamedCallbackOrReference) Field2DeepEqual(src *CallbackOrReference) bool {

	if !p.Value.DeepEqual(src) {
		return false
	}
	return true
}

type NamedEncoding struct {
	Name  string    `thrift:"name,1" frugal:"1,default,string" json:"name"`
	Value *Encoding `thrift:"value,2" frugal:"2,default,Encoding" json:"value"`
}

func NewNamedEncoding() *NamedEncoding {
	return &NamedEncoding{}
}

func (p *NamedEncoding) InitDefault() {
}

func (p *NamedEncoding) GetName() (v string) {
	return p.Name
}

var NamedEncoding_Value_DEFAULT *Encoding

func (p *NamedEncoding) GetValue() (v *Encoding) {
	if !p.IsSetValue() {
		return NamedEncoding_Value_DEFAULT
	}
	return p.Value
}
func (p *NamedEncoding) SetName(val string) {
	p.Name = val
}
func (p *NamedEncoding) SetValue(val *Encoding) {
	p.Value = val
}

var fieldIDToName_NamedEncoding = map[int16]string{
	1: "name",
	2: "value",
}

func (p *NamedEncoding) IsSetValue() bool {
	return p.Value != nil
}

func (p *NamedEncoding) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 2:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField2(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}
		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_NamedEncoding[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *NamedEncoding) ReadField1(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Name = _field
	return nil
}
func (p *NamedEncoding) ReadField2(iprot thrift.TProtocol) error {
	_field := NewEncoding()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Value = _field
	return nil
}

func (p *NamedEncoding) Write(oprot thrift.TProtocol) (err error) {

	var fieldId int16
	if err = oprot.WriteStructBegin("NamedEncoding"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
		if err = p.writeField2(oprot); err != nil {
			fieldId = 2
			goto WriteFieldError
		}
	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *NamedEncoding) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("name", thrift.STRING, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.Name); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *NamedEncoding) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("value", thrift.STRUCT, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Value.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err)
}

func (p *NamedEncoding) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("NamedEncoding(%+v)", *p)

}

func (p *NamedEncoding) DeepEqual(ano *NamedEncoding) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.Name) {
		return false
	}
	if !p.Field2DeepEqual(ano.Value) {
		return false
	}
	return true
}

func (p *NamedEncoding) Field1DeepEqual(src string) bool {

	if strings.Compare(p.Name, src) != 0 {
		return false
	}
	return true
}
func (p *NamedEncoding) Field2DeepEqual(src *Encoding) bool {

	if !p.Value.DeepEqual(src) {
		return false
	}
	return true
}

type NamedExampleOrReference struct {
	Name  string              `thrift:"name,1" frugal:"1,default,string" json:"name"`
	Value *ExampleOrReference `thrift:"value,2" frugal:"2,default,ExampleOrReference" json:"value"`
}

func NewNamedExampleOrReference() *NamedExampleOrReference {
	return &NamedExampleOrReference{}
}

func (p *NamedExampleOrReference) InitDefault() {
}

func (p *NamedExampleOrReference) GetName() (v string) {
	return p.Name
}

var NamedExampleOrReference_Value_DEFAULT *ExampleOrReference

func (p *NamedExampleOrReference) GetValue() (v *ExampleOrReference) {
	if !p.IsSetValue() {
		return NamedExampleOrReference_Value_DEFAULT
	}
	return p.Value
}
func (p *NamedExampleOrReference) SetName(val string) {
	p.Name = val
}
func (p *NamedExampleOrReference) SetValue(val *ExampleOrReference) {
	p.Value = val
}

var fieldIDToName_NamedExampleOrReference = map[int16]string{
	1: "name",
	2: "value",
}

func (p *NamedExampleOrReference) IsSetValue() bool {
	return p.Value != nil
}

func (p *NamedExampleOrReference) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 2:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField2(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}
		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_NamedExampleOrReference[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *NamedExampleOrReference) ReadField1(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Name = _field
	return nil
}
func (p *NamedExampleOrReference) ReadField2(iprot thrift.TProtocol) error {
	_field := NewExampleOrReference()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Value = _field
	return nil
}

func (p *NamedExampleOrReference) Write(oprot thrift.TProtocol) (err error) {

	var fieldId int16
	if err = oprot.WriteStructBegin("NamedExampleOrReference"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
		if err = p.writeField2(oprot); err != nil {
			fieldId = 2
			goto WriteFieldError
		}
	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *NamedExampleOrReference) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("name", thrift.STRING, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.Name); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *NamedExampleOrReference) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("value", thrift.STRUCT, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Value.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err)
}

func (p *NamedExampleOrReference) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("NamedExampleOrReference(%+v)", *p)

}

func (p *NamedExampleOrReference) DeepEqual(ano *NamedExampleOrReference) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.Name) {
		return false
	}
	if !p.Field2DeepEqual(ano.Value) {
		return false
	}
	return true
}

func (p *NamedExampleOrReference) Field1DeepEqual(src string) bool {

	if strings.Compare(p.Name, src) != 0 {
		return false
	}
	return true
}
func (p *NamedExampleOrReference) Field2DeepEqual(src *ExampleOrReference) bool {

	if !p.Value.DeepEqual(src) {
		return false
	}
	return true
}

type NamedHeaderOrReference struct {
	Name  string             `thrift:"name,1" frugal:"1,default,string" json:"name"`
	Value *HeaderOrReference `thrift:"value,2" frugal:"2,default,HeaderOrReference" json:"value"`
}

func NewNamedHeaderOrReference() *NamedHeaderOrReference {
	return &NamedHeaderOrReference{}
}

func (p *NamedHeaderOrReference) InitDefault() {
}

func (p *NamedHeaderOrReference) GetName() (v string) {
	return p.Name
}

var NamedHeaderOrReference_Value_DEFAULT *HeaderOrReference

func (p *NamedHeaderOrReference) GetValue() (v *HeaderOrReference) {
	if !p.IsSetValue() {
		return NamedHeaderOrReference_Value_DEFAULT
	}
	return p.Value
}
func (p *NamedHeaderOrReference) SetName(val string) {
	p.Name = val
}
func (p *NamedHeaderOrReference) SetValue(val *HeaderOrReference) {
	p.Value = val
}

var fieldIDToName_NamedHeaderOrReference = map[int16]string{
	1: "name",
	2: "value",
}

func (p *NamedHeaderOrReference) IsSetValue() bool {
	return p.Value != nil
}

func (p *NamedHeaderOrReference) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 2:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField2(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}
		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_NamedHeaderOrReference[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *NamedHeaderOrReference) ReadField1(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Name = _field
	return nil
}
func (p *NamedHeaderOrReference) ReadField2(iprot thrift.TProtocol) error {
	_field := NewHeaderOrReference()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Value = _field
	return nil
}

func (p *NamedHeaderOrReference) Write(oprot thrift.TProtocol) (err error) {

	var fieldId int16
	if err = oprot.WriteStructBegin("NamedHeaderOrReference"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
		if err = p.writeField2(oprot); err != nil {
			fieldId = 2
			goto WriteFieldError
		}
	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *NamedHeaderOrReference) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("name", thrift.STRING, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.Name); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *NamedHeaderOrReference) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("value", thrift.STRUCT, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Value.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err)
}

func (p *NamedHeaderOrReference) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("NamedHeaderOrReference(%+v)", *p)

}

func (p *NamedHeaderOrReference) DeepEqual(ano *NamedHeaderOrReference) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.Name) {
		return false
	}
	if !p.Field2DeepEqual(ano.Value) {
		return false
	}
	return true
}

func (p *NamedHeaderOrReference) Field1DeepEqual(src string) bool {

	if strings.Compare(p.Name, src) != 0 {
		return false
	}
	return true
}
func (p *NamedHeaderOrReference) Field2DeepEqual(src *HeaderOrReference) bool {

	if !p.Value.DeepEqual(src) {
		return false
	}
	return true
}

type NamedLinkOrReference struct {
	Name  string           `thrift:"name,1" frugal:"1,default,string" json:"name"`
	Value *LinkOrReference `thrift:"value,2" frugal:"2,default,LinkOrReference" json:"value"`
}

func NewNamedLinkOrReference() *NamedLinkOrReference {
	return &NamedLinkOrReference{}
}

func (p *NamedLinkOrReference) InitDefault() {
}

func (p *NamedLinkOrReference) GetName() (v string) {
	return p.Name
}

var NamedLinkOrReference_Value_DEFAULT *LinkOrReference

func (p *NamedLinkOrReference) GetValue() (v *LinkOrReference) {
	if !p.IsSetValue() {
		return NamedLinkOrReference_Value_DEFAULT
	}
	return p.Value
}
func (p *NamedLinkOrReference) SetName(val string) {
	p.Name = val
}
func (p *NamedLinkOrReference) SetValue(val *LinkOrReference) {
	p.Value = val
}

var fieldIDToName_NamedLinkOrReference = map[int16]string{
	1: "name",
	2: "value",
}

func (p *NamedLinkOrReference) IsSetValue() bool {
	return p.Value != nil
}

func (p *NamedLinkOrReference) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 2:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField2(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}
		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_NamedLinkOrReference[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *NamedLinkOrReference) ReadField1(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Name = _field
	return nil
}
func (p *NamedLinkOrReference) ReadField2(iprot thrift.TProtocol) error {
	_field := NewLinkOrReference()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Value = _field
	return nil
}

func (p *NamedLinkOrReference) Write(oprot thrift.TProtocol) (err error) {

	var fieldId int16
	if err = oprot.WriteStructBegin("NamedLinkOrReference"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
		if err = p.writeField2(oprot); err != nil {
			fieldId = 2
			goto WriteFieldError
		}
	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *NamedLinkOrReference) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("name", thrift.STRING, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.Name); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *NamedLinkOrReference) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("value", thrift.STRUCT, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Value.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err)
}

func (p *NamedLinkOrReference) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("NamedLinkOrReference(%+v)", *p)

}

func (p *NamedLinkOrReference) DeepEqual(ano *NamedLinkOrReference) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.Name) {
		return false
	}
	if !p.Field2DeepEqual(ano.Value) {
		return false
	}
	return true
}

func (p *NamedLinkOrReference) Field1DeepEqual(src string) bool {

	if strings.Compare(p.Name, src) != 0 {
		return false
	}
	return true
}
func (p *NamedLinkOrReference) Field2DeepEqual(src *LinkOrReference) bool {

	if !p.Value.DeepEqual(src) {
		return false
	}
	return true
}

type NamedMediaType struct {
	Name  string     `thrift:"name,1" frugal:"1,default,string" json:"name"`
	Value *MediaType `thrift:"value,2" frugal:"2,default,MediaType" json:"value"`
}

func NewNamedMediaType() *NamedMediaType {
	return &NamedMediaType{}
}

func (p *NamedMediaType) InitDefault() {
}

func (p *NamedMediaType) GetName() (v string) {
	return p.Name
}

var NamedMediaType_Value_DEFAULT *MediaType

func (p *NamedMediaType) GetValue() (v *MediaType) {
	if !p.IsSetValue() {
		return NamedMediaType_Value_DEFAULT
	}
	return p.Value
}
func (p *NamedMediaType) SetName(val string) {
	p.Name = val
}
func (p *NamedMediaType) SetValue(val *MediaType) {
	p.Value = val
}

var fieldIDToName_NamedMediaType = map[int16]string{
	1: "name",
	2: "value",
}

func (p *NamedMediaType) IsSetValue() bool {
	return p.Value != nil
}

func (p *NamedMediaType) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 2:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField2(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}
		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_NamedMediaType[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *NamedMediaType) ReadField1(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Name = _field
	return nil
}
func (p *NamedMediaType) ReadField2(iprot thrift.TProtocol) error {
	_field := NewMediaType()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Value = _field
	return nil
}

func (p *NamedMediaType) Write(oprot thrift.TProtocol) (err error) {

	var fieldId int16
	if err = oprot.WriteStructBegin("NamedMediaType"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
		if err = p.writeField2(oprot); err != nil {
			fieldId = 2
			goto WriteFieldError
		}
	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *NamedMediaType) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("name", thrift.STRING, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.Name); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *NamedMediaType) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("value", thrift.STRUCT, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Value.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err)
}

func (p *NamedMediaType) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("NamedMediaType(%+v)", *p)

}

func (p *NamedMediaType) DeepEqual(ano *NamedMediaType) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.Name) {
		return false
	}
	if !p.Field2DeepEqual(ano.Value) {
		return false
	}
	return true
}

func (p *NamedMediaType) Field1DeepEqual(src string) bool {

	if strings.Compare(p.Name, src) != 0 {
		return false
	}
	return true
}
func (p *NamedMediaType) Field2DeepEqual(src *MediaType) bool {

	if !p.Value.DeepEqual(src) {
		return false
	}
	return true
}

type NamedParameterOrReference struct {
	Name  string                `thrift:"name,1" frugal:"1,default,string" json:"name"`
	Value *ParameterOrReference `thrift:"value,2" frugal:"2,default,ParameterOrReference" json:"value"`
}

func NewNamedParameterOrReference() *NamedParameterOrReference {
	return &NamedParameterOrReference{}
}

func (p *NamedParameterOrReference) InitDefault() {
}

func (p *NamedParameterOrReference) GetName() (v string) {
	return p.Name
}

var NamedParameterOrReference_Value_DEFAULT *ParameterOrReference

func (p *NamedParameterOrReference) GetValue() (v *ParameterOrReference) {
	if !p.IsSetValue() {
		return NamedParameterOrReference_Value_DEFAULT
	}
	return p.Value
}
func (p *NamedParameterOrReference) SetName(val string) {
	p.Name = val
}
func (p *NamedParameterOrReference) SetValue(val *ParameterOrReference) {
	p.Value = val
}

var fieldIDToName_NamedParameterOrReference = map[int16]string{
	1: "name",
	2: "value",
}

func (p *NamedParameterOrReference) IsSetValue() bool {
	return p.Value != nil
}

func (p *NamedParameterOrReference) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 2:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField2(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}
		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_NamedParameterOrReference[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *NamedParameterOrReference) ReadField1(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Name = _field
	return nil
}
func (p *NamedParameterOrReference) ReadField2(iprot thrift.TProtocol) error {
	_field := NewParameterOrReference()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Value = _field
	return nil
}

func (p *NamedParameterOrReference) Write(oprot thrift.TProtocol) (err error) {

	var fieldId int16
	if err = oprot.WriteStructBegin("NamedParameterOrReference"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
		if err = p.writeField2(oprot); err != nil {
			fieldId = 2
			goto WriteFieldError
		}
	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *NamedParameterOrReference) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("name", thrift.STRING, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.Name); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *NamedParameterOrReference) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("value", thrift.STRUCT, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Value.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err)
}

func (p *NamedParameterOrReference) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("NamedParameterOrReference(%+v)", *p)

}

func (p *NamedParameterOrReference) DeepEqual(ano *NamedParameterOrReference) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.Name) {
		return false
	}
	if !p.Field2DeepEqual(ano.Value) {
		return false
	}
	return true
}

func (p *NamedParameterOrReference) Field1DeepEqual(src string) bool {

	if strings.Compare(p.Name, src) != 0 {
		return false
	}
	return true
}
func (p *NamedParameterOrReference) Field2DeepEqual(src *ParameterOrReference) bool {

	if !p.Value.DeepEqual(src) {
		return false
	}
	return true
}

type NamedPathItem struct {
	Name  string    `thrift:"name,1" frugal:"1,default,string" json:"name"`
	Value *PathItem `thrift:"value,2" frugal:"2,default,PathItem" json:"value"`
}

func NewNamedPathItem() *NamedPathItem {
	return &NamedPathItem{}
}

func (p *NamedPathItem) InitDefault() {
}

func (p *NamedPathItem) GetName() (v string) {
	return p.Name
}

var NamedPathItem_Value_DEFAULT *PathItem

func (p *NamedPathItem) GetValue() (v *PathItem) {
	if !p.IsSetValue() {
		return NamedPathItem_Value_DEFAULT
	}
	return p.Value
}
func (p *NamedPathItem) SetName(val string) {
	p.Name = val
}
func (p *NamedPathItem) SetValue(val *PathItem) {
	p.Value = val
}

var fieldIDToName_NamedPathItem = map[int16]string{
	1: "name",
	2: "value",
}

func (p *NamedPathItem) IsSetValue() bool {
	return p.Value != nil
}

func (p *NamedPathItem) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 2:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField2(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}
		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_NamedPathItem[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *NamedPathItem) ReadField1(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Name = _field
	return nil
}
func (p *NamedPathItem) ReadField2(iprot thrift.TProtocol) error {
	_field := NewPathItem()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Value = _field
	return nil
}

func (p *NamedPathItem) Write(oprot thrift.TProtocol) (err error) {

	var fieldId int16
	if err = oprot.WriteStructBegin("NamedPathItem"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
		if err = p.writeField2(oprot); err != nil {
			fieldId = 2
			goto WriteFieldError
		}
	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *NamedPathItem) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("name", thrift.STRING, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.Name); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *NamedPathItem) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("value", thrift.STRUCT, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Value.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err)
}

func (p *NamedPathItem) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("NamedPathItem(%+v)", *p)

}

func (p *NamedPathItem) DeepEqual(ano *NamedPathItem) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.Name) {
		return false
	}
	if !p.Field2DeepEqual(ano.Value) {
		return false
	}
	return true
}

func (p *NamedPathItem) Field1DeepEqual(src string) bool {

	if strings.Compare(p.Name, src) != 0 {
		return false
	}
	return true
}
func (p *NamedPathItem) Field2DeepEqual(src *PathItem) bool {

	if !p.Value.DeepEqual(src) {
		return false
	}
	return true
}

type NamedRequestBodyOrReference struct {
	Name  string                  `thrift:"name,1" frugal:"1,default,string" json:"name"`
	Value *RequestBodyOrReference `thrift:"value,2" frugal:"2,default,RequestBodyOrReference" json:"value"`
}

func NewNamedRequestBodyOrReference() *NamedRequestBodyOrReference {
	return &NamedRequestBodyOrReference{}
}

func (p *NamedRequestBodyOrReference) InitDefault() {
}

func (p *NamedRequestBodyOrReference) GetName() (v string) {
	return p.Name
}

var NamedRequestBodyOrReference_Value_DEFAULT *RequestBodyOrReference

func (p *NamedRequestBodyOrReference) GetValue() (v *RequestBodyOrReference) {
	if !p.IsSetValue() {
		return NamedRequestBodyOrReference_Value_DEFAULT
	}
	return p.Value
}
func (p *NamedRequestBodyOrReference) SetName(val string) {
	p.Name = val
}
func (p *NamedRequestBodyOrReference) SetValue(val *RequestBodyOrReference) {
	p.Value = val
}

var fieldIDToName_NamedRequestBodyOrReference = map[int16]string{
	1: "name",
	2: "value",
}

func (p *NamedRequestBodyOrReference) IsSetValue() bool {
	return p.Value != nil
}

func (p *NamedRequestBodyOrReference) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 2:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField2(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}
		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_NamedRequestBodyOrReference[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *NamedRequestBodyOrReference) ReadField1(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Name = _field
	return nil
}
func (p *NamedRequestBodyOrReference) ReadField2(iprot thrift.TProtocol) error {
	_field := NewRequestBodyOrReference()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Value = _field
	return nil
}

func (p *NamedRequestBodyOrReference) Write(oprot thrift.TProtocol) (err error) {

	var fieldId int16
	if err = oprot.WriteStructBegin("NamedRequestBodyOrReference"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
		if err = p.writeField2(oprot); err != nil {
			fieldId = 2
			goto WriteFieldError
		}
	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *NamedRequestBodyOrReference) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("name", thrift.STRING, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.Name); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *NamedRequestBodyOrReference) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("value", thrift.STRUCT, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Value.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err)
}

func (p *NamedRequestBodyOrReference) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("NamedRequestBodyOrReference(%+v)", *p)

}

func (p *NamedRequestBodyOrReference) DeepEqual(ano *NamedRequestBodyOrReference) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.Name) {
		return false
	}
	if !p.Field2DeepEqual(ano.Value) {
		return false
	}
	return true
}

func (p *NamedRequestBodyOrReference) Field1DeepEqual(src string) bool {

	if strings.Compare(p.Name, src) != 0 {
		return false
	}
	return true
}
func (p *NamedRequestBodyOrReference) Field2DeepEqual(src *RequestBodyOrReference) bool {

	if !p.Value.DeepEqual(src) {
		return false
	}
	return true
}

type NamedResponseOrReference struct {
	Name  string               `thrift:"name,1" frugal:"1,default,string" json:"name"`
	Value *ResponseOrReference `thrift:"value,2" frugal:"2,default,ResponseOrReference" json:"value"`
}

func NewNamedResponseOrReference() *NamedResponseOrReference {
	return &NamedResponseOrReference{}
}

func (p *NamedResponseOrReference) InitDefault() {
}

func (p *NamedResponseOrReference) GetName() (v string) {
	return p.Name
}

var NamedResponseOrReference_Value_DEFAULT *ResponseOrReference

func (p *NamedResponseOrReference) GetValue() (v *ResponseOrReference) {
	if !p.IsSetValue() {
		return NamedResponseOrReference_Value_DEFAULT
	}
	return p.Value
}
func (p *NamedResponseOrReference) SetName(val string) {
	p.Name = val
}
func (p *NamedResponseOrReference) SetValue(val *ResponseOrReference) {
	p.Value = val
}

var fieldIDToName_NamedResponseOrReference = map[int16]string{
	1: "name",
	2: "value",
}

func (p *NamedResponseOrReference) IsSetValue() bool {
	return p.Value != nil
}

func (p *NamedResponseOrReference) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 2:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField2(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}
		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_NamedResponseOrReference[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *NamedResponseOrReference) ReadField1(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Name = _field
	return nil
}
func (p *NamedResponseOrReference) ReadField2(iprot thrift.TProtocol) error {
	_field := NewResponseOrReference()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Value = _field
	return nil
}

func (p *NamedResponseOrReference) Write(oprot thrift.TProtocol) (err error) {

	var fieldId int16
	if err = oprot.WriteStructBegin("NamedResponseOrReference"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
		if err = p.writeField2(oprot); err != nil {
			fieldId = 2
			goto WriteFieldError
		}
	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *NamedResponseOrReference) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("name", thrift.STRING, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.Name); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *NamedResponseOrReference) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("value", thrift.STRUCT, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Value.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err)
}

func (p *NamedResponseOrReference) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("NamedResponseOrReference(%+v)", *p)

}

func (p *NamedResponseOrReference) DeepEqual(ano *NamedResponseOrReference) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.Name) {
		return false
	}
	if !p.Field2DeepEqual(ano.Value) {
		return false
	}
	return true
}

func (p *NamedResponseOrReference) Field1DeepEqual(src string) bool {

	if strings.Compare(p.Name, src) != 0 {
		return false
	}
	return true
}
func (p *NamedResponseOrReference) Field2DeepEqual(src *ResponseOrReference) bool {

	if !p.Value.DeepEqual(src) {
		return false
	}
	return true
}

type NamedSchemaOrReference struct {
	Name  string             `thrift:"name,1" frugal:"1,default,string" json:"name"`
	Value *SchemaOrReference `thrift:"value,2" frugal:"2,default,SchemaOrReference" json:"value"`
}

func NewNamedSchemaOrReference() *NamedSchemaOrReference {
	return &NamedSchemaOrReference{}
}

func (p *NamedSchemaOrReference) InitDefault() {
}

func (p *NamedSchemaOrReference) GetName() (v string) {
	return p.Name
}

var NamedSchemaOrReference_Value_DEFAULT *SchemaOrReference

func (p *NamedSchemaOrReference) GetValue() (v *SchemaOrReference) {
	if !p.IsSetValue() {
		return NamedSchemaOrReference_Value_DEFAULT
	}
	return p.Value
}
func (p *NamedSchemaOrReference) SetName(val string) {
	p.Name = val
}
func (p *NamedSchemaOrReference) SetValue(val *SchemaOrReference) {
	p.Value = val
}

var fieldIDToName_NamedSchemaOrReference = map[int16]string{
	1: "name",
	2: "value",
}

func (p *NamedSchemaOrReference) IsSetValue() bool {
	return p.Value != nil
}

func (p *NamedSchemaOrReference) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 2:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField2(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}
		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_NamedSchemaOrReference[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *NamedSchemaOrReference) ReadField1(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Name = _field
	return nil
}
func (p *NamedSchemaOrReference) ReadField2(iprot thrift.TProtocol) error {
	_field := NewSchemaOrReference()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Value = _field
	return nil
}

func (p *NamedSchemaOrReference) Write(oprot thrift.TProtocol) (err error) {

	var fieldId int16
	if err = oprot.WriteStructBegin("NamedSchemaOrReference"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
		if err = p.writeField2(oprot); err != nil {
			fieldId = 2
			goto WriteFieldError
		}
	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *NamedSchemaOrReference) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("name", thrift.STRING, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.Name); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *NamedSchemaOrReference) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("value", thrift.STRUCT, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Value.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err)
}

func (p *NamedSchemaOrReference) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("NamedSchemaOrReference(%+v)", *p)

}

func (p *NamedSchemaOrReference) DeepEqual(ano *NamedSchemaOrReference) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.Name) {
		return false
	}
	if !p.Field2DeepEqual(ano.Value) {
		return false
	}
	return true
}

func (p *NamedSchemaOrReference) Field1DeepEqual(src string) bool {

	if strings.Compare(p.Name, src) != 0 {
		return false
	}
	return true
}
func (p *NamedSchemaOrReference) Field2DeepEqual(src *SchemaOrReference) bool {

	if !p.Value.DeepEqual(src) {
		return false
	}
	return true
}

type NamedSecuritySchemeOrReference struct {
	Name  string                     `thrift:"name,1" frugal:"1,default,string" json:"name"`
	Value *SecuritySchemeOrReference `thrift:"value,2" frugal:"2,default,SecuritySchemeOrReference" json:"value"`
}

func NewNamedSecuritySchemeOrReference() *NamedSecuritySchemeOrReference {
	return &NamedSecuritySchemeOrReference{}
}

func (p *NamedSecuritySchemeOrReference) InitDefault() {
}

func (p *NamedSecuritySchemeOrReference) GetName() (v string) {
	return p.Name
}

var NamedSecuritySchemeOrReference_Value_DEFAULT *SecuritySchemeOrReference

func (p *NamedSecuritySchemeOrReference) GetValue() (v *SecuritySchemeOrReference) {
	if !p.IsSetValue() {
		return NamedSecuritySchemeOrReference_Value_DEFAULT
	}
	return p.Value
}
func (p *NamedSecuritySchemeOrReference) SetName(val string) {
	p.Name = val
}
func (p *NamedSecuritySchemeOrReference) SetValue(val *SecuritySchemeOrReference) {
	p.Value = val
}

var fieldIDToName_NamedSecuritySchemeOrReference = map[int16]string{
	1: "name",
	2: "value",
}

func (p *NamedSecuritySchemeOrReference) IsSetValue() bool {
	return p.Value != nil
}

func (p *NamedSecuritySchemeOrReference) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 2:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField2(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}
		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_NamedSecuritySchemeOrReference[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *NamedSecuritySchemeOrReference) ReadField1(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Name = _field
	return nil
}
func (p *NamedSecuritySchemeOrReference) ReadField2(iprot thrift.TProtocol) error {
	_field := NewSecuritySchemeOrReference()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Value = _field
	return nil
}

func (p *NamedSecuritySchemeOrReference) Write(oprot thrift.TProtocol) (err error) {

	var fieldId int16
	if err = oprot.WriteStructBegin("NamedSecuritySchemeOrReference"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
		if err = p.writeField2(oprot); err != nil {
			fieldId = 2
			goto WriteFieldError
		}
	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *NamedSecuritySchemeOrReference) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("name", thrift.STRING, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.Name); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *NamedSecuritySchemeOrReference) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("value", thrift.STRUCT, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Value.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err)
}

func (p *NamedSecuritySchemeOrReference) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("NamedSecuritySchemeOrReference(%+v)", *p)

}

func (p *NamedSecuritySchemeOrReference) DeepEqual(ano *NamedSecuritySchemeOrReference) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.Name) {
		return false
	}
	if !p.Field2DeepEqual(ano.Value) {
		return false
	}
	return true
}

func (p *NamedSecuritySchemeOrReference) Field1DeepEqual(src string) bool {

	if strings.Compare(p.Name, src) != 0 {
		return false
	}
	return true
}
func (p *NamedSecuritySchemeOrReference) Field2DeepEqual(src *SecuritySchemeOrReference) bool {

	if !p.Value.DeepEqual(src) {
		return false
	}
	return true
}

type NamedServerVariable struct {
	Name  string          `thrift:"name,1" frugal:"1,default,string" json:"name"`
	Value *ServerVariable `thrift:"value,2" frugal:"2,default,ServerVariable" json:"value"`
}

func NewNamedServerVariable() *NamedServerVariable {
	return &NamedServerVariable{}
}

func (p *NamedServerVariable) InitDefault() {
}

func (p *NamedServerVariable) GetName() (v string) {
	return p.Name
}

var NamedServerVariable_Value_DEFAULT *ServerVariable

func (p *NamedServerVariable) GetValue() (v *ServerVariable) {
	if !p.IsSetValue() {
		return NamedServerVariable_Value_DEFAULT
	}
	return p.Value
}
func (p *NamedServerVariable) SetName(val string) {
	p.Name = val
}
func (p *NamedServerVariable) SetValue(val *ServerVariable) {
	p.Value = val
}

var fieldIDToName_NamedServerVariable = map[int16]string{
	1: "name",
	2: "value",
}

func (p *NamedServerVariable) IsSetValue() bool {
	return p.Value != nil
}

func (p *NamedServerVariable) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 2:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField2(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}
		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_NamedServerVariable[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *NamedServerVariable) ReadField1(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Name = _field
	return nil
}
func (p *NamedServerVariable) ReadField2(iprot thrift.TProtocol) error {
	_field := NewServerVariable()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Value = _field
	return nil
}

func (p *NamedServerVariable) Write(oprot thrift.TProtocol) (err error) {

	var fieldId int16
	if err = oprot.WriteStructBegin("NamedServerVariable"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
		if err = p.writeField2(oprot); err != nil {
			fieldId = 2
			goto WriteFieldError
		}
	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *NamedServerVariable) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("name", thrift.STRING, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.Name); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *NamedServerVariable) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("value", thrift.STRUCT, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Value.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err)
}

func (p *NamedServerVariable) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("NamedServerVariable(%+v)", *p)

}

func (p *NamedServerVariable) DeepEqual(ano *NamedServerVariable) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.Name) {
		return false
	}
	if !p.Field2DeepEqual(ano.Value) {
		return false
	}
	return true
}

func (p *NamedServerVariable) Field1DeepEqual(src string) bool {

	if strings.Compare(p.Name, src) != 0 {
		return false
	}
	return true
}
func (p *NamedServerVariable) Field2DeepEqual(src *ServerVariable) bool {

	if !p.Value.DeepEqual(src) {
		return false
	}
	return true
}

type NamedString struct {
	Name  string `thrift:"name,1" frugal:"1,default,string" json:"name"`
	Value string `thrift:"value,2" frugal:"2,default,string" json:"value"`
}

func NewNamedString() *NamedString {
	return &NamedString{}
}

func (p *NamedString) InitDefault() {
}

func (p *NamedString) GetName() (v string) {
	return p.Name
}

func (p *NamedString) GetValue() (v string) {
	return p.Value
}
func (p *NamedString) SetName(val string) {
	p.Name = val
}
func (p *NamedString) SetValue(val string) {
	p.Value = val
}

var fieldIDToName_NamedString = map[int16]string{
	1: "name",
	2: "value",
}

func (p *NamedString) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 2:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField2(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}
		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_NamedString[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *NamedString) ReadField1(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Name = _field
	return nil
}
func (p *NamedString) ReadField2(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Value = _field
	return nil
}

func (p *NamedString) Write(oprot thrift.TProtocol) (err error) {

	var fieldId int16
	if err = oprot.WriteStructBegin("NamedString"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
		if err = p.writeField2(oprot); err != nil {
			fieldId = 2
			goto WriteFieldError
		}
	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *NamedString) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("name", thrift.STRING, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.Name); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *NamedString) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("value", thrift.STRING, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.Value); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err)
}

func (p *NamedString) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("NamedString(%+v)", *p)

}

func (p *NamedString) DeepEqual(ano *NamedString) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.Name) {
		return false
	}
	if !p.Field2DeepEqual(ano.Value) {
		return false
	}
	return true
}

func (p *NamedString) Field1DeepEqual(src string) bool {

	if strings.Compare(p.Name, src) != 0 {
		return false
	}
	return true
}
func (p *NamedString) Field2DeepEqual(src string) bool {

	if strings.Compare(p.Value, src) != 0 {
		return false
	}
	return true
}

type NamedStringArray struct {
	Name  string       `thrift:"name,1" frugal:"1,default,string" json:"name"`
	Value *StringArray `thrift:"value,2" frugal:"2,default,StringArray" json:"value"`
}

func NewNamedStringArray() *NamedStringArray {
	return &NamedStringArray{}
}

func (p *NamedStringArray) InitDefault() {
}

func (p *NamedStringArray) GetName() (v string) {
	return p.Name
}

var NamedStringArray_Value_DEFAULT *StringArray

func (p *NamedStringArray) GetValue() (v *StringArray) {
	if !p.IsSetValue() {
		return NamedStringArray_Value_DEFAULT
	}
	return p.Value
}
func (p *NamedStringArray) SetName(val string) {
	p.Name = val
}
func (p *NamedStringArray) SetValue(val *StringArray) {
	p.Value = val
}

var fieldIDToName_NamedStringArray = map[int16]string{
	1: "name",
	2: "value",
}

func (p *NamedStringArray) IsSetValue() bool {
	return p.Value != nil
}

func (p *NamedStringArray) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 2:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField2(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}
		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_NamedStringArray[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *NamedStringArray) ReadField1(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Name = _field
	return nil
}
func (p *NamedStringArray) ReadField2(iprot thrift.TProtocol) error {
	_field := NewStringArray()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Value = _field
	return nil
}

func (p *NamedStringArray) Write(oprot thrift.TProtocol) (err error) {

	var fieldId int16
	if err = oprot.WriteStructBegin("NamedStringArray"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
		if err = p.writeField2(oprot); err != nil {
			fieldId = 2
			goto WriteFieldError
		}
	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *NamedStringArray) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("name", thrift.STRING, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.Name); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *NamedStringArray) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("value", thrift.STRUCT, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Value.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err)
}

func (p *NamedStringArray) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("NamedStringArray(%+v)", *p)

}

func (p *NamedStringArray) DeepEqual(ano *NamedStringArray) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.Name) {
		return false
	}
	if !p.Field2DeepEqual(ano.Value) {
		return false
	}
	return true
}

func (p *NamedStringArray) Field1DeepEqual(src string) bool {

	if strings.Compare(p.Name, src) != 0 {
		return false
	}
	return true
}
func (p *NamedStringArray) Field2DeepEqual(src *StringArray) bool {

	if !p.Value.DeepEqual(src) {
		return false
	}
	return true
}

type OauthFlow struct {
	AuthorizationUrl       string      `thrift:"authorization_url,1" frugal:"1,default,string" json:"authorization_url"`
	TokenUrl               string      `thrift:"token_url,2" frugal:"2,default,string" json:"token_url"`
	RefreshUrl             string      `thrift:"refresh_url,3" frugal:"3,default,string" json:"refresh_url"`
	Scopes                 *Strings    `thrift:"scopes,4" frugal:"4,default,Strings" json:"scopes"`
	SpecificationExtension []*NamedAny `thrift:"specification_extension,5" frugal:"5,default,list<NamedAny>" json:"specification_extension"`
}

func NewOauthFlow() *OauthFlow {
	return &OauthFlow{}
}

func (p *OauthFlow) InitDefault() {
}

func (p *OauthFlow) GetAuthorizationUrl() (v string) {
	return p.AuthorizationUrl
}

func (p *OauthFlow) GetTokenUrl() (v string) {
	return p.TokenUrl
}

func (p *OauthFlow) GetRefreshUrl() (v string) {
	return p.RefreshUrl
}

var OauthFlow_Scopes_DEFAULT *Strings

func (p *OauthFlow) GetScopes() (v *Strings) {
	if !p.IsSetScopes() {
		return OauthFlow_Scopes_DEFAULT
	}
	return p.Scopes
}

func (p *OauthFlow) GetSpecificationExtension() (v []*NamedAny) {
	return p.SpecificationExtension
}
func (p *OauthFlow) SetAuthorizationUrl(val string) {
	p.AuthorizationUrl = val
}
func (p *OauthFlow) SetTokenUrl(val string) {
	p.TokenUrl = val
}
func (p *OauthFlow) SetRefreshUrl(val string) {
	p.RefreshUrl = val
}
func (p *OauthFlow) SetScopes(val *Strings) {
	p.Scopes = val
}
func (p *OauthFlow) SetSpecificationExtension(val []*NamedAny) {
	p.SpecificationExtension = val
}

var fieldIDToName_OauthFlow = map[int16]string{
	1: "authorization_url",
	2: "token_url",
	3: "refresh_url",
	4: "scopes",
	5: "specification_extension",
}

func (p *OauthFlow) IsSetScopes() bool {
	return p.Scopes != nil
}

func (p *OauthFlow) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 2:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField2(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 3:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField3(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 4:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField4(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 5:
			if fieldTypeId == thrift.LIST {
				if err = p.ReadField5(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}
		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_OauthFlow[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *OauthFlow) ReadField1(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p.AuthorizationUrl = _field
	return nil
}
func (p *OauthFlow) ReadField2(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p.TokenUrl = _field
	return nil
}
func (p *OauthFlow) ReadField3(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p.RefreshUrl = _field
	return nil
}
func (p *OauthFlow) ReadField4(iprot thrift.TProtocol) error {
	_field := NewStrings()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Scopes = _field
	return nil
}
func (p *OauthFlow) ReadField5(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	_field := make([]*NamedAny, 0, size)
	values := make([]NamedAny, size)
	for i := 0; i < size; i++ {
		_elem := &values[i]
		_elem.InitDefault()

		if err := _elem.Read(iprot); err != nil {
			return err
		}

		_field = append(_field, _elem)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return err
	}
	p.SpecificationExtension = _field
	return nil
}

func (p *OauthFlow) Write(oprot thrift.TProtocol) (err error) {

	var fieldId int16
	if err = oprot.WriteStructBegin("OauthFlow"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
		if err = p.writeField2(oprot); err != nil {
			fieldId = 2
			goto WriteFieldError
		}
		if err = p.writeField3(oprot); err != nil {
			fieldId = 3
			goto WriteFieldError
		}
		if err = p.writeField4(oprot); err != nil {
			fieldId = 4
			goto WriteFieldError
		}
		if err = p.writeField5(oprot); err != nil {
			fieldId = 5
			goto WriteFieldError
		}
	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *OauthFlow) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("authorization_url", thrift.STRING, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.AuthorizationUrl); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *OauthFlow) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("token_url", thrift.STRING, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.TokenUrl); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err)
}

func (p *OauthFlow) writeField3(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("refresh_url", thrift.STRING, 3); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.RefreshUrl); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err)
}

func (p *OauthFlow) writeField4(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("scopes", thrift.STRUCT, 4); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Scopes.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err)
}

func (p *OauthFlow) writeField5(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("specification_extension", thrift.LIST, 5); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.SpecificationExtension)); err != nil {
		return err
	}
	for _, v := range p.SpecificationExtension {
		if err := v.Write(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err)
}

func (p *OauthFlow) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("OauthFlow(%+v)", *p)

}

func (p *OauthFlow) DeepEqual(ano *OauthFlow) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.AuthorizationUrl) {
		return false
	}
	if !p.Field2DeepEqual(ano.TokenUrl) {
		return false
	}
	if !p.Field3DeepEqual(ano.RefreshUrl) {
		return false
	}
	if !p.Field4DeepEqual(ano.Scopes) {
		return false
	}
	if !p.Field5DeepEqual(ano.SpecificationExtension) {
		return false
	}
	return true
}

func (p *OauthFlow) Field1DeepEqual(src string) bool {

	if strings.Compare(p.AuthorizationUrl, src) != 0 {
		return false
	}
	return true
}
func (p *OauthFlow) Field2DeepEqual(src string) bool {

	if strings.Compare(p.TokenUrl, src) != 0 {
		return false
	}
	return true
}
func (p *OauthFlow) Field3DeepEqual(src string) bool {

	if strings.Compare(p.RefreshUrl, src) != 0 {
		return false
	}
	return true
}
func (p *OauthFlow) Field4DeepEqual(src *Strings) bool {

	if !p.Scopes.DeepEqual(src) {
		return false
	}
	return true
}
func (p *OauthFlow) Field5DeepEqual(src []*NamedAny) bool {

	if len(p.SpecificationExtension) != len(src) {
		return false
	}
	for i, v := range p.SpecificationExtension {
		_src := src[i]
		if !v.DeepEqual(_src) {
			return false
		}
	}
	return true
}

type OauthFlows struct {
	Implicit               *OauthFlow  `thrift:"implicit,1" frugal:"1,default,OauthFlow" json:"implicit"`
	Password               *OauthFlow  `thrift:"password,2" frugal:"2,default,OauthFlow" json:"password"`
	ClientCredentials      *OauthFlow  `thrift:"client_credentials,3" frugal:"3,default,OauthFlow" json:"client_credentials"`
	AuthorizationCode      *OauthFlow  `thrift:"authorization_code,4" frugal:"4,default,OauthFlow" json:"authorization_code"`
	SpecificationExtension []*NamedAny `thrift:"specification_extension,5" frugal:"5,default,list<NamedAny>" json:"specification_extension"`
}

func NewOauthFlows() *OauthFlows {
	return &OauthFlows{}
}

func (p *OauthFlows) InitDefault() {
}

var OauthFlows_Implicit_DEFAULT *OauthFlow

func (p *OauthFlows) GetImplicit() (v *OauthFlow) {
	if !p.IsSetImplicit() {
		return OauthFlows_Implicit_DEFAULT
	}
	return p.Implicit
}

var OauthFlows_Password_DEFAULT *OauthFlow

func (p *OauthFlows) GetPassword() (v *OauthFlow) {
	if !p.IsSetPassword() {
		return OauthFlows_Password_DEFAULT
	}
	return p.Password
}

var OauthFlows_ClientCredentials_DEFAULT *OauthFlow

func (p *OauthFlows) GetClientCredentials() (v *OauthFlow) {
	if !p.IsSetClientCredentials() {
		return OauthFlows_ClientCredentials_DEFAULT
	}
	return p.ClientCredentials
}

var OauthFlows_AuthorizationCode_DEFAULT *OauthFlow

func (p *OauthFlows) GetAuthorizationCode() (v *OauthFlow) {
	if !p.IsSetAuthorizationCode() {
		return OauthFlows_AuthorizationCode_DEFAULT
	}
	return p.AuthorizationCode
}

func (p *OauthFlows) GetSpecificationExtension() (v []*NamedAny) {
	return p.SpecificationExtension
}
func (p *OauthFlows) SetImplicit(val *OauthFlow) {
	p.Implicit = val
}
func (p *OauthFlows) SetPassword(val *OauthFlow) {
	p.Password = val
}
func (p *OauthFlows) SetClientCredentials(val *OauthFlow) {
	p.ClientCredentials = val
}
func (p *OauthFlows) SetAuthorizationCode(val *OauthFlow) {
	p.AuthorizationCode = val
}
func (p *OauthFlows) SetSpecificationExtension(val []*NamedAny) {
	p.SpecificationExtension = val
}

var fieldIDToName_OauthFlows = map[int16]string{
	1: "implicit",
	2: "password",
	3: "client_credentials",
	4: "authorization_code",
	5: "specification_extension",
}

func (p *OauthFlows) IsSetImplicit() bool {
	return p.Implicit != nil
}

func (p *OauthFlows) IsSetPassword() bool {
	return p.Password != nil
}

func (p *OauthFlows) IsSetClientCredentials() bool {
	return p.ClientCredentials != nil
}

func (p *OauthFlows) IsSetAuthorizationCode() bool {
	return p.AuthorizationCode != nil
}

func (p *OauthFlows) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 2:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField2(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 3:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField3(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 4:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField4(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 5:
			if fieldTypeId == thrift.LIST {
				if err = p.ReadField5(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}
		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_OauthFlows[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *OauthFlows) ReadField1(iprot thrift.TProtocol) error {
	_field := NewOauthFlow()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Implicit = _field
	return nil
}
func (p *OauthFlows) ReadField2(iprot thrift.TProtocol) error {
	_field := NewOauthFlow()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Password = _field
	return nil
}
func (p *OauthFlows) ReadField3(iprot thrift.TProtocol) error {
	_field := NewOauthFlow()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.ClientCredentials = _field
	return nil
}
func (p *OauthFlows) ReadField4(iprot thrift.TProtocol) error {
	_field := NewOauthFlow()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.AuthorizationCode = _field
	return nil
}
func (p *OauthFlows) ReadField5(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	_field := make([]*NamedAny, 0, size)
	values := make([]NamedAny, size)
	for i := 0; i < size; i++ {
		_elem := &values[i]
		_elem.InitDefault()

		if err := _elem.Read(iprot); err != nil {
			return err
		}

		_field = append(_field, _elem)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return err
	}
	p.SpecificationExtension = _field
	return nil
}

func (p *OauthFlows) Write(oprot thrift.TProtocol) (err error) {

	var fieldId int16
	if err = oprot.WriteStructBegin("OauthFlows"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
		if err = p.writeField2(oprot); err != nil {
			fieldId = 2
			goto WriteFieldError
		}
		if err = p.writeField3(oprot); err != nil {
			fieldId = 3
			goto WriteFieldError
		}
		if err = p.writeField4(oprot); err != nil {
			fieldId = 4
			goto WriteFieldError
		}
		if err = p.writeField5(oprot); err != nil {
			fieldId = 5
			goto WriteFieldError
		}
	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *OauthFlows) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("implicit", thrift.STRUCT, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Implicit.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *OauthFlows) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("password", thrift.STRUCT, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Password.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err)
}

func (p *OauthFlows) writeField3(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("client_credentials", thrift.STRUCT, 3); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.ClientCredentials.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err)
}

func (p *OauthFlows) writeField4(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("authorization_code", thrift.STRUCT, 4); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.AuthorizationCode.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err)
}

func (p *OauthFlows) writeField5(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("specification_extension", thrift.LIST, 5); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.SpecificationExtension)); err != nil {
		return err
	}
	for _, v := range p.SpecificationExtension {
		if err := v.Write(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err)
}

func (p *OauthFlows) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("OauthFlows(%+v)", *p)

}

func (p *OauthFlows) DeepEqual(ano *OauthFlows) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.Implicit) {
		return false
	}
	if !p.Field2DeepEqual(ano.Password) {
		return false
	}
	if !p.Field3DeepEqual(ano.ClientCredentials) {
		return false
	}
	if !p.Field4DeepEqual(ano.AuthorizationCode) {
		return false
	}
	if !p.Field5DeepEqual(ano.SpecificationExtension) {
		return false
	}
	return true
}

func (p *OauthFlows) Field1DeepEqual(src *OauthFlow) bool {

	if !p.Implicit.DeepEqual(src) {
		return false
	}
	return true
}
func (p *OauthFlows) Field2DeepEqual(src *OauthFlow) bool {

	if !p.Password.DeepEqual(src) {
		return false
	}
	return true
}
func (p *OauthFlows) Field3DeepEqual(src *OauthFlow) bool {

	if !p.ClientCredentials.DeepEqual(src) {
		return false
	}
	return true
}
func (p *OauthFlows) Field4DeepEqual(src *OauthFlow) bool {

	if !p.AuthorizationCode.DeepEqual(src) {
		return false
	}
	return true
}
func (p *OauthFlows) Field5DeepEqual(src []*NamedAny) bool {

	if len(p.SpecificationExtension) != len(src) {
		return false
	}
	for i, v := range p.SpecificationExtension {
		_src := src[i]
		if !v.DeepEqual(_src) {
			return false
		}
	}
	return true
}

type Object struct {
	AdditionalProperties []*NamedAny `thrift:"additional_properties,1" frugal:"1,default,list<NamedAny>" json:"additional_properties"`
}

func NewObject() *Object {
	return &Object{}
}

func (p *Object) InitDefault() {
}

func (p *Object) GetAdditionalProperties() (v []*NamedAny) {
	return p.AdditionalProperties
}
func (p *Object) SetAdditionalProperties(val []*NamedAny) {
	p.AdditionalProperties = val
}

var fieldIDToName_Object = map[int16]string{
	1: "additional_properties",
}

func (p *Object) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.LIST {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}
		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_Object[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *Object) ReadField1(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	_field := make([]*NamedAny, 0, size)
	values := make([]NamedAny, size)
	for i := 0; i < size; i++ {
		_elem := &values[i]
		_elem.InitDefault()

		if err := _elem.Read(iprot); err != nil {
			return err
		}

		_field = append(_field, _elem)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return err
	}
	p.AdditionalProperties = _field
	return nil
}

func (p *Object) Write(oprot thrift.TProtocol) (err error) {

	var fieldId int16
	if err = oprot.WriteStructBegin("Object"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *Object) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("additional_properties", thrift.LIST, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.AdditionalProperties)); err != nil {
		return err
	}
	for _, v := range p.AdditionalProperties {
		if err := v.Write(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *Object) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("Object(%+v)", *p)

}

func (p *Object) DeepEqual(ano *Object) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.AdditionalProperties) {
		return false
	}
	return true
}

func (p *Object) Field1DeepEqual(src []*NamedAny) bool {

	if len(p.AdditionalProperties) != len(src) {
		return false
	}
	for i, v := range p.AdditionalProperties {
		_src := src[i]
		if !v.DeepEqual(_src) {
			return false
		}
	}
	return true
}

type Operation struct {
	Tags                   []string                `thrift:"tags,1" frugal:"1,default,list<string>" json:"tags"`
	Summary                string                  `thrift:"summary,2" frugal:"2,default,string" json:"summary"`
	Description            string                  `thrift:"description,3" frugal:"3,default,string" json:"description"`
	ExternalDocs           *ExternalDocs           `thrift:"external_docs,4" frugal:"4,default,ExternalDocs" json:"external_docs"`
	OperationId            string                  `thrift:"operation_id,5" frugal:"5,default,string" json:"operation_id"`
	Parameters             []*ParameterOrReference `thrift:"parameters,6" frugal:"6,default,list<ParameterOrReference>" json:"parameters"`
	RequestBody            *RequestBodyOrReference `thrift:"request_body,7" frugal:"7,default,RequestBodyOrReference" json:"request_body"`
	Responses              *Responses              `thrift:"responses,8" frugal:"8,default,Responses" json:"responses"`
	Callbacks              *CallbacksOrReferences  `thrift:"callbacks,9" frugal:"9,default,CallbacksOrReferences" json:"callbacks"`
	Deprecated             bool                    `thrift:"deprecated,10" frugal:"10,default,bool" json:"deprecated"`
	Security               []*SecurityRequirement  `thrift:"security,11" frugal:"11,default,list<SecurityRequirement>" json:"security"`
	Servers                []*Server               `thrift:"servers,12" frugal:"12,default,list<Server>" json:"servers"`
	SpecificationExtension []*NamedAny             `thrift:"specification_extension,13" frugal:"13,default,list<NamedAny>" json:"specification_extension"`
}

func NewOperation() *Operation {
	return &Operation{}
}

func (p *Operation) InitDefault() {
}

func (p *Operation) GetTags() (v []string) {
	return p.Tags
}

func (p *Operation) GetSummary() (v string) {
	return p.Summary
}

func (p *Operation) GetDescription() (v string) {
	return p.Description
}

var Operation_ExternalDocs_DEFAULT *ExternalDocs

func (p *Operation) GetExternalDocs() (v *ExternalDocs) {
	if !p.IsSetExternalDocs() {
		return Operation_ExternalDocs_DEFAULT
	}
	return p.ExternalDocs
}

func (p *Operation) GetOperationId() (v string) {
	return p.OperationId
}

func (p *Operation) GetParameters() (v []*ParameterOrReference) {
	return p.Parameters
}

var Operation_RequestBody_DEFAULT *RequestBodyOrReference

func (p *Operation) GetRequestBody() (v *RequestBodyOrReference) {
	if !p.IsSetRequestBody() {
		return Operation_RequestBody_DEFAULT
	}
	return p.RequestBody
}

var Operation_Responses_DEFAULT *Responses

func (p *Operation) GetResponses() (v *Responses) {
	if !p.IsSetResponses() {
		return Operation_Responses_DEFAULT
	}
	return p.Responses
}

var Operation_Callbacks_DEFAULT *CallbacksOrReferences

func (p *Operation) GetCallbacks() (v *CallbacksOrReferences) {
	if !p.IsSetCallbacks() {
		return Operation_Callbacks_DEFAULT
	}
	return p.Callbacks
}

func (p *Operation) GetDeprecated() (v bool) {
	return p.Deprecated
}

func (p *Operation) GetSecurity() (v []*SecurityRequirement) {
	return p.Security
}

func (p *Operation) GetServers() (v []*Server) {
	return p.Servers
}

func (p *Operation) GetSpecificationExtension() (v []*NamedAny) {
	return p.SpecificationExtension
}
func (p *Operation) SetTags(val []string) {
	p.Tags = val
}
func (p *Operation) SetSummary(val string) {
	p.Summary = val
}
func (p *Operation) SetDescription(val string) {
	p.Description = val
}
func (p *Operation) SetExternalDocs(val *ExternalDocs) {
	p.ExternalDocs = val
}
func (p *Operation) SetOperationId(val string) {
	p.OperationId = val
}
func (p *Operation) SetParameters(val []*ParameterOrReference) {
	p.Parameters = val
}
func (p *Operation) SetRequestBody(val *RequestBodyOrReference) {
	p.RequestBody = val
}
func (p *Operation) SetResponses(val *Responses) {
	p.Responses = val
}
func (p *Operation) SetCallbacks(val *CallbacksOrReferences) {
	p.Callbacks = val
}
func (p *Operation) SetDeprecated(val bool) {
	p.Deprecated = val
}
func (p *Operation) SetSecurity(val []*SecurityRequirement) {
	p.Security = val
}
func (p *Operation) SetServers(val []*Server) {
	p.Servers = val
}
func (p *Operation) SetSpecificationExtension(val []*NamedAny) {
	p.SpecificationExtension = val
}

var fieldIDToName_Operation = map[int16]string{
	1:  "tags",
	2:  "summary",
	3:  "description",
	4:  "external_docs",
	5:  "operation_id",
	6:  "parameters",
	7:  "request_body",
	8:  "responses",
	9:  "callbacks",
	10: "deprecated",
	11: "security",
	12: "servers",
	13: "specification_extension",
}

func (p *Operation) IsSetExternalDocs() bool {
	return p.ExternalDocs != nil
}

func (p *Operation) IsSetRequestBody() bool {
	return p.RequestBody != nil
}

func (p *Operation) IsSetResponses() bool {
	return p.Responses != nil
}

func (p *Operation) IsSetCallbacks() bool {
	return p.Callbacks != nil
}

func (p *Operation) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.LIST {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 2:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField2(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 3:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField3(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 4:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField4(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 5:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField5(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 6:
			if fieldTypeId == thrift.LIST {
				if err = p.ReadField6(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 7:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField7(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 8:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField8(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 9:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField9(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 10:
			if fieldTypeId == thrift.BOOL {
				if err = p.ReadField10(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 11:
			if fieldTypeId == thrift.LIST {
				if err = p.ReadField11(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 12:
			if fieldTypeId == thrift.LIST {
				if err = p.ReadField12(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 13:
			if fieldTypeId == thrift.LIST {
				if err = p.ReadField13(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}
		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_Operation[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *Operation) ReadField1(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	_field := make([]string, 0, size)
	for i := 0; i < size; i++ {

		var _elem string
		if v, err := iprot.ReadString(); err != nil {
			return err
		} else {
			_elem = v
		}

		_field = append(_field, _elem)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return err
	}
	p.Tags = _field
	return nil
}
func (p *Operation) ReadField2(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Summary = _field
	return nil
}
func (p *Operation) ReadField3(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Description = _field
	return nil
}
func (p *Operation) ReadField4(iprot thrift.TProtocol) error {
	_field := NewExternalDocs()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.ExternalDocs = _field
	return nil
}
func (p *Operation) ReadField5(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p.OperationId = _field
	return nil
}
func (p *Operation) ReadField6(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	_field := make([]*ParameterOrReference, 0, size)
	values := make([]ParameterOrReference, size)
	for i := 0; i < size; i++ {
		_elem := &values[i]
		_elem.InitDefault()

		if err := _elem.Read(iprot); err != nil {
			return err
		}

		_field = append(_field, _elem)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return err
	}
	p.Parameters = _field
	return nil
}
func (p *Operation) ReadField7(iprot thrift.TProtocol) error {
	_field := NewRequestBodyOrReference()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.RequestBody = _field
	return nil
}
func (p *Operation) ReadField8(iprot thrift.TProtocol) error {
	_field := NewResponses()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Responses = _field
	return nil
}
func (p *Operation) ReadField9(iprot thrift.TProtocol) error {
	_field := NewCallbacksOrReferences()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Callbacks = _field
	return nil
}
func (p *Operation) ReadField10(iprot thrift.TProtocol) error {

	var _field bool
	if v, err := iprot.ReadBool(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Deprecated = _field
	return nil
}
func (p *Operation) ReadField11(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	_field := make([]*SecurityRequirement, 0, size)
	values := make([]SecurityRequirement, size)
	for i := 0; i < size; i++ {
		_elem := &values[i]
		_elem.InitDefault()

		if err := _elem.Read(iprot); err != nil {
			return err
		}

		_field = append(_field, _elem)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return err
	}
	p.Security = _field
	return nil
}
func (p *Operation) ReadField12(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	_field := make([]*Server, 0, size)
	values := make([]Server, size)
	for i := 0; i < size; i++ {
		_elem := &values[i]
		_elem.InitDefault()

		if err := _elem.Read(iprot); err != nil {
			return err
		}

		_field = append(_field, _elem)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return err
	}
	p.Servers = _field
	return nil
}
func (p *Operation) ReadField13(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	_field := make([]*NamedAny, 0, size)
	values := make([]NamedAny, size)
	for i := 0; i < size; i++ {
		_elem := &values[i]
		_elem.InitDefault()

		if err := _elem.Read(iprot); err != nil {
			return err
		}

		_field = append(_field, _elem)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return err
	}
	p.SpecificationExtension = _field
	return nil
}

func (p *Operation) Write(oprot thrift.TProtocol) (err error) {

	var fieldId int16
	if err = oprot.WriteStructBegin("Operation"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
		if err = p.writeField2(oprot); err != nil {
			fieldId = 2
			goto WriteFieldError
		}
		if err = p.writeField3(oprot); err != nil {
			fieldId = 3
			goto WriteFieldError
		}
		if err = p.writeField4(oprot); err != nil {
			fieldId = 4
			goto WriteFieldError
		}
		if err = p.writeField5(oprot); err != nil {
			fieldId = 5
			goto WriteFieldError
		}
		if err = p.writeField6(oprot); err != nil {
			fieldId = 6
			goto WriteFieldError
		}
		if err = p.writeField7(oprot); err != nil {
			fieldId = 7
			goto WriteFieldError
		}
		if err = p.writeField8(oprot); err != nil {
			fieldId = 8
			goto WriteFieldError
		}
		if err = p.writeField9(oprot); err != nil {
			fieldId = 9
			goto WriteFieldError
		}
		if err = p.writeField10(oprot); err != nil {
			fieldId = 10
			goto WriteFieldError
		}
		if err = p.writeField11(oprot); err != nil {
			fieldId = 11
			goto WriteFieldError
		}
		if err = p.writeField12(oprot); err != nil {
			fieldId = 12
			goto WriteFieldError
		}
		if err = p.writeField13(oprot); err != nil {
			fieldId = 13
			goto WriteFieldError
		}
	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *Operation) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("tags", thrift.LIST, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRING, len(p.Tags)); err != nil {
		return err
	}
	for _, v := range p.Tags {
		if err := oprot.WriteString(v); err != nil {
			return err
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *Operation) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("summary", thrift.STRING, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.Summary); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err)
}

func (p *Operation) writeField3(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("description", thrift.STRING, 3); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.Description); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err)
}

func (p *Operation) writeField4(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("external_docs", thrift.STRUCT, 4); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.ExternalDocs.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err)
}

func (p *Operation) writeField5(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("operation_id", thrift.STRING, 5); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.OperationId); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err)
}

func (p *Operation) writeField6(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("parameters", thrift.LIST, 6); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Parameters)); err != nil {
		return err
	}
	for _, v := range p.Parameters {
		if err := v.Write(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 6 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err)
}

func (p *Operation) writeField7(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("request_body", thrift.STRUCT, 7); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.RequestBody.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 7 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 7 end error: ", p), err)
}

func (p *Operation) writeField8(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("responses", thrift.STRUCT, 8); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Responses.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 8 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 8 end error: ", p), err)
}

func (p *Operation) writeField9(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("callbacks", thrift.STRUCT, 9); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Callbacks.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 9 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 9 end error: ", p), err)
}

func (p *Operation) writeField10(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("deprecated", thrift.BOOL, 10); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteBool(p.Deprecated); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 10 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 10 end error: ", p), err)
}

func (p *Operation) writeField11(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("security", thrift.LIST, 11); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Security)); err != nil {
		return err
	}
	for _, v := range p.Security {
		if err := v.Write(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 11 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 11 end error: ", p), err)
}

func (p *Operation) writeField12(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("servers", thrift.LIST, 12); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Servers)); err != nil {
		return err
	}
	for _, v := range p.Servers {
		if err := v.Write(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 12 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 12 end error: ", p), err)
}

func (p *Operation) writeField13(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("specification_extension", thrift.LIST, 13); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.SpecificationExtension)); err != nil {
		return err
	}
	for _, v := range p.SpecificationExtension {
		if err := v.Write(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 13 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 13 end error: ", p), err)
}

func (p *Operation) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("Operation(%+v)", *p)

}

func (p *Operation) DeepEqual(ano *Operation) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.Tags) {
		return false
	}
	if !p.Field2DeepEqual(ano.Summary) {
		return false
	}
	if !p.Field3DeepEqual(ano.Description) {
		return false
	}
	if !p.Field4DeepEqual(ano.ExternalDocs) {
		return false
	}
	if !p.Field5DeepEqual(ano.OperationId) {
		return false
	}
	if !p.Field6DeepEqual(ano.Parameters) {
		return false
	}
	if !p.Field7DeepEqual(ano.RequestBody) {
		return false
	}
	if !p.Field8DeepEqual(ano.Responses) {
		return false
	}
	if !p.Field9DeepEqual(ano.Callbacks) {
		return false
	}
	if !p.Field10DeepEqual(ano.Deprecated) {
		return false
	}
	if !p.Field11DeepEqual(ano.Security) {
		return false
	}
	if !p.Field12DeepEqual(ano.Servers) {
		return false
	}
	if !p.Field13DeepEqual(ano.SpecificationExtension) {
		return false
	}
	return true
}

func (p *Operation) Field1DeepEqual(src []string) bool {

	if len(p.Tags) != len(src) {
		return false
	}
	for i, v := range p.Tags {
		_src := src[i]
		if strings.Compare(v, _src) != 0 {
			return false
		}
	}
	return true
}
func (p *Operation) Field2DeepEqual(src string) bool {

	if strings.Compare(p.Summary, src) != 0 {
		return false
	}
	return true
}
func (p *Operation) Field3DeepEqual(src string) bool {

	if strings.Compare(p.Description, src) != 0 {
		return false
	}
	return true
}
func (p *Operation) Field4DeepEqual(src *ExternalDocs) bool {

	if !p.ExternalDocs.DeepEqual(src) {
		return false
	}
	return true
}
func (p *Operation) Field5DeepEqual(src string) bool {

	if strings.Compare(p.OperationId, src) != 0 {
		return false
	}
	return true
}
func (p *Operation) Field6DeepEqual(src []*ParameterOrReference) bool {

	if len(p.Parameters) != len(src) {
		return false
	}
	for i, v := range p.Parameters {
		_src := src[i]
		if !v.DeepEqual(_src) {
			return false
		}
	}
	return true
}
func (p *Operation) Field7DeepEqual(src *RequestBodyOrReference) bool {

	if !p.RequestBody.DeepEqual(src) {
		return false
	}
	return true
}
func (p *Operation) Field8DeepEqual(src *Responses) bool {

	if !p.Responses.DeepEqual(src) {
		return false
	}
	return true
}
func (p *Operation) Field9DeepEqual(src *CallbacksOrReferences) bool {

	if !p.Callbacks.DeepEqual(src) {
		return false
	}
	return true
}
func (p *Operation) Field10DeepEqual(src bool) bool {

	if p.Deprecated != src {
		return false
	}
	return true
}
func (p *Operation) Field11DeepEqual(src []*SecurityRequirement) bool {

	if len(p.Security) != len(src) {
		return false
	}
	for i, v := range p.Security {
		_src := src[i]
		if !v.DeepEqual(_src) {
			return false
		}
	}
	return true
}
func (p *Operation) Field12DeepEqual(src []*Server) bool {

	if len(p.Servers) != len(src) {
		return false
	}
	for i, v := range p.Servers {
		_src := src[i]
		if !v.DeepEqual(_src) {
			return false
		}
	}
	return true
}
func (p *Operation) Field13DeepEqual(src []*NamedAny) bool {

	if len(p.SpecificationExtension) != len(src) {
		return false
	}
	for i, v := range p.SpecificationExtension {
		_src := src[i]
		if !v.DeepEqual(_src) {
			return false
		}
	}
	return true
}

type Parameter struct {
	Name                   string                `thrift:"name,1" frugal:"1,default,string" json:"name"`
	In                     string                `thrift:"in,2" frugal:"2,default,string" json:"in"`
	Description            string                `thrift:"description,3" frugal:"3,default,string" json:"description"`
	Required               bool                  `thrift:"required,4" frugal:"4,default,bool" json:"required"`
	Deprecated             bool                  `thrift:"deprecated,5" frugal:"5,default,bool" json:"deprecated"`
	AllowEmptyValue        bool                  `thrift:"allow_empty_value,6" frugal:"6,default,bool" json:"allow_empty_value"`
	Style                  string                `thrift:"style,7" frugal:"7,default,string" json:"style"`
	Explode                bool                  `thrift:"explode,8" frugal:"8,default,bool" json:"explode"`
	AllowReserved          bool                  `thrift:"allow_reserved,9" frugal:"9,default,bool" json:"allow_reserved"`
	Schema                 *SchemaOrReference    `thrift:"schema,10" frugal:"10,default,SchemaOrReference" json:"schema"`
	Example                *Any                  `thrift:"example,11" frugal:"11,default,Any" json:"example"`
	Examples               *ExamplesOrReferences `thrift:"examples,12" frugal:"12,default,ExamplesOrReferences" json:"examples"`
	Content                *MediaTypes           `thrift:"content,13" frugal:"13,default,MediaTypes" json:"content"`
	SpecificationExtension []*NamedAny           `thrift:"specification_extension,14" frugal:"14,default,list<NamedAny>" json:"specification_extension"`
}

func NewParameter() *Parameter {
	return &Parameter{}
}

func (p *Parameter) InitDefault() {
}

func (p *Parameter) GetName() (v string) {
	return p.Name
}

func (p *Parameter) GetIn() (v string) {
	return p.In
}

func (p *Parameter) GetDescription() (v string) {
	return p.Description
}

func (p *Parameter) GetRequired() (v bool) {
	return p.Required
}

func (p *Parameter) GetDeprecated() (v bool) {
	return p.Deprecated
}

func (p *Parameter) GetAllowEmptyValue() (v bool) {
	return p.AllowEmptyValue
}

func (p *Parameter) GetStyle() (v string) {
	return p.Style
}

func (p *Parameter) GetExplode() (v bool) {
	return p.Explode
}

func (p *Parameter) GetAllowReserved() (v bool) {
	return p.AllowReserved
}

var Parameter_Schema_DEFAULT *SchemaOrReference

func (p *Parameter) GetSchema() (v *SchemaOrReference) {
	if !p.IsSetSchema() {
		return Parameter_Schema_DEFAULT
	}
	return p.Schema
}

var Parameter_Example_DEFAULT *Any

func (p *Parameter) GetExample() (v *Any) {
	if !p.IsSetExample() {
		return Parameter_Example_DEFAULT
	}
	return p.Example
}

var Parameter_Examples_DEFAULT *ExamplesOrReferences

func (p *Parameter) GetExamples() (v *ExamplesOrReferences) {
	if !p.IsSetExamples() {
		return Parameter_Examples_DEFAULT
	}
	return p.Examples
}

var Parameter_Content_DEFAULT *MediaTypes

func (p *Parameter) GetContent() (v *MediaTypes) {
	if !p.IsSetContent() {
		return Parameter_Content_DEFAULT
	}
	return p.Content
}

func (p *Parameter) GetSpecificationExtension() (v []*NamedAny) {
	return p.SpecificationExtension
}
func (p *Parameter) SetName(val string) {
	p.Name = val
}
func (p *Parameter) SetIn(val string) {
	p.In = val
}
func (p *Parameter) SetDescription(val string) {
	p.Description = val
}
func (p *Parameter) SetRequired(val bool) {
	p.Required = val
}
func (p *Parameter) SetDeprecated(val bool) {
	p.Deprecated = val
}
func (p *Parameter) SetAllowEmptyValue(val bool) {
	p.AllowEmptyValue = val
}
func (p *Parameter) SetStyle(val string) {
	p.Style = val
}
func (p *Parameter) SetExplode(val bool) {
	p.Explode = val
}
func (p *Parameter) SetAllowReserved(val bool) {
	p.AllowReserved = val
}
func (p *Parameter) SetSchema(val *SchemaOrReference) {
	p.Schema = val
}
func (p *Parameter) SetExample(val *Any) {
	p.Example = val
}
func (p *Parameter) SetExamples(val *ExamplesOrReferences) {
	p.Examples = val
}
func (p *Parameter) SetContent(val *MediaTypes) {
	p.Content = val
}
func (p *Parameter) SetSpecificationExtension(val []*NamedAny) {
	p.SpecificationExtension = val
}

var fieldIDToName_Parameter = map[int16]string{
	1:  "name",
	2:  "in",
	3:  "description",
	4:  "required",
	5:  "deprecated",
	6:  "allow_empty_value",
	7:  "style",
	8:  "explode",
	9:  "allow_reserved",
	10: "schema",
	11: "example",
	12: "examples",
	13: "content",
	14: "specification_extension",
}

func (p *Parameter) IsSetSchema() bool {
	return p.Schema != nil
}

func (p *Parameter) IsSetExample() bool {
	return p.Example != nil
}

func (p *Parameter) IsSetExamples() bool {
	return p.Examples != nil
}

func (p *Parameter) IsSetContent() bool {
	return p.Content != nil
}

func (p *Parameter) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 2:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField2(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 3:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField3(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 4:
			if fieldTypeId == thrift.BOOL {
				if err = p.ReadField4(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 5:
			if fieldTypeId == thrift.BOOL {
				if err = p.ReadField5(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 6:
			if fieldTypeId == thrift.BOOL {
				if err = p.ReadField6(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 7:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField7(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 8:
			if fieldTypeId == thrift.BOOL {
				if err = p.ReadField8(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 9:
			if fieldTypeId == thrift.BOOL {
				if err = p.ReadField9(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 10:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField10(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 11:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField11(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 12:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField12(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 13:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField13(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 14:
			if fieldTypeId == thrift.LIST {
				if err = p.ReadField14(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}
		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_Parameter[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *Parameter) ReadField1(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Name = _field
	return nil
}
func (p *Parameter) ReadField2(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p.In = _field
	return nil
}
func (p *Parameter) ReadField3(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Description = _field
	return nil
}
func (p *Parameter) ReadField4(iprot thrift.TProtocol) error {

	var _field bool
	if v, err := iprot.ReadBool(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Required = _field
	return nil
}
func (p *Parameter) ReadField5(iprot thrift.TProtocol) error {

	var _field bool
	if v, err := iprot.ReadBool(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Deprecated = _field
	return nil
}
func (p *Parameter) ReadField6(iprot thrift.TProtocol) error {

	var _field bool
	if v, err := iprot.ReadBool(); err != nil {
		return err
	} else {
		_field = v
	}
	p.AllowEmptyValue = _field
	return nil
}
func (p *Parameter) ReadField7(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Style = _field
	return nil
}
func (p *Parameter) ReadField8(iprot thrift.TProtocol) error {

	var _field bool
	if v, err := iprot.ReadBool(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Explode = _field
	return nil
}
func (p *Parameter) ReadField9(iprot thrift.TProtocol) error {

	var _field bool
	if v, err := iprot.ReadBool(); err != nil {
		return err
	} else {
		_field = v
	}
	p.AllowReserved = _field
	return nil
}
func (p *Parameter) ReadField10(iprot thrift.TProtocol) error {
	_field := NewSchemaOrReference()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Schema = _field
	return nil
}
func (p *Parameter) ReadField11(iprot thrift.TProtocol) error {
	_field := NewAny()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Example = _field
	return nil
}
func (p *Parameter) ReadField12(iprot thrift.TProtocol) error {
	_field := NewExamplesOrReferences()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Examples = _field
	return nil
}
func (p *Parameter) ReadField13(iprot thrift.TProtocol) error {
	_field := NewMediaTypes()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Content = _field
	return nil
}
func (p *Parameter) ReadField14(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	_field := make([]*NamedAny, 0, size)
	values := make([]NamedAny, size)
	for i := 0; i < size; i++ {
		_elem := &values[i]
		_elem.InitDefault()

		if err := _elem.Read(iprot); err != nil {
			return err
		}

		_field = append(_field, _elem)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return err
	}
	p.SpecificationExtension = _field
	return nil
}

func (p *Parameter) Write(oprot thrift.TProtocol) (err error) {

	var fieldId int16
	if err = oprot.WriteStructBegin("Parameter"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
		if err = p.writeField2(oprot); err != nil {
			fieldId = 2
			goto WriteFieldError
		}
		if err = p.writeField3(oprot); err != nil {
			fieldId = 3
			goto WriteFieldError
		}
		if err = p.writeField4(oprot); err != nil {
			fieldId = 4
			goto WriteFieldError
		}
		if err = p.writeField5(oprot); err != nil {
			fieldId = 5
			goto WriteFieldError
		}
		if err = p.writeField6(oprot); err != nil {
			fieldId = 6
			goto WriteFieldError
		}
		if err = p.writeField7(oprot); err != nil {
			fieldId = 7
			goto WriteFieldError
		}
		if err = p.writeField8(oprot); err != nil {
			fieldId = 8
			goto WriteFieldError
		}
		if err = p.writeField9(oprot); err != nil {
			fieldId = 9
			goto WriteFieldError
		}
		if err = p.writeField10(oprot); err != nil {
			fieldId = 10
			goto WriteFieldError
		}
		if err = p.writeField11(oprot); err != nil {
			fieldId = 11
			goto WriteFieldError
		}
		if err = p.writeField12(oprot); err != nil {
			fieldId = 12
			goto WriteFieldError
		}
		if err = p.writeField13(oprot); err != nil {
			fieldId = 13
			goto WriteFieldError
		}
		if err = p.writeField14(oprot); err != nil {
			fieldId = 14
			goto WriteFieldError
		}
	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *Parameter) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("name", thrift.STRING, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.Name); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *Parameter) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("in", thrift.STRING, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.In); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err)
}

func (p *Parameter) writeField3(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("description", thrift.STRING, 3); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.Description); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err)
}

func (p *Parameter) writeField4(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("required", thrift.BOOL, 4); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteBool(p.Required); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err)
}

func (p *Parameter) writeField5(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("deprecated", thrift.BOOL, 5); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteBool(p.Deprecated); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err)
}

func (p *Parameter) writeField6(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("allow_empty_value", thrift.BOOL, 6); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteBool(p.AllowEmptyValue); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 6 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err)
}

func (p *Parameter) writeField7(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("style", thrift.STRING, 7); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.Style); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 7 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 7 end error: ", p), err)
}

func (p *Parameter) writeField8(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("explode", thrift.BOOL, 8); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteBool(p.Explode); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 8 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 8 end error: ", p), err)
}

func (p *Parameter) writeField9(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("allow_reserved", thrift.BOOL, 9); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteBool(p.AllowReserved); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 9 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 9 end error: ", p), err)
}

func (p *Parameter) writeField10(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("schema", thrift.STRUCT, 10); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Schema.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 10 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 10 end error: ", p), err)
}

func (p *Parameter) writeField11(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("example", thrift.STRUCT, 11); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Example.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 11 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 11 end error: ", p), err)
}

func (p *Parameter) writeField12(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("examples", thrift.STRUCT, 12); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Examples.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 12 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 12 end error: ", p), err)
}

func (p *Parameter) writeField13(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("content", thrift.STRUCT, 13); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Content.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 13 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 13 end error: ", p), err)
}

func (p *Parameter) writeField14(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("specification_extension", thrift.LIST, 14); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.SpecificationExtension)); err != nil {
		return err
	}
	for _, v := range p.SpecificationExtension {
		if err := v.Write(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 14 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 14 end error: ", p), err)
}

func (p *Parameter) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("Parameter(%+v)", *p)

}

func (p *Parameter) DeepEqual(ano *Parameter) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.Name) {
		return false
	}
	if !p.Field2DeepEqual(ano.In) {
		return false
	}
	if !p.Field3DeepEqual(ano.Description) {
		return false
	}
	if !p.Field4DeepEqual(ano.Required) {
		return false
	}
	if !p.Field5DeepEqual(ano.Deprecated) {
		return false
	}
	if !p.Field6DeepEqual(ano.AllowEmptyValue) {
		return false
	}
	if !p.Field7DeepEqual(ano.Style) {
		return false
	}
	if !p.Field8DeepEqual(ano.Explode) {
		return false
	}
	if !p.Field9DeepEqual(ano.AllowReserved) {
		return false
	}
	if !p.Field10DeepEqual(ano.Schema) {
		return false
	}
	if !p.Field11DeepEqual(ano.Example) {
		return false
	}
	if !p.Field12DeepEqual(ano.Examples) {
		return false
	}
	if !p.Field13DeepEqual(ano.Content) {
		return false
	}
	if !p.Field14DeepEqual(ano.SpecificationExtension) {
		return false
	}
	return true
}

func (p *Parameter) Field1DeepEqual(src string) bool {

	if strings.Compare(p.Name, src) != 0 {
		return false
	}
	return true
}
func (p *Parameter) Field2DeepEqual(src string) bool {

	if strings.Compare(p.In, src) != 0 {
		return false
	}
	return true
}
func (p *Parameter) Field3DeepEqual(src string) bool {

	if strings.Compare(p.Description, src) != 0 {
		return false
	}
	return true
}
func (p *Parameter) Field4DeepEqual(src bool) bool {

	if p.Required != src {
		return false
	}
	return true
}
func (p *Parameter) Field5DeepEqual(src bool) bool {

	if p.Deprecated != src {
		return false
	}
	return true
}
func (p *Parameter) Field6DeepEqual(src bool) bool {

	if p.AllowEmptyValue != src {
		return false
	}
	return true
}
func (p *Parameter) Field7DeepEqual(src string) bool {

	if strings.Compare(p.Style, src) != 0 {
		return false
	}
	return true
}
func (p *Parameter) Field8DeepEqual(src bool) bool {

	if p.Explode != src {
		return false
	}
	return true
}
func (p *Parameter) Field9DeepEqual(src bool) bool {

	if p.AllowReserved != src {
		return false
	}
	return true
}
func (p *Parameter) Field10DeepEqual(src *SchemaOrReference) bool {

	if !p.Schema.DeepEqual(src) {
		return false
	}
	return true
}
func (p *Parameter) Field11DeepEqual(src *Any) bool {

	if !p.Example.DeepEqual(src) {
		return false
	}
	return true
}
func (p *Parameter) Field12DeepEqual(src *ExamplesOrReferences) bool {

	if !p.Examples.DeepEqual(src) {
		return false
	}
	return true
}
func (p *Parameter) Field13DeepEqual(src *MediaTypes) bool {

	if !p.Content.DeepEqual(src) {
		return false
	}
	return true
}
func (p *Parameter) Field14DeepEqual(src []*NamedAny) bool {

	if len(p.SpecificationExtension) != len(src) {
		return false
	}
	for i, v := range p.SpecificationExtension {
		_src := src[i]
		if !v.DeepEqual(_src) {
			return false
		}
	}
	return true
}

type ParameterOrReference struct {
	Parameter *Parameter `thrift:"parameter,1" frugal:"1,default,Parameter" json:"parameter"`
	Reference *Reference `thrift:"reference,2" frugal:"2,default,Reference" json:"reference"`
}

func NewParameterOrReference() *ParameterOrReference {
	return &ParameterOrReference{}
}

func (p *ParameterOrReference) InitDefault() {
}

var ParameterOrReference_Parameter_DEFAULT *Parameter

func (p *ParameterOrReference) GetParameter() (v *Parameter) {
	if !p.IsSetParameter() {
		return ParameterOrReference_Parameter_DEFAULT
	}
	return p.Parameter
}

var ParameterOrReference_Reference_DEFAULT *Reference

func (p *ParameterOrReference) GetReference() (v *Reference) {
	if !p.IsSetReference() {
		return ParameterOrReference_Reference_DEFAULT
	}
	return p.Reference
}
func (p *ParameterOrReference) SetParameter(val *Parameter) {
	p.Parameter = val
}
func (p *ParameterOrReference) SetReference(val *Reference) {
	p.Reference = val
}

var fieldIDToName_ParameterOrReference = map[int16]string{
	1: "parameter",
	2: "reference",
}

func (p *ParameterOrReference) IsSetParameter() bool {
	return p.Parameter != nil
}

func (p *ParameterOrReference) IsSetReference() bool {
	return p.Reference != nil
}

func (p *ParameterOrReference) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 2:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField2(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}
		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_ParameterOrReference[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *ParameterOrReference) ReadField1(iprot thrift.TProtocol) error {
	_field := NewParameter()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Parameter = _field
	return nil
}
func (p *ParameterOrReference) ReadField2(iprot thrift.TProtocol) error {
	_field := NewReference()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Reference = _field
	return nil
}

func (p *ParameterOrReference) Write(oprot thrift.TProtocol) (err error) {

	var fieldId int16
	if err = oprot.WriteStructBegin("ParameterOrReference"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
		if err = p.writeField2(oprot); err != nil {
			fieldId = 2
			goto WriteFieldError
		}
	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *ParameterOrReference) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("parameter", thrift.STRUCT, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Parameter.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *ParameterOrReference) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("reference", thrift.STRUCT, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Reference.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err)
}

func (p *ParameterOrReference) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("ParameterOrReference(%+v)", *p)

}

func (p *ParameterOrReference) DeepEqual(ano *ParameterOrReference) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.Parameter) {
		return false
	}
	if !p.Field2DeepEqual(ano.Reference) {
		return false
	}
	return true
}

func (p *ParameterOrReference) Field1DeepEqual(src *Parameter) bool {

	if !p.Parameter.DeepEqual(src) {
		return false
	}
	return true
}
func (p *ParameterOrReference) Field2DeepEqual(src *Reference) bool {

	if !p.Reference.DeepEqual(src) {
		return false
	}
	return true
}

type ParametersOrReferences struct {
	AdditionalProperties []*NamedParameterOrReference `thrift:"additional_properties,1" frugal:"1,default,list<NamedParameterOrReference>" json:"additional_properties"`
}

func NewParametersOrReferences() *ParametersOrReferences {
	return &ParametersOrReferences{}
}

func (p *ParametersOrReferences) InitDefault() {
}

func (p *ParametersOrReferences) GetAdditionalProperties() (v []*NamedParameterOrReference) {
	return p.AdditionalProperties
}
func (p *ParametersOrReferences) SetAdditionalProperties(val []*NamedParameterOrReference) {
	p.AdditionalProperties = val
}

var fieldIDToName_ParametersOrReferences = map[int16]string{
	1: "additional_properties",
}

func (p *ParametersOrReferences) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.LIST {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}
		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_ParametersOrReferences[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *ParametersOrReferences) ReadField1(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	_field := make([]*NamedParameterOrReference, 0, size)
	values := make([]NamedParameterOrReference, size)
	for i := 0; i < size; i++ {
		_elem := &values[i]
		_elem.InitDefault()

		if err := _elem.Read(iprot); err != nil {
			return err
		}

		_field = append(_field, _elem)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return err
	}
	p.AdditionalProperties = _field
	return nil
}

func (p *ParametersOrReferences) Write(oprot thrift.TProtocol) (err error) {

	var fieldId int16
	if err = oprot.WriteStructBegin("ParametersOrReferences"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *ParametersOrReferences) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("additional_properties", thrift.LIST, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.AdditionalProperties)); err != nil {
		return err
	}
	for _, v := range p.AdditionalProperties {
		if err := v.Write(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *ParametersOrReferences) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("ParametersOrReferences(%+v)", *p)

}

func (p *ParametersOrReferences) DeepEqual(ano *ParametersOrReferences) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.AdditionalProperties) {
		return false
	}
	return true
}

func (p *ParametersOrReferences) Field1DeepEqual(src []*NamedParameterOrReference) bool {

	if len(p.AdditionalProperties) != len(src) {
		return false
	}
	for i, v := range p.AdditionalProperties {
		_src := src[i]
		if !v.DeepEqual(_src) {
			return false
		}
	}
	return true
}

type PathItem struct {
	Xref                   string                  `thrift:"xref,1" frugal:"1,default,string" json:"xref"`
	Summary                string                  `thrift:"summary,2" frugal:"2,default,string" json:"summary"`
	Description            string                  `thrift:"description,3" frugal:"3,default,string" json:"description"`
	Get                    *Operation              `thrift:"get,4" frugal:"4,default,Operation" json:"get"`
	Put                    *Operation              `thrift:"put,5" frugal:"5,default,Operation" json:"put"`
	Post                   *Operation              `thrift:"post,6" frugal:"6,default,Operation" json:"post"`
	Delete                 *Operation              `thrift:"delete,7" frugal:"7,default,Operation" json:"delete"`
	Options                *Operation              `thrift:"options,8" frugal:"8,default,Operation" json:"options"`
	Head                   *Operation              `thrift:"head,9" frugal:"9,default,Operation" json:"head"`
	Patch                  *Operation              `thrift:"patch,10" frugal:"10,default,Operation" json:"patch"`
	Trace                  *Operation              `thrift:"trace,11" frugal:"11,default,Operation" json:"trace"`
	Servers                []*Server               `thrift:"servers,12" frugal:"12,default,list<Server>" json:"servers"`
	Parameters             []*ParameterOrReference `thrift:"parameters,13" frugal:"13,default,list<ParameterOrReference>" json:"parameters"`
	SpecificationExtension []*NamedAny             `thrift:"specification_extension,14" frugal:"14,default,list<NamedAny>" json:"specification_extension"`
}

func NewPathItem() *PathItem {
	return &PathItem{}
}

func (p *PathItem) InitDefault() {
}

func (p *PathItem) GetXref() (v string) {
	return p.Xref
}

func (p *PathItem) GetSummary() (v string) {
	return p.Summary
}

func (p *PathItem) GetDescription() (v string) {
	return p.Description
}

var PathItem_Get_DEFAULT *Operation

func (p *PathItem) GetGet() (v *Operation) {
	if !p.IsSetGet() {
		return PathItem_Get_DEFAULT
	}
	return p.Get
}

var PathItem_Put_DEFAULT *Operation

func (p *PathItem) GetPut() (v *Operation) {
	if !p.IsSetPut() {
		return PathItem_Put_DEFAULT
	}
	return p.Put
}

var PathItem_Post_DEFAULT *Operation

func (p *PathItem) GetPost() (v *Operation) {
	if !p.IsSetPost() {
		return PathItem_Post_DEFAULT
	}
	return p.Post
}

var PathItem_Delete_DEFAULT *Operation

func (p *PathItem) GetDelete() (v *Operation) {
	if !p.IsSetDelete() {
		return PathItem_Delete_DEFAULT
	}
	return p.Delete
}

var PathItem_Options_DEFAULT *Operation

func (p *PathItem) GetOptions() (v *Operation) {
	if !p.IsSetOptions() {
		return PathItem_Options_DEFAULT
	}
	return p.Options
}

var PathItem_Head_DEFAULT *Operation

func (p *PathItem) GetHead() (v *Operation) {
	if !p.IsSetHead() {
		return PathItem_Head_DEFAULT
	}
	return p.Head
}

var PathItem_Patch_DEFAULT *Operation

func (p *PathItem) GetPatch() (v *Operation) {
	if !p.IsSetPatch() {
		return PathItem_Patch_DEFAULT
	}
	return p.Patch
}

var PathItem_Trace_DEFAULT *Operation

func (p *PathItem) GetTrace() (v *Operation) {
	if !p.IsSetTrace() {
		return PathItem_Trace_DEFAULT
	}
	return p.Trace
}

func (p *PathItem) GetServers() (v []*Server) {
	return p.Servers
}

func (p *PathItem) GetParameters() (v []*ParameterOrReference) {
	return p.Parameters
}

func (p *PathItem) GetSpecificationExtension() (v []*NamedAny) {
	return p.SpecificationExtension
}
func (p *PathItem) SetXref(val string) {
	p.Xref = val
}
func (p *PathItem) SetSummary(val string) {
	p.Summary = val
}
func (p *PathItem) SetDescription(val string) {
	p.Description = val
}
func (p *PathItem) SetGet(val *Operation) {
	p.Get = val
}
func (p *PathItem) SetPut(val *Operation) {
	p.Put = val
}
func (p *PathItem) SetPost(val *Operation) {
	p.Post = val
}
func (p *PathItem) SetDelete(val *Operation) {
	p.Delete = val
}
func (p *PathItem) SetOptions(val *Operation) {
	p.Options = val
}
func (p *PathItem) SetHead(val *Operation) {
	p.Head = val
}
func (p *PathItem) SetPatch(val *Operation) {
	p.Patch = val
}
func (p *PathItem) SetTrace(val *Operation) {
	p.Trace = val
}
func (p *PathItem) SetServers(val []*Server) {
	p.Servers = val
}
func (p *PathItem) SetParameters(val []*ParameterOrReference) {
	p.Parameters = val
}
func (p *PathItem) SetSpecificationExtension(val []*NamedAny) {
	p.SpecificationExtension = val
}

var fieldIDToName_PathItem = map[int16]string{
	1:  "xref",
	2:  "summary",
	3:  "description",
	4:  "get",
	5:  "put",
	6:  "post",
	7:  "delete",
	8:  "options",
	9:  "head",
	10: "patch",
	11: "trace",
	12: "servers",
	13: "parameters",
	14: "specification_extension",
}

func (p *PathItem) IsSetGet() bool {
	return p.Get != nil
}

func (p *PathItem) IsSetPut() bool {
	return p.Put != nil
}

func (p *PathItem) IsSetPost() bool {
	return p.Post != nil
}

func (p *PathItem) IsSetDelete() bool {
	return p.Delete != nil
}

func (p *PathItem) IsSetOptions() bool {
	return p.Options != nil
}

func (p *PathItem) IsSetHead() bool {
	return p.Head != nil
}

func (p *PathItem) IsSetPatch() bool {
	return p.Patch != nil
}

func (p *PathItem) IsSetTrace() bool {
	return p.Trace != nil
}

func (p *PathItem) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 2:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField2(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 3:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField3(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 4:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField4(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 5:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField5(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 6:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField6(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 7:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField7(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 8:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField8(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 9:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField9(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 10:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField10(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 11:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField11(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 12:
			if fieldTypeId == thrift.LIST {
				if err = p.ReadField12(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 13:
			if fieldTypeId == thrift.LIST {
				if err = p.ReadField13(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 14:
			if fieldTypeId == thrift.LIST {
				if err = p.ReadField14(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}
		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PathItem[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *PathItem) ReadField1(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Xref = _field
	return nil
}
func (p *PathItem) ReadField2(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Summary = _field
	return nil
}
func (p *PathItem) ReadField3(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Description = _field
	return nil
}
func (p *PathItem) ReadField4(iprot thrift.TProtocol) error {
	_field := NewOperation()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Get = _field
	return nil
}
func (p *PathItem) ReadField5(iprot thrift.TProtocol) error {
	_field := NewOperation()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Put = _field
	return nil
}
func (p *PathItem) ReadField6(iprot thrift.TProtocol) error {
	_field := NewOperation()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Post = _field
	return nil
}
func (p *PathItem) ReadField7(iprot thrift.TProtocol) error {
	_field := NewOperation()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Delete = _field
	return nil
}
func (p *PathItem) ReadField8(iprot thrift.TProtocol) error {
	_field := NewOperation()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Options = _field
	return nil
}
func (p *PathItem) ReadField9(iprot thrift.TProtocol) error {
	_field := NewOperation()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Head = _field
	return nil
}
func (p *PathItem) ReadField10(iprot thrift.TProtocol) error {
	_field := NewOperation()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Patch = _field
	return nil
}
func (p *PathItem) ReadField11(iprot thrift.TProtocol) error {
	_field := NewOperation()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Trace = _field
	return nil
}
func (p *PathItem) ReadField12(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	_field := make([]*Server, 0, size)
	values := make([]Server, size)
	for i := 0; i < size; i++ {
		_elem := &values[i]
		_elem.InitDefault()

		if err := _elem.Read(iprot); err != nil {
			return err
		}

		_field = append(_field, _elem)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return err
	}
	p.Servers = _field
	return nil
}
func (p *PathItem) ReadField13(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	_field := make([]*ParameterOrReference, 0, size)
	values := make([]ParameterOrReference, size)
	for i := 0; i < size; i++ {
		_elem := &values[i]
		_elem.InitDefault()

		if err := _elem.Read(iprot); err != nil {
			return err
		}

		_field = append(_field, _elem)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return err
	}
	p.Parameters = _field
	return nil
}
func (p *PathItem) ReadField14(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	_field := make([]*NamedAny, 0, size)
	values := make([]NamedAny, size)
	for i := 0; i < size; i++ {
		_elem := &values[i]
		_elem.InitDefault()

		if err := _elem.Read(iprot); err != nil {
			return err
		}

		_field = append(_field, _elem)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return err
	}
	p.SpecificationExtension = _field
	return nil
}

func (p *PathItem) Write(oprot thrift.TProtocol) (err error) {

	var fieldId int16
	if err = oprot.WriteStructBegin("PathItem"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
		if err = p.writeField2(oprot); err != nil {
			fieldId = 2
			goto WriteFieldError
		}
		if err = p.writeField3(oprot); err != nil {
			fieldId = 3
			goto WriteFieldError
		}
		if err = p.writeField4(oprot); err != nil {
			fieldId = 4
			goto WriteFieldError
		}
		if err = p.writeField5(oprot); err != nil {
			fieldId = 5
			goto WriteFieldError
		}
		if err = p.writeField6(oprot); err != nil {
			fieldId = 6
			goto WriteFieldError
		}
		if err = p.writeField7(oprot); err != nil {
			fieldId = 7
			goto WriteFieldError
		}
		if err = p.writeField8(oprot); err != nil {
			fieldId = 8
			goto WriteFieldError
		}
		if err = p.writeField9(oprot); err != nil {
			fieldId = 9
			goto WriteFieldError
		}
		if err = p.writeField10(oprot); err != nil {
			fieldId = 10
			goto WriteFieldError
		}
		if err = p.writeField11(oprot); err != nil {
			fieldId = 11
			goto WriteFieldError
		}
		if err = p.writeField12(oprot); err != nil {
			fieldId = 12
			goto WriteFieldError
		}
		if err = p.writeField13(oprot); err != nil {
			fieldId = 13
			goto WriteFieldError
		}
		if err = p.writeField14(oprot); err != nil {
			fieldId = 14
			goto WriteFieldError
		}
	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *PathItem) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("xref", thrift.STRING, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.Xref); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *PathItem) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("summary", thrift.STRING, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.Summary); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err)
}

func (p *PathItem) writeField3(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("description", thrift.STRING, 3); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.Description); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err)
}

func (p *PathItem) writeField4(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("get", thrift.STRUCT, 4); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Get.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err)
}

func (p *PathItem) writeField5(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("put", thrift.STRUCT, 5); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Put.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err)
}

func (p *PathItem) writeField6(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("post", thrift.STRUCT, 6); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Post.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 6 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err)
}

func (p *PathItem) writeField7(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("delete", thrift.STRUCT, 7); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Delete.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 7 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 7 end error: ", p), err)
}

func (p *PathItem) writeField8(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("options", thrift.STRUCT, 8); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Options.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 8 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 8 end error: ", p), err)
}

func (p *PathItem) writeField9(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("head", thrift.STRUCT, 9); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Head.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 9 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 9 end error: ", p), err)
}

func (p *PathItem) writeField10(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("patch", thrift.STRUCT, 10); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Patch.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 10 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 10 end error: ", p), err)
}

func (p *PathItem) writeField11(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("trace", thrift.STRUCT, 11); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Trace.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 11 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 11 end error: ", p), err)
}

func (p *PathItem) writeField12(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("servers", thrift.LIST, 12); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Servers)); err != nil {
		return err
	}
	for _, v := range p.Servers {
		if err := v.Write(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 12 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 12 end error: ", p), err)
}

func (p *PathItem) writeField13(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("parameters", thrift.LIST, 13); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Parameters)); err != nil {
		return err
	}
	for _, v := range p.Parameters {
		if err := v.Write(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 13 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 13 end error: ", p), err)
}

func (p *PathItem) writeField14(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("specification_extension", thrift.LIST, 14); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.SpecificationExtension)); err != nil {
		return err
	}
	for _, v := range p.SpecificationExtension {
		if err := v.Write(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 14 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 14 end error: ", p), err)
}

func (p *PathItem) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("PathItem(%+v)", *p)

}

func (p *PathItem) DeepEqual(ano *PathItem) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.Xref) {
		return false
	}
	if !p.Field2DeepEqual(ano.Summary) {
		return false
	}
	if !p.Field3DeepEqual(ano.Description) {
		return false
	}
	if !p.Field4DeepEqual(ano.Get) {
		return false
	}
	if !p.Field5DeepEqual(ano.Put) {
		return false
	}
	if !p.Field6DeepEqual(ano.Post) {
		return false
	}
	if !p.Field7DeepEqual(ano.Delete) {
		return false
	}
	if !p.Field8DeepEqual(ano.Options) {
		return false
	}
	if !p.Field9DeepEqual(ano.Head) {
		return false
	}
	if !p.Field10DeepEqual(ano.Patch) {
		return false
	}
	if !p.Field11DeepEqual(ano.Trace) {
		return false
	}
	if !p.Field12DeepEqual(ano.Servers) {
		return false
	}
	if !p.Field13DeepEqual(ano.Parameters) {
		return false
	}
	if !p.Field14DeepEqual(ano.SpecificationExtension) {
		return false
	}
	return true
}

func (p *PathItem) Field1DeepEqual(src string) bool {

	if strings.Compare(p.Xref, src) != 0 {
		return false
	}
	return true
}
func (p *PathItem) Field2DeepEqual(src string) bool {

	if strings.Compare(p.Summary, src) != 0 {
		return false
	}
	return true
}
func (p *PathItem) Field3DeepEqual(src string) bool {

	if strings.Compare(p.Description, src) != 0 {
		return false
	}
	return true
}
func (p *PathItem) Field4DeepEqual(src *Operation) bool {

	if !p.Get.DeepEqual(src) {
		return false
	}
	return true
}
func (p *PathItem) Field5DeepEqual(src *Operation) bool {

	if !p.Put.DeepEqual(src) {
		return false
	}
	return true
}
func (p *PathItem) Field6DeepEqual(src *Operation) bool {

	if !p.Post.DeepEqual(src) {
		return false
	}
	return true
}
func (p *PathItem) Field7DeepEqual(src *Operation) bool {

	if !p.Delete.DeepEqual(src) {
		return false
	}
	return true
}
func (p *PathItem) Field8DeepEqual(src *Operation) bool {

	if !p.Options.DeepEqual(src) {
		return false
	}
	return true
}
func (p *PathItem) Field9DeepEqual(src *Operation) bool {

	if !p.Head.DeepEqual(src) {
		return false
	}
	return true
}
func (p *PathItem) Field10DeepEqual(src *Operation) bool {

	if !p.Patch.DeepEqual(src) {
		return false
	}
	return true
}
func (p *PathItem) Field11DeepEqual(src *Operation) bool {

	if !p.Trace.DeepEqual(src) {
		return false
	}
	return true
}
func (p *PathItem) Field12DeepEqual(src []*Server) bool {

	if len(p.Servers) != len(src) {
		return false
	}
	for i, v := range p.Servers {
		_src := src[i]
		if !v.DeepEqual(_src) {
			return false
		}
	}
	return true
}
func (p *PathItem) Field13DeepEqual(src []*ParameterOrReference) bool {

	if len(p.Parameters) != len(src) {
		return false
	}
	for i, v := range p.Parameters {
		_src := src[i]
		if !v.DeepEqual(_src) {
			return false
		}
	}
	return true
}
func (p *PathItem) Field14DeepEqual(src []*NamedAny) bool {

	if len(p.SpecificationExtension) != len(src) {
		return false
	}
	for i, v := range p.SpecificationExtension {
		_src := src[i]
		if !v.DeepEqual(_src) {
			return false
		}
	}
	return true
}

type Paths struct {
	Path                   []*NamedPathItem `thrift:"path,1" frugal:"1,default,list<NamedPathItem>" json:"path"`
	SpecificationExtension []*NamedAny      `thrift:"specification_extension,2" frugal:"2,default,list<NamedAny>" json:"specification_extension"`
}

func NewPaths() *Paths {
	return &Paths{}
}

func (p *Paths) InitDefault() {
}

func (p *Paths) GetPath() (v []*NamedPathItem) {
	return p.Path
}

func (p *Paths) GetSpecificationExtension() (v []*NamedAny) {
	return p.SpecificationExtension
}
func (p *Paths) SetPath(val []*NamedPathItem) {
	p.Path = val
}
func (p *Paths) SetSpecificationExtension(val []*NamedAny) {
	p.SpecificationExtension = val
}

var fieldIDToName_Paths = map[int16]string{
	1: "path",
	2: "specification_extension",
}

func (p *Paths) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.LIST {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 2:
			if fieldTypeId == thrift.LIST {
				if err = p.ReadField2(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}
		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_Paths[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *Paths) ReadField1(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	_field := make([]*NamedPathItem, 0, size)
	values := make([]NamedPathItem, size)
	for i := 0; i < size; i++ {
		_elem := &values[i]
		_elem.InitDefault()

		if err := _elem.Read(iprot); err != nil {
			return err
		}

		_field = append(_field, _elem)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return err
	}
	p.Path = _field
	return nil
}
func (p *Paths) ReadField2(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	_field := make([]*NamedAny, 0, size)
	values := make([]NamedAny, size)
	for i := 0; i < size; i++ {
		_elem := &values[i]
		_elem.InitDefault()

		if err := _elem.Read(iprot); err != nil {
			return err
		}

		_field = append(_field, _elem)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return err
	}
	p.SpecificationExtension = _field
	return nil
}

func (p *Paths) Write(oprot thrift.TProtocol) (err error) {

	var fieldId int16
	if err = oprot.WriteStructBegin("Paths"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
		if err = p.writeField2(oprot); err != nil {
			fieldId = 2
			goto WriteFieldError
		}
	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *Paths) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("path", thrift.LIST, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Path)); err != nil {
		return err
	}
	for _, v := range p.Path {
		if err := v.Write(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *Paths) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("specification_extension", thrift.LIST, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.SpecificationExtension)); err != nil {
		return err
	}
	for _, v := range p.SpecificationExtension {
		if err := v.Write(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err)
}

func (p *Paths) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("Paths(%+v)", *p)

}

func (p *Paths) DeepEqual(ano *Paths) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.Path) {
		return false
	}
	if !p.Field2DeepEqual(ano.SpecificationExtension) {
		return false
	}
	return true
}

func (p *Paths) Field1DeepEqual(src []*NamedPathItem) bool {

	if len(p.Path) != len(src) {
		return false
	}
	for i, v := range p.Path {
		_src := src[i]
		if !v.DeepEqual(_src) {
			return false
		}
	}
	return true
}
func (p *Paths) Field2DeepEqual(src []*NamedAny) bool {

	if len(p.SpecificationExtension) != len(src) {
		return false
	}
	for i, v := range p.SpecificationExtension {
		_src := src[i]
		if !v.DeepEqual(_src) {
			return false
		}
	}
	return true
}

type Properties struct {
	AdditionalProperties []*NamedSchemaOrReference `thrift:"additional_properties,1" frugal:"1,default,list<NamedSchemaOrReference>" json:"additional_properties"`
}

func NewProperties() *Properties {
	return &Properties{}
}

func (p *Properties) InitDefault() {
}

func (p *Properties) GetAdditionalProperties() (v []*NamedSchemaOrReference) {
	return p.AdditionalProperties
}
func (p *Properties) SetAdditionalProperties(val []*NamedSchemaOrReference) {
	p.AdditionalProperties = val
}

var fieldIDToName_Properties = map[int16]string{
	1: "additional_properties",
}

func (p *Properties) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.LIST {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}
		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_Properties[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *Properties) ReadField1(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	_field := make([]*NamedSchemaOrReference, 0, size)
	values := make([]NamedSchemaOrReference, size)
	for i := 0; i < size; i++ {
		_elem := &values[i]
		_elem.InitDefault()

		if err := _elem.Read(iprot); err != nil {
			return err
		}

		_field = append(_field, _elem)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return err
	}
	p.AdditionalProperties = _field
	return nil
}

func (p *Properties) Write(oprot thrift.TProtocol) (err error) {

	var fieldId int16
	if err = oprot.WriteStructBegin("Properties"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *Properties) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("additional_properties", thrift.LIST, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.AdditionalProperties)); err != nil {
		return err
	}
	for _, v := range p.AdditionalProperties {
		if err := v.Write(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *Properties) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("Properties(%+v)", *p)

}

func (p *Properties) DeepEqual(ano *Properties) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.AdditionalProperties) {
		return false
	}
	return true
}

func (p *Properties) Field1DeepEqual(src []*NamedSchemaOrReference) bool {

	if len(p.AdditionalProperties) != len(src) {
		return false
	}
	for i, v := range p.AdditionalProperties {
		_src := src[i]
		if !v.DeepEqual(_src) {
			return false
		}
	}
	return true
}

type Reference struct {
	Xref        string `thrift:"xref,1" frugal:"1,default,string" json:"xref"`
	Summary     string `thrift:"summary,2" frugal:"2,default,string" json:"summary"`
	Description string `thrift:"description,3" frugal:"3,default,string" json:"description"`
}

func NewReference() *Reference {
	return &Reference{}
}

func (p *Reference) InitDefault() {
}

func (p *Reference) GetXref() (v string) {
	return p.Xref
}

func (p *Reference) GetSummary() (v string) {
	return p.Summary
}

func (p *Reference) GetDescription() (v string) {
	return p.Description
}
func (p *Reference) SetXref(val string) {
	p.Xref = val
}
func (p *Reference) SetSummary(val string) {
	p.Summary = val
}
func (p *Reference) SetDescription(val string) {
	p.Description = val
}

var fieldIDToName_Reference = map[int16]string{
	1: "xref",
	2: "summary",
	3: "description",
}

func (p *Reference) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 2:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField2(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 3:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField3(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}
		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_Reference[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *Reference) ReadField1(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Xref = _field
	return nil
}
func (p *Reference) ReadField2(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Summary = _field
	return nil
}
func (p *Reference) ReadField3(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Description = _field
	return nil
}

func (p *Reference) Write(oprot thrift.TProtocol) (err error) {

	var fieldId int16
	if err = oprot.WriteStructBegin("Reference"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
		if err = p.writeField2(oprot); err != nil {
			fieldId = 2
			goto WriteFieldError
		}
		if err = p.writeField3(oprot); err != nil {
			fieldId = 3
			goto WriteFieldError
		}
	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *Reference) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("xref", thrift.STRING, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.Xref); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *Reference) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("summary", thrift.STRING, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.Summary); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err)
}

func (p *Reference) writeField3(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("description", thrift.STRING, 3); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.Description); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err)
}

func (p *Reference) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("Reference(%+v)", *p)

}

func (p *Reference) DeepEqual(ano *Reference) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.Xref) {
		return false
	}
	if !p.Field2DeepEqual(ano.Summary) {
		return false
	}
	if !p.Field3DeepEqual(ano.Description) {
		return false
	}
	return true
}

func (p *Reference) Field1DeepEqual(src string) bool {

	if strings.Compare(p.Xref, src) != 0 {
		return false
	}
	return true
}
func (p *Reference) Field2DeepEqual(src string) bool {

	if strings.Compare(p.Summary, src) != 0 {
		return false
	}
	return true
}
func (p *Reference) Field3DeepEqual(src string) bool {

	if strings.Compare(p.Description, src) != 0 {
		return false
	}
	return true
}

type RequestBody struct {
	Description            string      `thrift:"description,1" frugal:"1,default,string" json:"description"`
	Content                *MediaTypes `thrift:"content,2" frugal:"2,default,MediaTypes" json:"content"`
	Required               bool        `thrift:"required,3" frugal:"3,default,bool" json:"required"`
	SpecificationExtension []*NamedAny `thrift:"specification_extension,4" frugal:"4,default,list<NamedAny>" json:"specification_extension"`
}

func NewRequestBody() *RequestBody {
	return &RequestBody{}
}

func (p *RequestBody) InitDefault() {
}

func (p *RequestBody) GetDescription() (v string) {
	return p.Description
}

var RequestBody_Content_DEFAULT *MediaTypes

func (p *RequestBody) GetContent() (v *MediaTypes) {
	if !p.IsSetContent() {
		return RequestBody_Content_DEFAULT
	}
	return p.Content
}

func (p *RequestBody) GetRequired() (v bool) {
	return p.Required
}

func (p *RequestBody) GetSpecificationExtension() (v []*NamedAny) {
	return p.SpecificationExtension
}
func (p *RequestBody) SetDescription(val string) {
	p.Description = val
}
func (p *RequestBody) SetContent(val *MediaTypes) {
	p.Content = val
}
func (p *RequestBody) SetRequired(val bool) {
	p.Required = val
}
func (p *RequestBody) SetSpecificationExtension(val []*NamedAny) {
	p.SpecificationExtension = val
}

var fieldIDToName_RequestBody = map[int16]string{
	1: "description",
	2: "content",
	3: "required",
	4: "specification_extension",
}

func (p *RequestBody) IsSetContent() bool {
	return p.Content != nil
}

func (p *RequestBody) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 2:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField2(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 3:
			if fieldTypeId == thrift.BOOL {
				if err = p.ReadField3(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 4:
			if fieldTypeId == thrift.LIST {
				if err = p.ReadField4(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}
		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_RequestBody[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *RequestBody) ReadField1(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Description = _field
	return nil
}
func (p *RequestBody) ReadField2(iprot thrift.TProtocol) error {
	_field := NewMediaTypes()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Content = _field
	return nil
}
func (p *RequestBody) ReadField3(iprot thrift.TProtocol) error {

	var _field bool
	if v, err := iprot.ReadBool(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Required = _field
	return nil
}
func (p *RequestBody) ReadField4(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	_field := make([]*NamedAny, 0, size)
	values := make([]NamedAny, size)
	for i := 0; i < size; i++ {
		_elem := &values[i]
		_elem.InitDefault()

		if err := _elem.Read(iprot); err != nil {
			return err
		}

		_field = append(_field, _elem)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return err
	}
	p.SpecificationExtension = _field
	return nil
}

func (p *RequestBody) Write(oprot thrift.TProtocol) (err error) {

	var fieldId int16
	if err = oprot.WriteStructBegin("RequestBody"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
		if err = p.writeField2(oprot); err != nil {
			fieldId = 2
			goto WriteFieldError
		}
		if err = p.writeField3(oprot); err != nil {
			fieldId = 3
			goto WriteFieldError
		}
		if err = p.writeField4(oprot); err != nil {
			fieldId = 4
			goto WriteFieldError
		}
	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *RequestBody) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("description", thrift.STRING, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.Description); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *RequestBody) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("content", thrift.STRUCT, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Content.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err)
}

func (p *RequestBody) writeField3(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("required", thrift.BOOL, 3); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteBool(p.Required); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err)
}

func (p *RequestBody) writeField4(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("specification_extension", thrift.LIST, 4); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.SpecificationExtension)); err != nil {
		return err
	}
	for _, v := range p.SpecificationExtension {
		if err := v.Write(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err)
}

func (p *RequestBody) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("RequestBody(%+v)", *p)

}

func (p *RequestBody) DeepEqual(ano *RequestBody) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.Description) {
		return false
	}
	if !p.Field2DeepEqual(ano.Content) {
		return false
	}
	if !p.Field3DeepEqual(ano.Required) {
		return false
	}
	if !p.Field4DeepEqual(ano.SpecificationExtension) {
		return false
	}
	return true
}

func (p *RequestBody) Field1DeepEqual(src string) bool {

	if strings.Compare(p.Description, src) != 0 {
		return false
	}
	return true
}
func (p *RequestBody) Field2DeepEqual(src *MediaTypes) bool {

	if !p.Content.DeepEqual(src) {
		return false
	}
	return true
}
func (p *RequestBody) Field3DeepEqual(src bool) bool {

	if p.Required != src {
		return false
	}
	return true
}
func (p *RequestBody) Field4DeepEqual(src []*NamedAny) bool {

	if len(p.SpecificationExtension) != len(src) {
		return false
	}
	for i, v := range p.SpecificationExtension {
		_src := src[i]
		if !v.DeepEqual(_src) {
			return false
		}
	}
	return true
}

type RequestBodyOrReference struct {
	RequestBody *RequestBody `thrift:"request_body,1" frugal:"1,default,RequestBody" json:"request_body"`
	Reference   *Reference   `thrift:"reference,2" frugal:"2,default,Reference" json:"reference"`
}

func NewRequestBodyOrReference() *RequestBodyOrReference {
	return &RequestBodyOrReference{}
}

func (p *RequestBodyOrReference) InitDefault() {
}

var RequestBodyOrReference_RequestBody_DEFAULT *RequestBody

func (p *RequestBodyOrReference) GetRequestBody() (v *RequestBody) {
	if !p.IsSetRequestBody() {
		return RequestBodyOrReference_RequestBody_DEFAULT
	}
	return p.RequestBody
}

var RequestBodyOrReference_Reference_DEFAULT *Reference

func (p *RequestBodyOrReference) GetReference() (v *Reference) {
	if !p.IsSetReference() {
		return RequestBodyOrReference_Reference_DEFAULT
	}
	return p.Reference
}
func (p *RequestBodyOrReference) SetRequestBody(val *RequestBody) {
	p.RequestBody = val
}
func (p *RequestBodyOrReference) SetReference(val *Reference) {
	p.Reference = val
}

var fieldIDToName_RequestBodyOrReference = map[int16]string{
	1: "request_body",
	2: "reference",
}

func (p *RequestBodyOrReference) IsSetRequestBody() bool {
	return p.RequestBody != nil
}

func (p *RequestBodyOrReference) IsSetReference() bool {
	return p.Reference != nil
}

func (p *RequestBodyOrReference) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 2:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField2(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}
		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_RequestBodyOrReference[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *RequestBodyOrReference) ReadField1(iprot thrift.TProtocol) error {
	_field := NewRequestBody()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.RequestBody = _field
	return nil
}
func (p *RequestBodyOrReference) ReadField2(iprot thrift.TProtocol) error {
	_field := NewReference()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Reference = _field
	return nil
}

func (p *RequestBodyOrReference) Write(oprot thrift.TProtocol) (err error) {

	var fieldId int16
	if err = oprot.WriteStructBegin("RequestBodyOrReference"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
		if err = p.writeField2(oprot); err != nil {
			fieldId = 2
			goto WriteFieldError
		}
	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *RequestBodyOrReference) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("request_body", thrift.STRUCT, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.RequestBody.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *RequestBodyOrReference) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("reference", thrift.STRUCT, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Reference.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err)
}

func (p *RequestBodyOrReference) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("RequestBodyOrReference(%+v)", *p)

}

func (p *RequestBodyOrReference) DeepEqual(ano *RequestBodyOrReference) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.RequestBody) {
		return false
	}
	if !p.Field2DeepEqual(ano.Reference) {
		return false
	}
	return true
}

func (p *RequestBodyOrReference) Field1DeepEqual(src *RequestBody) bool {

	if !p.RequestBody.DeepEqual(src) {
		return false
	}
	return true
}
func (p *RequestBodyOrReference) Field2DeepEqual(src *Reference) bool {

	if !p.Reference.DeepEqual(src) {
		return false
	}
	return true
}

type RequestBodiesOrReferences struct {
	AdditionalProperties []*NamedRequestBodyOrReference `thrift:"additional_properties,1" frugal:"1,default,list<NamedRequestBodyOrReference>" json:"additional_properties"`
}

func NewRequestBodiesOrReferences() *RequestBodiesOrReferences {
	return &RequestBodiesOrReferences{}
}

func (p *RequestBodiesOrReferences) InitDefault() {
}

func (p *RequestBodiesOrReferences) GetAdditionalProperties() (v []*NamedRequestBodyOrReference) {
	return p.AdditionalProperties
}
func (p *RequestBodiesOrReferences) SetAdditionalProperties(val []*NamedRequestBodyOrReference) {
	p.AdditionalProperties = val
}

var fieldIDToName_RequestBodiesOrReferences = map[int16]string{
	1: "additional_properties",
}

func (p *RequestBodiesOrReferences) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.LIST {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}
		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_RequestBodiesOrReferences[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *RequestBodiesOrReferences) ReadField1(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	_field := make([]*NamedRequestBodyOrReference, 0, size)
	values := make([]NamedRequestBodyOrReference, size)
	for i := 0; i < size; i++ {
		_elem := &values[i]
		_elem.InitDefault()

		if err := _elem.Read(iprot); err != nil {
			return err
		}

		_field = append(_field, _elem)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return err
	}
	p.AdditionalProperties = _field
	return nil
}

func (p *RequestBodiesOrReferences) Write(oprot thrift.TProtocol) (err error) {

	var fieldId int16
	if err = oprot.WriteStructBegin("RequestBodiesOrReferences"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *RequestBodiesOrReferences) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("additional_properties", thrift.LIST, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.AdditionalProperties)); err != nil {
		return err
	}
	for _, v := range p.AdditionalProperties {
		if err := v.Write(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *RequestBodiesOrReferences) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("RequestBodiesOrReferences(%+v)", *p)

}

func (p *RequestBodiesOrReferences) DeepEqual(ano *RequestBodiesOrReferences) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.AdditionalProperties) {
		return false
	}
	return true
}

func (p *RequestBodiesOrReferences) Field1DeepEqual(src []*NamedRequestBodyOrReference) bool {

	if len(p.AdditionalProperties) != len(src) {
		return false
	}
	for i, v := range p.AdditionalProperties {
		_src := src[i]
		if !v.DeepEqual(_src) {
			return false
		}
	}
	return true
}

type Response struct {
	Description            string               `thrift:"description,1" frugal:"1,default,string" json:"description"`
	Headers                *HeadersOrReferences `thrift:"headers,2" frugal:"2,default,HeadersOrReferences" json:"headers"`
	Content                *MediaTypes          `thrift:"content,3" frugal:"3,default,MediaTypes" json:"content"`
	Links                  *LinksOrReferences   `thrift:"links,4" frugal:"4,default,LinksOrReferences" json:"links"`
	SpecificationExtension []*NamedAny          `thrift:"specification_extension,5" frugal:"5,default,list<NamedAny>" json:"specification_extension"`
}

func NewResponse() *Response {
	return &Response{}
}

func (p *Response) InitDefault() {
}

func (p *Response) GetDescription() (v string) {
	return p.Description
}

var Response_Headers_DEFAULT *HeadersOrReferences

func (p *Response) GetHeaders() (v *HeadersOrReferences) {
	if !p.IsSetHeaders() {
		return Response_Headers_DEFAULT
	}
	return p.Headers
}

var Response_Content_DEFAULT *MediaTypes

func (p *Response) GetContent() (v *MediaTypes) {
	if !p.IsSetContent() {
		return Response_Content_DEFAULT
	}
	return p.Content
}

var Response_Links_DEFAULT *LinksOrReferences

func (p *Response) GetLinks() (v *LinksOrReferences) {
	if !p.IsSetLinks() {
		return Response_Links_DEFAULT
	}
	return p.Links
}

func (p *Response) GetSpecificationExtension() (v []*NamedAny) {
	return p.SpecificationExtension
}
func (p *Response) SetDescription(val string) {
	p.Description = val
}
func (p *Response) SetHeaders(val *HeadersOrReferences) {
	p.Headers = val
}
func (p *Response) SetContent(val *MediaTypes) {
	p.Content = val
}
func (p *Response) SetLinks(val *LinksOrReferences) {
	p.Links = val
}
func (p *Response) SetSpecificationExtension(val []*NamedAny) {
	p.SpecificationExtension = val
}

var fieldIDToName_Response = map[int16]string{
	1: "description",
	2: "headers",
	3: "content",
	4: "links",
	5: "specification_extension",
}

func (p *Response) IsSetHeaders() bool {
	return p.Headers != nil
}

func (p *Response) IsSetContent() bool {
	return p.Content != nil
}

func (p *Response) IsSetLinks() bool {
	return p.Links != nil
}

func (p *Response) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 2:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField2(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 3:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField3(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 4:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField4(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 5:
			if fieldTypeId == thrift.LIST {
				if err = p.ReadField5(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}
		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_Response[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *Response) ReadField1(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Description = _field
	return nil
}
func (p *Response) ReadField2(iprot thrift.TProtocol) error {
	_field := NewHeadersOrReferences()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Headers = _field
	return nil
}
func (p *Response) ReadField3(iprot thrift.TProtocol) error {
	_field := NewMediaTypes()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Content = _field
	return nil
}
func (p *Response) ReadField4(iprot thrift.TProtocol) error {
	_field := NewLinksOrReferences()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Links = _field
	return nil
}
func (p *Response) ReadField5(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	_field := make([]*NamedAny, 0, size)
	values := make([]NamedAny, size)
	for i := 0; i < size; i++ {
		_elem := &values[i]
		_elem.InitDefault()

		if err := _elem.Read(iprot); err != nil {
			return err
		}

		_field = append(_field, _elem)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return err
	}
	p.SpecificationExtension = _field
	return nil
}

func (p *Response) Write(oprot thrift.TProtocol) (err error) {

	var fieldId int16
	if err = oprot.WriteStructBegin("Response"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
		if err = p.writeField2(oprot); err != nil {
			fieldId = 2
			goto WriteFieldError
		}
		if err = p.writeField3(oprot); err != nil {
			fieldId = 3
			goto WriteFieldError
		}
		if err = p.writeField4(oprot); err != nil {
			fieldId = 4
			goto WriteFieldError
		}
		if err = p.writeField5(oprot); err != nil {
			fieldId = 5
			goto WriteFieldError
		}
	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *Response) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("description", thrift.STRING, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.Description); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *Response) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("headers", thrift.STRUCT, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Headers.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err)
}

func (p *Response) writeField3(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("content", thrift.STRUCT, 3); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Content.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err)
}

func (p *Response) writeField4(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("links", thrift.STRUCT, 4); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Links.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err)
}

func (p *Response) writeField5(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("specification_extension", thrift.LIST, 5); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.SpecificationExtension)); err != nil {
		return err
	}
	for _, v := range p.SpecificationExtension {
		if err := v.Write(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err)
}

func (p *Response) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("Response(%+v)", *p)

}

func (p *Response) DeepEqual(ano *Response) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.Description) {
		return false
	}
	if !p.Field2DeepEqual(ano.Headers) {
		return false
	}
	if !p.Field3DeepEqual(ano.Content) {
		return false
	}
	if !p.Field4DeepEqual(ano.Links) {
		return false
	}
	if !p.Field5DeepEqual(ano.SpecificationExtension) {
		return false
	}
	return true
}

func (p *Response) Field1DeepEqual(src string) bool {

	if strings.Compare(p.Description, src) != 0 {
		return false
	}
	return true
}
func (p *Response) Field2DeepEqual(src *HeadersOrReferences) bool {

	if !p.Headers.DeepEqual(src) {
		return false
	}
	return true
}
func (p *Response) Field3DeepEqual(src *MediaTypes) bool {

	if !p.Content.DeepEqual(src) {
		return false
	}
	return true
}
func (p *Response) Field4DeepEqual(src *LinksOrReferences) bool {

	if !p.Links.DeepEqual(src) {
		return false
	}
	return true
}
func (p *Response) Field5DeepEqual(src []*NamedAny) bool {

	if len(p.SpecificationExtension) != len(src) {
		return false
	}
	for i, v := range p.SpecificationExtension {
		_src := src[i]
		if !v.DeepEqual(_src) {
			return false
		}
	}
	return true
}

type ResponseOrReference struct {
	Response  *Response  `thrift:"response,1" frugal:"1,default,Response" json:"response"`
	Reference *Reference `thrift:"reference,2" frugal:"2,default,Reference" json:"reference"`
}

func NewResponseOrReference() *ResponseOrReference {
	return &ResponseOrReference{}
}

func (p *ResponseOrReference) InitDefault() {
}

var ResponseOrReference_Response_DEFAULT *Response

func (p *ResponseOrReference) GetResponse() (v *Response) {
	if !p.IsSetResponse() {
		return ResponseOrReference_Response_DEFAULT
	}
	return p.Response
}

var ResponseOrReference_Reference_DEFAULT *Reference

func (p *ResponseOrReference) GetReference() (v *Reference) {
	if !p.IsSetReference() {
		return ResponseOrReference_Reference_DEFAULT
	}
	return p.Reference
}
func (p *ResponseOrReference) SetResponse(val *Response) {
	p.Response = val
}
func (p *ResponseOrReference) SetReference(val *Reference) {
	p.Reference = val
}

var fieldIDToName_ResponseOrReference = map[int16]string{
	1: "response",
	2: "reference",
}

func (p *ResponseOrReference) IsSetResponse() bool {
	return p.Response != nil
}

func (p *ResponseOrReference) IsSetReference() bool {
	return p.Reference != nil
}

func (p *ResponseOrReference) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 2:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField2(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}
		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_ResponseOrReference[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *ResponseOrReference) ReadField1(iprot thrift.TProtocol) error {
	_field := NewResponse()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Response = _field
	return nil
}
func (p *ResponseOrReference) ReadField2(iprot thrift.TProtocol) error {
	_field := NewReference()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Reference = _field
	return nil
}

func (p *ResponseOrReference) Write(oprot thrift.TProtocol) (err error) {

	var fieldId int16
	if err = oprot.WriteStructBegin("ResponseOrReference"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
		if err = p.writeField2(oprot); err != nil {
			fieldId = 2
			goto WriteFieldError
		}
	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *ResponseOrReference) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("response", thrift.STRUCT, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Response.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *ResponseOrReference) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("reference", thrift.STRUCT, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Reference.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err)
}

func (p *ResponseOrReference) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("ResponseOrReference(%+v)", *p)

}

func (p *ResponseOrReference) DeepEqual(ano *ResponseOrReference) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.Response) {
		return false
	}
	if !p.Field2DeepEqual(ano.Reference) {
		return false
	}
	return true
}

func (p *ResponseOrReference) Field1DeepEqual(src *Response) bool {

	if !p.Response.DeepEqual(src) {
		return false
	}
	return true
}
func (p *ResponseOrReference) Field2DeepEqual(src *Reference) bool {

	if !p.Reference.DeepEqual(src) {
		return false
	}
	return true
}

type Responses struct {
	Default                *ResponseOrReference        `thrift:"default,1" frugal:"1,default,ResponseOrReference" json:"default"`
	ResponseOrReference    []*NamedResponseOrReference `thrift:"response_or_reference,2" frugal:"2,default,list<NamedResponseOrReference>" json:"response_or_reference"`
	SpecificationExtension []*NamedAny                 `thrift:"specification_extension,3" frugal:"3,default,list<NamedAny>" json:"specification_extension"`
}

func NewResponses() *Responses {
	return &Responses{}
}

func (p *Responses) InitDefault() {
}

var Responses_Default_DEFAULT *ResponseOrReference

func (p *Responses) GetDefault() (v *ResponseOrReference) {
	if !p.IsSetDefault() {
		return Responses_Default_DEFAULT
	}
	return p.Default
}

func (p *Responses) GetResponseOrReference() (v []*NamedResponseOrReference) {
	return p.ResponseOrReference
}

func (p *Responses) GetSpecificationExtension() (v []*NamedAny) {
	return p.SpecificationExtension
}
func (p *Responses) SetDefault(val *ResponseOrReference) {
	p.Default = val
}
func (p *Responses) SetResponseOrReference(val []*NamedResponseOrReference) {
	p.ResponseOrReference = val
}
func (p *Responses) SetSpecificationExtension(val []*NamedAny) {
	p.SpecificationExtension = val
}

var fieldIDToName_Responses = map[int16]string{
	1: "default",
	2: "response_or_reference",
	3: "specification_extension",
}

func (p *Responses) IsSetDefault() bool {
	return p.Default != nil
}

func (p *Responses) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 2:
			if fieldTypeId == thrift.LIST {
				if err = p.ReadField2(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 3:
			if fieldTypeId == thrift.LIST {
				if err = p.ReadField3(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}
		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_Responses[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *Responses) ReadField1(iprot thrift.TProtocol) error {
	_field := NewResponseOrReference()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Default = _field
	return nil
}
func (p *Responses) ReadField2(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	_field := make([]*NamedResponseOrReference, 0, size)
	values := make([]NamedResponseOrReference, size)
	for i := 0; i < size; i++ {
		_elem := &values[i]
		_elem.InitDefault()

		if err := _elem.Read(iprot); err != nil {
			return err
		}

		_field = append(_field, _elem)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return err
	}
	p.ResponseOrReference = _field
	return nil
}
func (p *Responses) ReadField3(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	_field := make([]*NamedAny, 0, size)
	values := make([]NamedAny, size)
	for i := 0; i < size; i++ {
		_elem := &values[i]
		_elem.InitDefault()

		if err := _elem.Read(iprot); err != nil {
			return err
		}

		_field = append(_field, _elem)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return err
	}
	p.SpecificationExtension = _field
	return nil
}

func (p *Responses) Write(oprot thrift.TProtocol) (err error) {

	var fieldId int16
	if err = oprot.WriteStructBegin("Responses"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
		if err = p.writeField2(oprot); err != nil {
			fieldId = 2
			goto WriteFieldError
		}
		if err = p.writeField3(oprot); err != nil {
			fieldId = 3
			goto WriteFieldError
		}
	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *Responses) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("default", thrift.STRUCT, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Default.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *Responses) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("response_or_reference", thrift.LIST, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.ResponseOrReference)); err != nil {
		return err
	}
	for _, v := range p.ResponseOrReference {
		if err := v.Write(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err)
}

func (p *Responses) writeField3(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("specification_extension", thrift.LIST, 3); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.SpecificationExtension)); err != nil {
		return err
	}
	for _, v := range p.SpecificationExtension {
		if err := v.Write(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err)
}

func (p *Responses) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("Responses(%+v)", *p)

}

func (p *Responses) DeepEqual(ano *Responses) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.Default) {
		return false
	}
	if !p.Field2DeepEqual(ano.ResponseOrReference) {
		return false
	}
	if !p.Field3DeepEqual(ano.SpecificationExtension) {
		return false
	}
	return true
}

func (p *Responses) Field1DeepEqual(src *ResponseOrReference) bool {

	if !p.Default.DeepEqual(src) {
		return false
	}
	return true
}
func (p *Responses) Field2DeepEqual(src []*NamedResponseOrReference) bool {

	if len(p.ResponseOrReference) != len(src) {
		return false
	}
	for i, v := range p.ResponseOrReference {
		_src := src[i]
		if !v.DeepEqual(_src) {
			return false
		}
	}
	return true
}
func (p *Responses) Field3DeepEqual(src []*NamedAny) bool {

	if len(p.SpecificationExtension) != len(src) {
		return false
	}
	for i, v := range p.SpecificationExtension {
		_src := src[i]
		if !v.DeepEqual(_src) {
			return false
		}
	}
	return true
}

type ResponsesOrReferences struct {
	AdditionalProperties []*NamedResponseOrReference `thrift:"additional_properties,1" frugal:"1,default,list<NamedResponseOrReference>" json:"additional_properties"`
}

func NewResponsesOrReferences() *ResponsesOrReferences {
	return &ResponsesOrReferences{}
}

func (p *ResponsesOrReferences) InitDefault() {
}

func (p *ResponsesOrReferences) GetAdditionalProperties() (v []*NamedResponseOrReference) {
	return p.AdditionalProperties
}
func (p *ResponsesOrReferences) SetAdditionalProperties(val []*NamedResponseOrReference) {
	p.AdditionalProperties = val
}

var fieldIDToName_ResponsesOrReferences = map[int16]string{
	1: "additional_properties",
}

func (p *ResponsesOrReferences) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.LIST {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}
		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_ResponsesOrReferences[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *ResponsesOrReferences) ReadField1(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	_field := make([]*NamedResponseOrReference, 0, size)
	values := make([]NamedResponseOrReference, size)
	for i := 0; i < size; i++ {
		_elem := &values[i]
		_elem.InitDefault()

		if err := _elem.Read(iprot); err != nil {
			return err
		}

		_field = append(_field, _elem)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return err
	}
	p.AdditionalProperties = _field
	return nil
}

func (p *ResponsesOrReferences) Write(oprot thrift.TProtocol) (err error) {

	var fieldId int16
	if err = oprot.WriteStructBegin("ResponsesOrReferences"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *ResponsesOrReferences) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("additional_properties", thrift.LIST, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.AdditionalProperties)); err != nil {
		return err
	}
	for _, v := range p.AdditionalProperties {
		if err := v.Write(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *ResponsesOrReferences) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("ResponsesOrReferences(%+v)", *p)

}

func (p *ResponsesOrReferences) DeepEqual(ano *ResponsesOrReferences) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.AdditionalProperties) {
		return false
	}
	return true
}

func (p *ResponsesOrReferences) Field1DeepEqual(src []*NamedResponseOrReference) bool {

	if len(p.AdditionalProperties) != len(src) {
		return false
	}
	for i, v := range p.AdditionalProperties {
		_src := src[i]
		if !v.DeepEqual(_src) {
			return false
		}
	}
	return true
}

type Schema struct {
	Nullable               bool                      `thrift:"nullable,1" frugal:"1,default,bool" json:"nullable"`
	Discriminator          *Discriminator            `thrift:"discriminator,2" frugal:"2,default,Discriminator" json:"discriminator"`
	ReadOnly               bool                      `thrift:"read_only,3" frugal:"3,default,bool" json:"read_only"`
	WriteOnly              bool                      `thrift:"write_only,4" frugal:"4,default,bool" json:"write_only"`
	Xml                    *Xml                      `thrift:"xml,5" frugal:"5,default,Xml" json:"xml"`
	ExternalDocs           *ExternalDocs             `thrift:"external_docs,6" frugal:"6,default,ExternalDocs" json:"external_docs"`
	Example                *Any                      `thrift:"example,7" frugal:"7,default,Any" json:"example"`
	Deprecated             bool                      `thrift:"deprecated,8" frugal:"8,default,bool" json:"deprecated"`
	Title                  string                    `thrift:"title,9" frugal:"9,default,string" json:"title"`
	MultipleOf             float64                   `thrift:"multiple_of,10" frugal:"10,default,double" json:"multiple_of"`
	Maximum                float64                   `thrift:"maximum,11" frugal:"11,default,double" json:"maximum"`
	ExclusiveMaximum       bool                      `thrift:"exclusive_maximum,12" frugal:"12,default,bool" json:"exclusive_maximum"`
	Minimum                float64                   `thrift:"minimum,13" frugal:"13,default,double" json:"minimum"`
	ExclusiveMinimum       bool                      `thrift:"exclusive_minimum,14" frugal:"14,default,bool" json:"exclusive_minimum"`
	MaxLength              int64                     `thrift:"max_length,15" frugal:"15,default,i64" json:"max_length"`
	MinLength              int64                     `thrift:"min_length,16" frugal:"16,default,i64" json:"min_length"`
	Pattern                string                    `thrift:"pattern,17" frugal:"17,default,string" json:"pattern"`
	MaxItems               int64                     `thrift:"max_items,18" frugal:"18,default,i64" json:"max_items"`
	MinItems               int64                     `thrift:"min_items,19" frugal:"19,default,i64" json:"min_items"`
	UniqueItems            bool                      `thrift:"unique_items,20" frugal:"20,default,bool" json:"unique_items"`
	MaxProperties          int64                     `thrift:"max_properties,21" frugal:"21,default,i64" json:"max_properties"`
	MinProperties          int64                     `thrift:"min_properties,22" frugal:"22,default,i64" json:"min_properties"`
	Required               []string                  `thrift:"required,23" frugal:"23,default,list<string>" json:"required"`
	Enum                   []*Any                    `thrift:"enum,24" frugal:"24,default,list<Any>" json:"enum"`
	Type                   string                    `thrift:"type,25" frugal:"25,default,string" json:"type"`
	AllOf                  []*SchemaOrReference      `thrift:"all_of,26" frugal:"26,default,list<SchemaOrReference>" json:"all_of"`
	OneOf                  []*SchemaOrReference      `thrift:"one_of,27" frugal:"27,default,list<SchemaOrReference>" json:"one_of"`
	AnyOf                  []*SchemaOrReference      `thrift:"any_of,28" frugal:"28,default,list<SchemaOrReference>" json:"any_of"`
	Not                    *Schema                   `thrift:"not,29" frugal:"29,default,Schema" json:"not"`
	Items                  *ItemsItem                `thrift:"items,30" frugal:"30,default,ItemsItem" json:"items"`
	Properties             *Properties               `thrift:"properties,31" frugal:"31,default,Properties" json:"properties"`
	AdditionalProperties   *AdditionalPropertiesItem `thrift:"additional_properties,32" frugal:"32,default,AdditionalPropertiesItem" json:"additional_properties"`
	Default                *DefaultType              `thrift:"default,33" frugal:"33,default,DefaultType" json:"default"`
	Description            string                    `thrift:"description,34" frugal:"34,default,string" json:"description"`
	Format                 string                    `thrift:"format,35" frugal:"35,default,string" json:"format"`
	SpecificationExtension []*NamedAny               `thrift:"specification_extension,36" frugal:"36,default,list<NamedAny>" json:"specification_extension"`
}

func NewSchema() *Schema {
	return &Schema{}
}

func (p *Schema) InitDefault() {
}

func (p *Schema) GetNullable() (v bool) {
	return p.Nullable
}

var Schema_Discriminator_DEFAULT *Discriminator

func (p *Schema) GetDiscriminator() (v *Discriminator) {
	if !p.IsSetDiscriminator() {
		return Schema_Discriminator_DEFAULT
	}
	return p.Discriminator
}

func (p *Schema) GetReadOnly() (v bool) {
	return p.ReadOnly
}

func (p *Schema) GetWriteOnly() (v bool) {
	return p.WriteOnly
}

var Schema_Xml_DEFAULT *Xml

func (p *Schema) GetXml() (v *Xml) {
	if !p.IsSetXml() {
		return Schema_Xml_DEFAULT
	}
	return p.Xml
}

var Schema_ExternalDocs_DEFAULT *ExternalDocs

func (p *Schema) GetExternalDocs() (v *ExternalDocs) {
	if !p.IsSetExternalDocs() {
		return Schema_ExternalDocs_DEFAULT
	}
	return p.ExternalDocs
}

var Schema_Example_DEFAULT *Any

func (p *Schema) GetExample() (v *Any) {
	if !p.IsSetExample() {
		return Schema_Example_DEFAULT
	}
	return p.Example
}

func (p *Schema) GetDeprecated() (v bool) {
	return p.Deprecated
}

func (p *Schema) GetTitle() (v string) {
	return p.Title
}

func (p *Schema) GetMultipleOf() (v float64) {
	return p.MultipleOf
}

func (p *Schema) GetMaximum() (v float64) {
	return p.Maximum
}

func (p *Schema) GetExclusiveMaximum() (v bool) {
	return p.ExclusiveMaximum
}

func (p *Schema) GetMinimum() (v float64) {
	return p.Minimum
}

func (p *Schema) GetExclusiveMinimum() (v bool) {
	return p.ExclusiveMinimum
}

func (p *Schema) GetMaxLength() (v int64) {
	return p.MaxLength
}

func (p *Schema) GetMinLength() (v int64) {
	return p.MinLength
}

func (p *Schema) GetPattern() (v string) {
	return p.Pattern
}

func (p *Schema) GetMaxItems() (v int64) {
	return p.MaxItems
}

func (p *Schema) GetMinItems() (v int64) {
	return p.MinItems
}

func (p *Schema) GetUniqueItems() (v bool) {
	return p.UniqueItems
}

func (p *Schema) GetMaxProperties() (v int64) {
	return p.MaxProperties
}

func (p *Schema) GetMinProperties() (v int64) {
	return p.MinProperties
}

func (p *Schema) GetRequired() (v []string) {
	return p.Required
}

func (p *Schema) GetEnum() (v []*Any) {
	return p.Enum
}

func (p *Schema) GetType() (v string) {
	return p.Type
}

func (p *Schema) GetAllOf() (v []*SchemaOrReference) {
	return p.AllOf
}

func (p *Schema) GetOneOf() (v []*SchemaOrReference) {
	return p.OneOf
}

func (p *Schema) GetAnyOf() (v []*SchemaOrReference) {
	return p.AnyOf
}

var Schema_Not_DEFAULT *Schema

func (p *Schema) GetNot() (v *Schema) {
	if !p.IsSetNot() {
		return Schema_Not_DEFAULT
	}
	return p.Not
}

var Schema_Items_DEFAULT *ItemsItem

func (p *Schema) GetItems() (v *ItemsItem) {
	if !p.IsSetItems() {
		return Schema_Items_DEFAULT
	}
	return p.Items
}

var Schema_Properties_DEFAULT *Properties

func (p *Schema) GetProperties() (v *Properties) {
	if !p.IsSetProperties() {
		return Schema_Properties_DEFAULT
	}
	return p.Properties
}

var Schema_AdditionalProperties_DEFAULT *AdditionalPropertiesItem

func (p *Schema) GetAdditionalProperties() (v *AdditionalPropertiesItem) {
	if !p.IsSetAdditionalProperties() {
		return Schema_AdditionalProperties_DEFAULT
	}
	return p.AdditionalProperties
}

var Schema_Default_DEFAULT *DefaultType

func (p *Schema) GetDefault() (v *DefaultType) {
	if !p.IsSetDefault() {
		return Schema_Default_DEFAULT
	}
	return p.Default
}

func (p *Schema) GetDescription() (v string) {
	return p.Description
}

func (p *Schema) GetFormat() (v string) {
	return p.Format
}

func (p *Schema) GetSpecificationExtension() (v []*NamedAny) {
	return p.SpecificationExtension
}
func (p *Schema) SetNullable(val bool) {
	p.Nullable = val
}
func (p *Schema) SetDiscriminator(val *Discriminator) {
	p.Discriminator = val
}
func (p *Schema) SetReadOnly(val bool) {
	p.ReadOnly = val
}
func (p *Schema) SetWriteOnly(val bool) {
	p.WriteOnly = val
}
func (p *Schema) SetXml(val *Xml) {
	p.Xml = val
}
func (p *Schema) SetExternalDocs(val *ExternalDocs) {
	p.ExternalDocs = val
}
func (p *Schema) SetExample(val *Any) {
	p.Example = val
}
func (p *Schema) SetDeprecated(val bool) {
	p.Deprecated = val
}
func (p *Schema) SetTitle(val string) {
	p.Title = val
}
func (p *Schema) SetMultipleOf(val float64) {
	p.MultipleOf = val
}
func (p *Schema) SetMaximum(val float64) {
	p.Maximum = val
}
func (p *Schema) SetExclusiveMaximum(val bool) {
	p.ExclusiveMaximum = val
}
func (p *Schema) SetMinimum(val float64) {
	p.Minimum = val
}
func (p *Schema) SetExclusiveMinimum(val bool) {
	p.ExclusiveMinimum = val
}
func (p *Schema) SetMaxLength(val int64) {
	p.MaxLength = val
}
func (p *Schema) SetMinLength(val int64) {
	p.MinLength = val
}
func (p *Schema) SetPattern(val string) {
	p.Pattern = val
}
func (p *Schema) SetMaxItems(val int64) {
	p.MaxItems = val
}
func (p *Schema) SetMinItems(val int64) {
	p.MinItems = val
}
func (p *Schema) SetUniqueItems(val bool) {
	p.UniqueItems = val
}
func (p *Schema) SetMaxProperties(val int64) {
	p.MaxProperties = val
}
func (p *Schema) SetMinProperties(val int64) {
	p.MinProperties = val
}
func (p *Schema) SetRequired(val []string) {
	p.Required = val
}
func (p *Schema) SetEnum(val []*Any) {
	p.Enum = val
}
func (p *Schema) SetType(val string) {
	p.Type = val
}
func (p *Schema) SetAllOf(val []*SchemaOrReference) {
	p.AllOf = val
}
func (p *Schema) SetOneOf(val []*SchemaOrReference) {
	p.OneOf = val
}
func (p *Schema) SetAnyOf(val []*SchemaOrReference) {
	p.AnyOf = val
}
func (p *Schema) SetNot(val *Schema) {
	p.Not = val
}
func (p *Schema) SetItems(val *ItemsItem) {
	p.Items = val
}
func (p *Schema) SetProperties(val *Properties) {
	p.Properties = val
}
func (p *Schema) SetAdditionalProperties(val *AdditionalPropertiesItem) {
	p.AdditionalProperties = val
}
func (p *Schema) SetDefault(val *DefaultType) {
	p.Default = val
}
func (p *Schema) SetDescription(val string) {
	p.Description = val
}
func (p *Schema) SetFormat(val string) {
	p.Format = val
}
func (p *Schema) SetSpecificationExtension(val []*NamedAny) {
	p.SpecificationExtension = val
}

var fieldIDToName_Schema = map[int16]string{
	1:  "nullable",
	2:  "discriminator",
	3:  "read_only",
	4:  "write_only",
	5:  "xml",
	6:  "external_docs",
	7:  "example",
	8:  "deprecated",
	9:  "title",
	10: "multiple_of",
	11: "maximum",
	12: "exclusive_maximum",
	13: "minimum",
	14: "exclusive_minimum",
	15: "max_length",
	16: "min_length",
	17: "pattern",
	18: "max_items",
	19: "min_items",
	20: "unique_items",
	21: "max_properties",
	22: "min_properties",
	23: "required",
	24: "enum",
	25: "type",
	26: "all_of",
	27: "one_of",
	28: "any_of",
	29: "not",
	30: "items",
	31: "properties",
	32: "additional_properties",
	33: "default",
	34: "description",
	35: "format",
	36: "specification_extension",
}

func (p *Schema) IsSetDiscriminator() bool {
	return p.Discriminator != nil
}

func (p *Schema) IsSetXml() bool {
	return p.Xml != nil
}

func (p *Schema) IsSetExternalDocs() bool {
	return p.ExternalDocs != nil
}

func (p *Schema) IsSetExample() bool {
	return p.Example != nil
}

func (p *Schema) IsSetNot() bool {
	return p.Not != nil
}

func (p *Schema) IsSetItems() bool {
	return p.Items != nil
}

func (p *Schema) IsSetProperties() bool {
	return p.Properties != nil
}

func (p *Schema) IsSetAdditionalProperties() bool {
	return p.AdditionalProperties != nil
}

func (p *Schema) IsSetDefault() bool {
	return p.Default != nil
}

func (p *Schema) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.BOOL {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 2:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField2(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 3:
			if fieldTypeId == thrift.BOOL {
				if err = p.ReadField3(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 4:
			if fieldTypeId == thrift.BOOL {
				if err = p.ReadField4(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 5:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField5(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 6:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField6(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 7:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField7(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 8:
			if fieldTypeId == thrift.BOOL {
				if err = p.ReadField8(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 9:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField9(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 10:
			if fieldTypeId == thrift.DOUBLE {
				if err = p.ReadField10(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 11:
			if fieldTypeId == thrift.DOUBLE {
				if err = p.ReadField11(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 12:
			if fieldTypeId == thrift.BOOL {
				if err = p.ReadField12(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 13:
			if fieldTypeId == thrift.DOUBLE {
				if err = p.ReadField13(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 14:
			if fieldTypeId == thrift.BOOL {
				if err = p.ReadField14(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 15:
			if fieldTypeId == thrift.I64 {
				if err = p.ReadField15(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 16:
			if fieldTypeId == thrift.I64 {
				if err = p.ReadField16(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 17:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField17(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 18:
			if fieldTypeId == thrift.I64 {
				if err = p.ReadField18(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 19:
			if fieldTypeId == thrift.I64 {
				if err = p.ReadField19(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 20:
			if fieldTypeId == thrift.BOOL {
				if err = p.ReadField20(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 21:
			if fieldTypeId == thrift.I64 {
				if err = p.ReadField21(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 22:
			if fieldTypeId == thrift.I64 {
				if err = p.ReadField22(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 23:
			if fieldTypeId == thrift.LIST {
				if err = p.ReadField23(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 24:
			if fieldTypeId == thrift.LIST {
				if err = p.ReadField24(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 25:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField25(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 26:
			if fieldTypeId == thrift.LIST {
				if err = p.ReadField26(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 27:
			if fieldTypeId == thrift.LIST {
				if err = p.ReadField27(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 28:
			if fieldTypeId == thrift.LIST {
				if err = p.ReadField28(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 29:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField29(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 30:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField30(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 31:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField31(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 32:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField32(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 33:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField33(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 34:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField34(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 35:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField35(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 36:
			if fieldTypeId == thrift.LIST {
				if err = p.ReadField36(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}
		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_Schema[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *Schema) ReadField1(iprot thrift.TProtocol) error {

	var _field bool
	if v, err := iprot.ReadBool(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Nullable = _field
	return nil
}
func (p *Schema) ReadField2(iprot thrift.TProtocol) error {
	_field := NewDiscriminator()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Discriminator = _field
	return nil
}
func (p *Schema) ReadField3(iprot thrift.TProtocol) error {

	var _field bool
	if v, err := iprot.ReadBool(); err != nil {
		return err
	} else {
		_field = v
	}
	p.ReadOnly = _field
	return nil
}
func (p *Schema) ReadField4(iprot thrift.TProtocol) error {

	var _field bool
	if v, err := iprot.ReadBool(); err != nil {
		return err
	} else {
		_field = v
	}
	p.WriteOnly = _field
	return nil
}
func (p *Schema) ReadField5(iprot thrift.TProtocol) error {
	_field := NewXml()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Xml = _field
	return nil
}
func (p *Schema) ReadField6(iprot thrift.TProtocol) error {
	_field := NewExternalDocs()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.ExternalDocs = _field
	return nil
}
func (p *Schema) ReadField7(iprot thrift.TProtocol) error {
	_field := NewAny()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Example = _field
	return nil
}
func (p *Schema) ReadField8(iprot thrift.TProtocol) error {

	var _field bool
	if v, err := iprot.ReadBool(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Deprecated = _field
	return nil
}
func (p *Schema) ReadField9(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Title = _field
	return nil
}
func (p *Schema) ReadField10(iprot thrift.TProtocol) error {

	var _field float64
	if v, err := iprot.ReadDouble(); err != nil {
		return err
	} else {
		_field = v
	}
	p.MultipleOf = _field
	return nil
}
func (p *Schema) ReadField11(iprot thrift.TProtocol) error {

	var _field float64
	if v, err := iprot.ReadDouble(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Maximum = _field
	return nil
}
func (p *Schema) ReadField12(iprot thrift.TProtocol) error {

	var _field bool
	if v, err := iprot.ReadBool(); err != nil {
		return err
	} else {
		_field = v
	}
	p.ExclusiveMaximum = _field
	return nil
}
func (p *Schema) ReadField13(iprot thrift.TProtocol) error {

	var _field float64
	if v, err := iprot.ReadDouble(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Minimum = _field
	return nil
}
func (p *Schema) ReadField14(iprot thrift.TProtocol) error {

	var _field bool
	if v, err := iprot.ReadBool(); err != nil {
		return err
	} else {
		_field = v
	}
	p.ExclusiveMinimum = _field
	return nil
}
func (p *Schema) ReadField15(iprot thrift.TProtocol) error {

	var _field int64
	if v, err := iprot.ReadI64(); err != nil {
		return err
	} else {
		_field = v
	}
	p.MaxLength = _field
	return nil
}
func (p *Schema) ReadField16(iprot thrift.TProtocol) error {

	var _field int64
	if v, err := iprot.ReadI64(); err != nil {
		return err
	} else {
		_field = v
	}
	p.MinLength = _field
	return nil
}
func (p *Schema) ReadField17(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Pattern = _field
	return nil
}
func (p *Schema) ReadField18(iprot thrift.TProtocol) error {

	var _field int64
	if v, err := iprot.ReadI64(); err != nil {
		return err
	} else {
		_field = v
	}
	p.MaxItems = _field
	return nil
}
func (p *Schema) ReadField19(iprot thrift.TProtocol) error {

	var _field int64
	if v, err := iprot.ReadI64(); err != nil {
		return err
	} else {
		_field = v
	}
	p.MinItems = _field
	return nil
}
func (p *Schema) ReadField20(iprot thrift.TProtocol) error {

	var _field bool
	if v, err := iprot.ReadBool(); err != nil {
		return err
	} else {
		_field = v
	}
	p.UniqueItems = _field
	return nil
}
func (p *Schema) ReadField21(iprot thrift.TProtocol) error {

	var _field int64
	if v, err := iprot.ReadI64(); err != nil {
		return err
	} else {
		_field = v
	}
	p.MaxProperties = _field
	return nil
}
func (p *Schema) ReadField22(iprot thrift.TProtocol) error {

	var _field int64
	if v, err := iprot.ReadI64(); err != nil {
		return err
	} else {
		_field = v
	}
	p.MinProperties = _field
	return nil
}
func (p *Schema) ReadField23(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	_field := make([]string, 0, size)
	for i := 0; i < size; i++ {

		var _elem string
		if v, err := iprot.ReadString(); err != nil {
			return err
		} else {
			_elem = v
		}

		_field = append(_field, _elem)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return err
	}
	p.Required = _field
	return nil
}
func (p *Schema) ReadField24(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	_field := make([]*Any, 0, size)
	values := make([]Any, size)
	for i := 0; i < size; i++ {
		_elem := &values[i]
		_elem.InitDefault()

		if err := _elem.Read(iprot); err != nil {
			return err
		}

		_field = append(_field, _elem)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return err
	}
	p.Enum = _field
	return nil
}
func (p *Schema) ReadField25(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Type = _field
	return nil
}
func (p *Schema) ReadField26(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	_field := make([]*SchemaOrReference, 0, size)
	values := make([]SchemaOrReference, size)
	for i := 0; i < size; i++ {
		_elem := &values[i]
		_elem.InitDefault()

		if err := _elem.Read(iprot); err != nil {
			return err
		}

		_field = append(_field, _elem)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return err
	}
	p.AllOf = _field
	return nil
}
func (p *Schema) ReadField27(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	_field := make([]*SchemaOrReference, 0, size)
	values := make([]SchemaOrReference, size)
	for i := 0; i < size; i++ {
		_elem := &values[i]
		_elem.InitDefault()

		if err := _elem.Read(iprot); err != nil {
			return err
		}

		_field = append(_field, _elem)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return err
	}
	p.OneOf = _field
	return nil
}
func (p *Schema) ReadField28(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	_field := make([]*SchemaOrReference, 0, size)
	values := make([]SchemaOrReference, size)
	for i := 0; i < size; i++ {
		_elem := &values[i]
		_elem.InitDefault()

		if err := _elem.Read(iprot); err != nil {
			return err
		}

		_field = append(_field, _elem)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return err
	}
	p.AnyOf = _field
	return nil
}
func (p *Schema) ReadField29(iprot thrift.TProtocol) error {
	_field := NewSchema()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Not = _field
	return nil
}
func (p *Schema) ReadField30(iprot thrift.TProtocol) error {
	_field := NewItemsItem()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Items = _field
	return nil
}
func (p *Schema) ReadField31(iprot thrift.TProtocol) error {
	_field := NewProperties()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Properties = _field
	return nil
}
func (p *Schema) ReadField32(iprot thrift.TProtocol) error {
	_field := NewAdditionalPropertiesItem()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.AdditionalProperties = _field
	return nil
}
func (p *Schema) ReadField33(iprot thrift.TProtocol) error {
	_field := NewDefaultType()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Default = _field
	return nil
}
func (p *Schema) ReadField34(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Description = _field
	return nil
}
func (p *Schema) ReadField35(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Format = _field
	return nil
}
func (p *Schema) ReadField36(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	_field := make([]*NamedAny, 0, size)
	values := make([]NamedAny, size)
	for i := 0; i < size; i++ {
		_elem := &values[i]
		_elem.InitDefault()

		if err := _elem.Read(iprot); err != nil {
			return err
		}

		_field = append(_field, _elem)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return err
	}
	p.SpecificationExtension = _field
	return nil
}

func (p *Schema) Write(oprot thrift.TProtocol) (err error) {

	var fieldId int16
	if err = oprot.WriteStructBegin("Schema"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
		if err = p.writeField2(oprot); err != nil {
			fieldId = 2
			goto WriteFieldError
		}
		if err = p.writeField3(oprot); err != nil {
			fieldId = 3
			goto WriteFieldError
		}
		if err = p.writeField4(oprot); err != nil {
			fieldId = 4
			goto WriteFieldError
		}
		if err = p.writeField5(oprot); err != nil {
			fieldId = 5
			goto WriteFieldError
		}
		if err = p.writeField6(oprot); err != nil {
			fieldId = 6
			goto WriteFieldError
		}
		if err = p.writeField7(oprot); err != nil {
			fieldId = 7
			goto WriteFieldError
		}
		if err = p.writeField8(oprot); err != nil {
			fieldId = 8
			goto WriteFieldError
		}
		if err = p.writeField9(oprot); err != nil {
			fieldId = 9
			goto WriteFieldError
		}
		if err = p.writeField10(oprot); err != nil {
			fieldId = 10
			goto WriteFieldError
		}
		if err = p.writeField11(oprot); err != nil {
			fieldId = 11
			goto WriteFieldError
		}
		if err = p.writeField12(oprot); err != nil {
			fieldId = 12
			goto WriteFieldError
		}
		if err = p.writeField13(oprot); err != nil {
			fieldId = 13
			goto WriteFieldError
		}
		if err = p.writeField14(oprot); err != nil {
			fieldId = 14
			goto WriteFieldError
		}
		if err = p.writeField15(oprot); err != nil {
			fieldId = 15
			goto WriteFieldError
		}
		if err = p.writeField16(oprot); err != nil {
			fieldId = 16
			goto WriteFieldError
		}
		if err = p.writeField17(oprot); err != nil {
			fieldId = 17
			goto WriteFieldError
		}
		if err = p.writeField18(oprot); err != nil {
			fieldId = 18
			goto WriteFieldError
		}
		if err = p.writeField19(oprot); err != nil {
			fieldId = 19
			goto WriteFieldError
		}
		if err = p.writeField20(oprot); err != nil {
			fieldId = 20
			goto WriteFieldError
		}
		if err = p.writeField21(oprot); err != nil {
			fieldId = 21
			goto WriteFieldError
		}
		if err = p.writeField22(oprot); err != nil {
			fieldId = 22
			goto WriteFieldError
		}
		if err = p.writeField23(oprot); err != nil {
			fieldId = 23
			goto WriteFieldError
		}
		if err = p.writeField24(oprot); err != nil {
			fieldId = 24
			goto WriteFieldError
		}
		if err = p.writeField25(oprot); err != nil {
			fieldId = 25
			goto WriteFieldError
		}
		if err = p.writeField26(oprot); err != nil {
			fieldId = 26
			goto WriteFieldError
		}
		if err = p.writeField27(oprot); err != nil {
			fieldId = 27
			goto WriteFieldError
		}
		if err = p.writeField28(oprot); err != nil {
			fieldId = 28
			goto WriteFieldError
		}
		if err = p.writeField29(oprot); err != nil {
			fieldId = 29
			goto WriteFieldError
		}
		if err = p.writeField30(oprot); err != nil {
			fieldId = 30
			goto WriteFieldError
		}
		if err = p.writeField31(oprot); err != nil {
			fieldId = 31
			goto WriteFieldError
		}
		if err = p.writeField32(oprot); err != nil {
			fieldId = 32
			goto WriteFieldError
		}
		if err = p.writeField33(oprot); err != nil {
			fieldId = 33
			goto WriteFieldError
		}
		if err = p.writeField34(oprot); err != nil {
			fieldId = 34
			goto WriteFieldError
		}
		if err = p.writeField35(oprot); err != nil {
			fieldId = 35
			goto WriteFieldError
		}
		if err = p.writeField36(oprot); err != nil {
			fieldId = 36
			goto WriteFieldError
		}
	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *Schema) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("nullable", thrift.BOOL, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteBool(p.Nullable); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *Schema) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("discriminator", thrift.STRUCT, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Discriminator.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err)
}

func (p *Schema) writeField3(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("read_only", thrift.BOOL, 3); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteBool(p.ReadOnly); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err)
}

func (p *Schema) writeField4(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("write_only", thrift.BOOL, 4); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteBool(p.WriteOnly); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err)
}

func (p *Schema) writeField5(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("xml", thrift.STRUCT, 5); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Xml.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err)
}

func (p *Schema) writeField6(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("external_docs", thrift.STRUCT, 6); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.ExternalDocs.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 6 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err)
}

func (p *Schema) writeField7(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("example", thrift.STRUCT, 7); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Example.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 7 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 7 end error: ", p), err)
}

func (p *Schema) writeField8(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("deprecated", thrift.BOOL, 8); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteBool(p.Deprecated); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 8 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 8 end error: ", p), err)
}

func (p *Schema) writeField9(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("title", thrift.STRING, 9); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.Title); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 9 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 9 end error: ", p), err)
}

func (p *Schema) writeField10(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("multiple_of", thrift.DOUBLE, 10); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteDouble(p.MultipleOf); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 10 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 10 end error: ", p), err)
}

func (p *Schema) writeField11(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("maximum", thrift.DOUBLE, 11); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteDouble(p.Maximum); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 11 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 11 end error: ", p), err)
}

func (p *Schema) writeField12(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("exclusive_maximum", thrift.BOOL, 12); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteBool(p.ExclusiveMaximum); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 12 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 12 end error: ", p), err)
}

func (p *Schema) writeField13(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("minimum", thrift.DOUBLE, 13); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteDouble(p.Minimum); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 13 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 13 end error: ", p), err)
}

func (p *Schema) writeField14(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("exclusive_minimum", thrift.BOOL, 14); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteBool(p.ExclusiveMinimum); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 14 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 14 end error: ", p), err)
}

func (p *Schema) writeField15(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("max_length", thrift.I64, 15); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteI64(p.MaxLength); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 15 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 15 end error: ", p), err)
}

func (p *Schema) writeField16(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("min_length", thrift.I64, 16); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteI64(p.MinLength); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 16 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 16 end error: ", p), err)
}

func (p *Schema) writeField17(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("pattern", thrift.STRING, 17); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.Pattern); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 17 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 17 end error: ", p), err)
}

func (p *Schema) writeField18(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("max_items", thrift.I64, 18); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteI64(p.MaxItems); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 18 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 18 end error: ", p), err)
}

func (p *Schema) writeField19(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("min_items", thrift.I64, 19); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteI64(p.MinItems); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 19 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 19 end error: ", p), err)
}

func (p *Schema) writeField20(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("unique_items", thrift.BOOL, 20); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteBool(p.UniqueItems); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 20 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 20 end error: ", p), err)
}

func (p *Schema) writeField21(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("max_properties", thrift.I64, 21); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteI64(p.MaxProperties); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 21 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 21 end error: ", p), err)
}

func (p *Schema) writeField22(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("min_properties", thrift.I64, 22); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteI64(p.MinProperties); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 22 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 22 end error: ", p), err)
}

func (p *Schema) writeField23(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("required", thrift.LIST, 23); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRING, len(p.Required)); err != nil {
		return err
	}
	for _, v := range p.Required {
		if err := oprot.WriteString(v); err != nil {
			return err
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 23 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 23 end error: ", p), err)
}

func (p *Schema) writeField24(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("enum", thrift.LIST, 24); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Enum)); err != nil {
		return err
	}
	for _, v := range p.Enum {
		if err := v.Write(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 24 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 24 end error: ", p), err)
}

func (p *Schema) writeField25(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("type", thrift.STRING, 25); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.Type); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 25 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 25 end error: ", p), err)
}

func (p *Schema) writeField26(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("all_of", thrift.LIST, 26); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.AllOf)); err != nil {
		return err
	}
	for _, v := range p.AllOf {
		if err := v.Write(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 26 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 26 end error: ", p), err)
}

func (p *Schema) writeField27(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("one_of", thrift.LIST, 27); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.OneOf)); err != nil {
		return err
	}
	for _, v := range p.OneOf {
		if err := v.Write(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 27 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 27 end error: ", p), err)
}

func (p *Schema) writeField28(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("any_of", thrift.LIST, 28); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.AnyOf)); err != nil {
		return err
	}
	for _, v := range p.AnyOf {
		if err := v.Write(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 28 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 28 end error: ", p), err)
}

func (p *Schema) writeField29(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("not", thrift.STRUCT, 29); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Not.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 29 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 29 end error: ", p), err)
}

func (p *Schema) writeField30(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("items", thrift.STRUCT, 30); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Items.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 30 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 30 end error: ", p), err)
}

func (p *Schema) writeField31(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("properties", thrift.STRUCT, 31); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Properties.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 31 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 31 end error: ", p), err)
}

func (p *Schema) writeField32(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("additional_properties", thrift.STRUCT, 32); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.AdditionalProperties.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 32 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 32 end error: ", p), err)
}

func (p *Schema) writeField33(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("default", thrift.STRUCT, 33); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Default.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 33 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 33 end error: ", p), err)
}

func (p *Schema) writeField34(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("description", thrift.STRING, 34); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.Description); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 34 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 34 end error: ", p), err)
}

func (p *Schema) writeField35(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("format", thrift.STRING, 35); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.Format); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 35 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 35 end error: ", p), err)
}

func (p *Schema) writeField36(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("specification_extension", thrift.LIST, 36); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.SpecificationExtension)); err != nil {
		return err
	}
	for _, v := range p.SpecificationExtension {
		if err := v.Write(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 36 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 36 end error: ", p), err)
}

func (p *Schema) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("Schema(%+v)", *p)

}

func (p *Schema) DeepEqual(ano *Schema) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.Nullable) {
		return false
	}
	if !p.Field2DeepEqual(ano.Discriminator) {
		return false
	}
	if !p.Field3DeepEqual(ano.ReadOnly) {
		return false
	}
	if !p.Field4DeepEqual(ano.WriteOnly) {
		return false
	}
	if !p.Field5DeepEqual(ano.Xml) {
		return false
	}
	if !p.Field6DeepEqual(ano.ExternalDocs) {
		return false
	}
	if !p.Field7DeepEqual(ano.Example) {
		return false
	}
	if !p.Field8DeepEqual(ano.Deprecated) {
		return false
	}
	if !p.Field9DeepEqual(ano.Title) {
		return false
	}
	if !p.Field10DeepEqual(ano.MultipleOf) {
		return false
	}
	if !p.Field11DeepEqual(ano.Maximum) {
		return false
	}
	if !p.Field12DeepEqual(ano.ExclusiveMaximum) {
		return false
	}
	if !p.Field13DeepEqual(ano.Minimum) {
		return false
	}
	if !p.Field14DeepEqual(ano.ExclusiveMinimum) {
		return false
	}
	if !p.Field15DeepEqual(ano.MaxLength) {
		return false
	}
	if !p.Field16DeepEqual(ano.MinLength) {
		return false
	}
	if !p.Field17DeepEqual(ano.Pattern) {
		return false
	}
	if !p.Field18DeepEqual(ano.MaxItems) {
		return false
	}
	if !p.Field19DeepEqual(ano.MinItems) {
		return false
	}
	if !p.Field20DeepEqual(ano.UniqueItems) {
		return false
	}
	if !p.Field21DeepEqual(ano.MaxProperties) {
		return false
	}
	if !p.Field22DeepEqual(ano.MinProperties) {
		return false
	}
	if !p.Field23DeepEqual(ano.Required) {
		return false
	}
	if !p.Field24DeepEqual(ano.Enum) {
		return false
	}
	if !p.Field25DeepEqual(ano.Type) {
		return false
	}
	if !p.Field26DeepEqual(ano.AllOf) {
		return false
	}
	if !p.Field27DeepEqual(ano.OneOf) {
		return false
	}
	if !p.Field28DeepEqual(ano.AnyOf) {
		return false
	}
	if !p.Field29DeepEqual(ano.Not) {
		return false
	}
	if !p.Field30DeepEqual(ano.Items) {
		return false
	}
	if !p.Field31DeepEqual(ano.Properties) {
		return false
	}
	if !p.Field32DeepEqual(ano.AdditionalProperties) {
		return false
	}
	if !p.Field33DeepEqual(ano.Default) {
		return false
	}
	if !p.Field34DeepEqual(ano.Description) {
		return false
	}
	if !p.Field35DeepEqual(ano.Format) {
		return false
	}
	if !p.Field36DeepEqual(ano.SpecificationExtension) {
		return false
	}
	return true
}

func (p *Schema) Field1DeepEqual(src bool) bool {

	if p.Nullable != src {
		return false
	}
	return true
}
func (p *Schema) Field2DeepEqual(src *Discriminator) bool {

	if !p.Discriminator.DeepEqual(src) {
		return false
	}
	return true
}
func (p *Schema) Field3DeepEqual(src bool) bool {

	if p.ReadOnly != src {
		return false
	}
	return true
}
func (p *Schema) Field4DeepEqual(src bool) bool {

	if p.WriteOnly != src {
		return false
	}
	return true
}
func (p *Schema) Field5DeepEqual(src *Xml) bool {

	if !p.Xml.DeepEqual(src) {
		return false
	}
	return true
}
func (p *Schema) Field6DeepEqual(src *ExternalDocs) bool {

	if !p.ExternalDocs.DeepEqual(src) {
		return false
	}
	return true
}
func (p *Schema) Field7DeepEqual(src *Any) bool {

	if !p.Example.DeepEqual(src) {
		return false
	}
	return true
}
func (p *Schema) Field8DeepEqual(src bool) bool {

	if p.Deprecated != src {
		return false
	}
	return true
}
func (p *Schema) Field9DeepEqual(src string) bool {

	if strings.Compare(p.Title, src) != 0 {
		return false
	}
	return true
}
func (p *Schema) Field10DeepEqual(src float64) bool {

	if p.MultipleOf != src {
		return false
	}
	return true
}
func (p *Schema) Field11DeepEqual(src float64) bool {

	if p.Maximum != src {
		return false
	}
	return true
}
func (p *Schema) Field12DeepEqual(src bool) bool {

	if p.ExclusiveMaximum != src {
		return false
	}
	return true
}
func (p *Schema) Field13DeepEqual(src float64) bool {

	if p.Minimum != src {
		return false
	}
	return true
}
func (p *Schema) Field14DeepEqual(src bool) bool {

	if p.ExclusiveMinimum != src {
		return false
	}
	return true
}
func (p *Schema) Field15DeepEqual(src int64) bool {

	if p.MaxLength != src {
		return false
	}
	return true
}
func (p *Schema) Field16DeepEqual(src int64) bool {

	if p.MinLength != src {
		return false
	}
	return true
}
func (p *Schema) Field17DeepEqual(src string) bool {

	if strings.Compare(p.Pattern, src) != 0 {
		return false
	}
	return true
}
func (p *Schema) Field18DeepEqual(src int64) bool {

	if p.MaxItems != src {
		return false
	}
	return true
}
func (p *Schema) Field19DeepEqual(src int64) bool {

	if p.MinItems != src {
		return false
	}
	return true
}
func (p *Schema) Field20DeepEqual(src bool) bool {

	if p.UniqueItems != src {
		return false
	}
	return true
}
func (p *Schema) Field21DeepEqual(src int64) bool {

	if p.MaxProperties != src {
		return false
	}
	return true
}
func (p *Schema) Field22DeepEqual(src int64) bool {

	if p.MinProperties != src {
		return false
	}
	return true
}
func (p *Schema) Field23DeepEqual(src []string) bool {

	if len(p.Required) != len(src) {
		return false
	}
	for i, v := range p.Required {
		_src := src[i]
		if strings.Compare(v, _src) != 0 {
			return false
		}
	}
	return true
}
func (p *Schema) Field24DeepEqual(src []*Any) bool {

	if len(p.Enum) != len(src) {
		return false
	}
	for i, v := range p.Enum {
		_src := src[i]
		if !v.DeepEqual(_src) {
			return false
		}
	}
	return true
}
func (p *Schema) Field25DeepEqual(src string) bool {

	if strings.Compare(p.Type, src) != 0 {
		return false
	}
	return true
}
func (p *Schema) Field26DeepEqual(src []*SchemaOrReference) bool {

	if len(p.AllOf) != len(src) {
		return false
	}
	for i, v := range p.AllOf {
		_src := src[i]
		if !v.DeepEqual(_src) {
			return false
		}
	}
	return true
}
func (p *Schema) Field27DeepEqual(src []*SchemaOrReference) bool {

	if len(p.OneOf) != len(src) {
		return false
	}
	for i, v := range p.OneOf {
		_src := src[i]
		if !v.DeepEqual(_src) {
			return false
		}
	}
	return true
}
func (p *Schema) Field28DeepEqual(src []*SchemaOrReference) bool {

	if len(p.AnyOf) != len(src) {
		return false
	}
	for i, v := range p.AnyOf {
		_src := src[i]
		if !v.DeepEqual(_src) {
			return false
		}
	}
	return true
}
func (p *Schema) Field29DeepEqual(src *Schema) bool {

	if !p.Not.DeepEqual(src) {
		return false
	}
	return true
}
func (p *Schema) Field30DeepEqual(src *ItemsItem) bool {

	if !p.Items.DeepEqual(src) {
		return false
	}
	return true
}
func (p *Schema) Field31DeepEqual(src *Properties) bool {

	if !p.Properties.DeepEqual(src) {
		return false
	}
	return true
}
func (p *Schema) Field32DeepEqual(src *AdditionalPropertiesItem) bool {

	if !p.AdditionalProperties.DeepEqual(src) {
		return false
	}
	return true
}
func (p *Schema) Field33DeepEqual(src *DefaultType) bool {

	if !p.Default.DeepEqual(src) {
		return false
	}
	return true
}
func (p *Schema) Field34DeepEqual(src string) bool {

	if strings.Compare(p.Description, src) != 0 {
		return false
	}
	return true
}
func (p *Schema) Field35DeepEqual(src string) bool {

	if strings.Compare(p.Format, src) != 0 {
		return false
	}
	return true
}
func (p *Schema) Field36DeepEqual(src []*NamedAny) bool {

	if len(p.SpecificationExtension) != len(src) {
		return false
	}
	for i, v := range p.SpecificationExtension {
		_src := src[i]
		if !v.DeepEqual(_src) {
			return false
		}
	}
	return true
}

type SchemaOrReference struct {
	Schema    *Schema    `thrift:"schema,1" frugal:"1,default,Schema" json:"schema"`
	Reference *Reference `thrift:"reference,2" frugal:"2,default,Reference" json:"reference"`
}

func NewSchemaOrReference() *SchemaOrReference {
	return &SchemaOrReference{}
}

func (p *SchemaOrReference) InitDefault() {
}

var SchemaOrReference_Schema_DEFAULT *Schema

func (p *SchemaOrReference) GetSchema() (v *Schema) {
	if !p.IsSetSchema() {
		return SchemaOrReference_Schema_DEFAULT
	}
	return p.Schema
}

var SchemaOrReference_Reference_DEFAULT *Reference

func (p *SchemaOrReference) GetReference() (v *Reference) {
	if !p.IsSetReference() {
		return SchemaOrReference_Reference_DEFAULT
	}
	return p.Reference
}
func (p *SchemaOrReference) SetSchema(val *Schema) {
	p.Schema = val
}
func (p *SchemaOrReference) SetReference(val *Reference) {
	p.Reference = val
}

var fieldIDToName_SchemaOrReference = map[int16]string{
	1: "schema",
	2: "reference",
}

func (p *SchemaOrReference) IsSetSchema() bool {
	return p.Schema != nil
}

func (p *SchemaOrReference) IsSetReference() bool {
	return p.Reference != nil
}

func (p *SchemaOrReference) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 2:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField2(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}
		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_SchemaOrReference[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *SchemaOrReference) ReadField1(iprot thrift.TProtocol) error {
	_field := NewSchema()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Schema = _field
	return nil
}
func (p *SchemaOrReference) ReadField2(iprot thrift.TProtocol) error {
	_field := NewReference()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Reference = _field
	return nil
}

func (p *SchemaOrReference) Write(oprot thrift.TProtocol) (err error) {

	var fieldId int16
	if err = oprot.WriteStructBegin("SchemaOrReference"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
		if err = p.writeField2(oprot); err != nil {
			fieldId = 2
			goto WriteFieldError
		}
	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *SchemaOrReference) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("schema", thrift.STRUCT, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Schema.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *SchemaOrReference) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("reference", thrift.STRUCT, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Reference.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err)
}

func (p *SchemaOrReference) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("SchemaOrReference(%+v)", *p)

}

func (p *SchemaOrReference) DeepEqual(ano *SchemaOrReference) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.Schema) {
		return false
	}
	if !p.Field2DeepEqual(ano.Reference) {
		return false
	}
	return true
}

func (p *SchemaOrReference) Field1DeepEqual(src *Schema) bool {

	if !p.Schema.DeepEqual(src) {
		return false
	}
	return true
}
func (p *SchemaOrReference) Field2DeepEqual(src *Reference) bool {

	if !p.Reference.DeepEqual(src) {
		return false
	}
	return true
}

type SchemasOrReferences struct {
	AdditionalProperties []*NamedSchemaOrReference `thrift:"additional_properties,1" frugal:"1,default,list<NamedSchemaOrReference>" json:"additional_properties"`
}

func NewSchemasOrReferences() *SchemasOrReferences {
	return &SchemasOrReferences{}
}

func (p *SchemasOrReferences) InitDefault() {
}

func (p *SchemasOrReferences) GetAdditionalProperties() (v []*NamedSchemaOrReference) {
	return p.AdditionalProperties
}
func (p *SchemasOrReferences) SetAdditionalProperties(val []*NamedSchemaOrReference) {
	p.AdditionalProperties = val
}

var fieldIDToName_SchemasOrReferences = map[int16]string{
	1: "additional_properties",
}

func (p *SchemasOrReferences) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.LIST {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}
		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_SchemasOrReferences[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *SchemasOrReferences) ReadField1(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	_field := make([]*NamedSchemaOrReference, 0, size)
	values := make([]NamedSchemaOrReference, size)
	for i := 0; i < size; i++ {
		_elem := &values[i]
		_elem.InitDefault()

		if err := _elem.Read(iprot); err != nil {
			return err
		}

		_field = append(_field, _elem)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return err
	}
	p.AdditionalProperties = _field
	return nil
}

func (p *SchemasOrReferences) Write(oprot thrift.TProtocol) (err error) {

	var fieldId int16
	if err = oprot.WriteStructBegin("SchemasOrReferences"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *SchemasOrReferences) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("additional_properties", thrift.LIST, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.AdditionalProperties)); err != nil {
		return err
	}
	for _, v := range p.AdditionalProperties {
		if err := v.Write(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *SchemasOrReferences) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("SchemasOrReferences(%+v)", *p)

}

func (p *SchemasOrReferences) DeepEqual(ano *SchemasOrReferences) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.AdditionalProperties) {
		return false
	}
	return true
}

func (p *SchemasOrReferences) Field1DeepEqual(src []*NamedSchemaOrReference) bool {

	if len(p.AdditionalProperties) != len(src) {
		return false
	}
	for i, v := range p.AdditionalProperties {
		_src := src[i]
		if !v.DeepEqual(_src) {
			return false
		}
	}
	return true
}

type SecurityRequirement struct {
	AdditionalProperties []*NamedStringArray `thrift:"additional_properties,1" frugal:"1,default,list<NamedStringArray>" json:"additional_properties"`
}

func NewSecurityRequirement() *SecurityRequirement {
	return &SecurityRequirement{}
}

func (p *SecurityRequirement) InitDefault() {
}

func (p *SecurityRequirement) GetAdditionalProperties() (v []*NamedStringArray) {
	return p.AdditionalProperties
}
func (p *SecurityRequirement) SetAdditionalProperties(val []*NamedStringArray) {
	p.AdditionalProperties = val
}

var fieldIDToName_SecurityRequirement = map[int16]string{
	1: "additional_properties",
}

func (p *SecurityRequirement) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.LIST {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}
		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_SecurityRequirement[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *SecurityRequirement) ReadField1(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	_field := make([]*NamedStringArray, 0, size)
	values := make([]NamedStringArray, size)
	for i := 0; i < size; i++ {
		_elem := &values[i]
		_elem.InitDefault()

		if err := _elem.Read(iprot); err != nil {
			return err
		}

		_field = append(_field, _elem)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return err
	}
	p.AdditionalProperties = _field
	return nil
}

func (p *SecurityRequirement) Write(oprot thrift.TProtocol) (err error) {

	var fieldId int16
	if err = oprot.WriteStructBegin("SecurityRequirement"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *SecurityRequirement) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("additional_properties", thrift.LIST, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.AdditionalProperties)); err != nil {
		return err
	}
	for _, v := range p.AdditionalProperties {
		if err := v.Write(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *SecurityRequirement) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("SecurityRequirement(%+v)", *p)

}

func (p *SecurityRequirement) DeepEqual(ano *SecurityRequirement) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.AdditionalProperties) {
		return false
	}
	return true
}

func (p *SecurityRequirement) Field1DeepEqual(src []*NamedStringArray) bool {

	if len(p.AdditionalProperties) != len(src) {
		return false
	}
	for i, v := range p.AdditionalProperties {
		_src := src[i]
		if !v.DeepEqual(_src) {
			return false
		}
	}
	return true
}

type SecurityScheme struct {
	_Type                  string      `thrift:"_type,1" frugal:"1,default,string" json:"_type"`
	Description            string      `thrift:"description,2" frugal:"2,default,string" json:"description"`
	Name                   string      `thrift:"name,3" frugal:"3,default,string" json:"name"`
	_In                    string      `thrift:"_in,4" frugal:"4,default,string" json:"_in"`
	Scheme                 string      `thrift:"scheme,5" frugal:"5,default,string" json:"scheme"`
	BearerFormat           string      `thrift:"bearer_format,6" frugal:"6,default,string" json:"bearer_format"`
	Flows                  *OauthFlows `thrift:"flows,7" frugal:"7,default,OauthFlows" json:"flows"`
	OpenIdConnectUrl       string      `thrift:"open_id_connect_url,8" frugal:"8,default,string" json:"open_id_connect_url"`
	SpecificationExtension []*NamedAny `thrift:"specification_extension,9" frugal:"9,default,list<NamedAny>" json:"specification_extension"`
}

func NewSecurityScheme() *SecurityScheme {
	return &SecurityScheme{}
}

func (p *SecurityScheme) InitDefault() {
}

func (p *SecurityScheme) Get_Type() (v string) {
	return p._Type
}

func (p *SecurityScheme) GetDescription() (v string) {
	return p.Description
}

func (p *SecurityScheme) GetName() (v string) {
	return p.Name
}

func (p *SecurityScheme) Get_In() (v string) {
	return p._In
}

func (p *SecurityScheme) GetScheme() (v string) {
	return p.Scheme
}

func (p *SecurityScheme) GetBearerFormat() (v string) {
	return p.BearerFormat
}

var SecurityScheme_Flows_DEFAULT *OauthFlows

func (p *SecurityScheme) GetFlows() (v *OauthFlows) {
	if !p.IsSetFlows() {
		return SecurityScheme_Flows_DEFAULT
	}
	return p.Flows
}

func (p *SecurityScheme) GetOpenIdConnectUrl() (v string) {
	return p.OpenIdConnectUrl
}

func (p *SecurityScheme) GetSpecificationExtension() (v []*NamedAny) {
	return p.SpecificationExtension
}
func (p *SecurityScheme) Set_Type(val string) {
	p._Type = val
}
func (p *SecurityScheme) SetDescription(val string) {
	p.Description = val
}
func (p *SecurityScheme) SetName(val string) {
	p.Name = val
}
func (p *SecurityScheme) Set_In(val string) {
	p._In = val
}
func (p *SecurityScheme) SetScheme(val string) {
	p.Scheme = val
}
func (p *SecurityScheme) SetBearerFormat(val string) {
	p.BearerFormat = val
}
func (p *SecurityScheme) SetFlows(val *OauthFlows) {
	p.Flows = val
}
func (p *SecurityScheme) SetOpenIdConnectUrl(val string) {
	p.OpenIdConnectUrl = val
}
func (p *SecurityScheme) SetSpecificationExtension(val []*NamedAny) {
	p.SpecificationExtension = val
}

var fieldIDToName_SecurityScheme = map[int16]string{
	1: "_type",
	2: "description",
	3: "name",
	4: "_in",
	5: "scheme",
	6: "bearer_format",
	7: "flows",
	8: "open_id_connect_url",
	9: "specification_extension",
}

func (p *SecurityScheme) IsSetFlows() bool {
	return p.Flows != nil
}

func (p *SecurityScheme) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 2:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField2(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 3:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField3(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 4:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField4(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 5:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField5(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 6:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField6(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 7:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField7(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 8:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField8(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 9:
			if fieldTypeId == thrift.LIST {
				if err = p.ReadField9(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}
		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_SecurityScheme[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *SecurityScheme) ReadField1(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p._Type = _field
	return nil
}
func (p *SecurityScheme) ReadField2(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Description = _field
	return nil
}
func (p *SecurityScheme) ReadField3(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Name = _field
	return nil
}
func (p *SecurityScheme) ReadField4(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p._In = _field
	return nil
}
func (p *SecurityScheme) ReadField5(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Scheme = _field
	return nil
}
func (p *SecurityScheme) ReadField6(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p.BearerFormat = _field
	return nil
}
func (p *SecurityScheme) ReadField7(iprot thrift.TProtocol) error {
	_field := NewOauthFlows()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Flows = _field
	return nil
}
func (p *SecurityScheme) ReadField8(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p.OpenIdConnectUrl = _field
	return nil
}
func (p *SecurityScheme) ReadField9(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	_field := make([]*NamedAny, 0, size)
	values := make([]NamedAny, size)
	for i := 0; i < size; i++ {
		_elem := &values[i]
		_elem.InitDefault()

		if err := _elem.Read(iprot); err != nil {
			return err
		}

		_field = append(_field, _elem)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return err
	}
	p.SpecificationExtension = _field
	return nil
}

func (p *SecurityScheme) Write(oprot thrift.TProtocol) (err error) {

	var fieldId int16
	if err = oprot.WriteStructBegin("SecurityScheme"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
		if err = p.writeField2(oprot); err != nil {
			fieldId = 2
			goto WriteFieldError
		}
		if err = p.writeField3(oprot); err != nil {
			fieldId = 3
			goto WriteFieldError
		}
		if err = p.writeField4(oprot); err != nil {
			fieldId = 4
			goto WriteFieldError
		}
		if err = p.writeField5(oprot); err != nil {
			fieldId = 5
			goto WriteFieldError
		}
		if err = p.writeField6(oprot); err != nil {
			fieldId = 6
			goto WriteFieldError
		}
		if err = p.writeField7(oprot); err != nil {
			fieldId = 7
			goto WriteFieldError
		}
		if err = p.writeField8(oprot); err != nil {
			fieldId = 8
			goto WriteFieldError
		}
		if err = p.writeField9(oprot); err != nil {
			fieldId = 9
			goto WriteFieldError
		}
	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *SecurityScheme) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("_type", thrift.STRING, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p._Type); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *SecurityScheme) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("description", thrift.STRING, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.Description); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err)
}

func (p *SecurityScheme) writeField3(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("name", thrift.STRING, 3); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.Name); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err)
}

func (p *SecurityScheme) writeField4(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("_in", thrift.STRING, 4); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p._In); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err)
}

func (p *SecurityScheme) writeField5(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("scheme", thrift.STRING, 5); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.Scheme); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err)
}

func (p *SecurityScheme) writeField6(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("bearer_format", thrift.STRING, 6); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.BearerFormat); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 6 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err)
}

func (p *SecurityScheme) writeField7(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("flows", thrift.STRUCT, 7); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Flows.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 7 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 7 end error: ", p), err)
}

func (p *SecurityScheme) writeField8(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("open_id_connect_url", thrift.STRING, 8); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.OpenIdConnectUrl); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 8 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 8 end error: ", p), err)
}

func (p *SecurityScheme) writeField9(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("specification_extension", thrift.LIST, 9); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.SpecificationExtension)); err != nil {
		return err
	}
	for _, v := range p.SpecificationExtension {
		if err := v.Write(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 9 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 9 end error: ", p), err)
}

func (p *SecurityScheme) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("SecurityScheme(%+v)", *p)

}

func (p *SecurityScheme) DeepEqual(ano *SecurityScheme) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano._Type) {
		return false
	}
	if !p.Field2DeepEqual(ano.Description) {
		return false
	}
	if !p.Field3DeepEqual(ano.Name) {
		return false
	}
	if !p.Field4DeepEqual(ano._In) {
		return false
	}
	if !p.Field5DeepEqual(ano.Scheme) {
		return false
	}
	if !p.Field6DeepEqual(ano.BearerFormat) {
		return false
	}
	if !p.Field7DeepEqual(ano.Flows) {
		return false
	}
	if !p.Field8DeepEqual(ano.OpenIdConnectUrl) {
		return false
	}
	if !p.Field9DeepEqual(ano.SpecificationExtension) {
		return false
	}
	return true
}

func (p *SecurityScheme) Field1DeepEqual(src string) bool {

	if strings.Compare(p._Type, src) != 0 {
		return false
	}
	return true
}
func (p *SecurityScheme) Field2DeepEqual(src string) bool {

	if strings.Compare(p.Description, src) != 0 {
		return false
	}
	return true
}
func (p *SecurityScheme) Field3DeepEqual(src string) bool {

	if strings.Compare(p.Name, src) != 0 {
		return false
	}
	return true
}
func (p *SecurityScheme) Field4DeepEqual(src string) bool {

	if strings.Compare(p._In, src) != 0 {
		return false
	}
	return true
}
func (p *SecurityScheme) Field5DeepEqual(src string) bool {

	if strings.Compare(p.Scheme, src) != 0 {
		return false
	}
	return true
}
func (p *SecurityScheme) Field6DeepEqual(src string) bool {

	if strings.Compare(p.BearerFormat, src) != 0 {
		return false
	}
	return true
}
func (p *SecurityScheme) Field7DeepEqual(src *OauthFlows) bool {

	if !p.Flows.DeepEqual(src) {
		return false
	}
	return true
}
func (p *SecurityScheme) Field8DeepEqual(src string) bool {

	if strings.Compare(p.OpenIdConnectUrl, src) != 0 {
		return false
	}
	return true
}
func (p *SecurityScheme) Field9DeepEqual(src []*NamedAny) bool {

	if len(p.SpecificationExtension) != len(src) {
		return false
	}
	for i, v := range p.SpecificationExtension {
		_src := src[i]
		if !v.DeepEqual(_src) {
			return false
		}
	}
	return true
}

type SecuritySchemeOrReference struct {
	SecurityScheme *SecurityScheme `thrift:"security_scheme,1" frugal:"1,default,SecurityScheme" json:"security_scheme"`
	Reference      *Reference      `thrift:"reference,2" frugal:"2,default,Reference" json:"reference"`
}

func NewSecuritySchemeOrReference() *SecuritySchemeOrReference {
	return &SecuritySchemeOrReference{}
}

func (p *SecuritySchemeOrReference) InitDefault() {
}

var SecuritySchemeOrReference_SecurityScheme_DEFAULT *SecurityScheme

func (p *SecuritySchemeOrReference) GetSecurityScheme() (v *SecurityScheme) {
	if !p.IsSetSecurityScheme() {
		return SecuritySchemeOrReference_SecurityScheme_DEFAULT
	}
	return p.SecurityScheme
}

var SecuritySchemeOrReference_Reference_DEFAULT *Reference

func (p *SecuritySchemeOrReference) GetReference() (v *Reference) {
	if !p.IsSetReference() {
		return SecuritySchemeOrReference_Reference_DEFAULT
	}
	return p.Reference
}
func (p *SecuritySchemeOrReference) SetSecurityScheme(val *SecurityScheme) {
	p.SecurityScheme = val
}
func (p *SecuritySchemeOrReference) SetReference(val *Reference) {
	p.Reference = val
}

var fieldIDToName_SecuritySchemeOrReference = map[int16]string{
	1: "security_scheme",
	2: "reference",
}

func (p *SecuritySchemeOrReference) IsSetSecurityScheme() bool {
	return p.SecurityScheme != nil
}

func (p *SecuritySchemeOrReference) IsSetReference() bool {
	return p.Reference != nil
}

func (p *SecuritySchemeOrReference) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 2:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField2(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}
		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_SecuritySchemeOrReference[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *SecuritySchemeOrReference) ReadField1(iprot thrift.TProtocol) error {
	_field := NewSecurityScheme()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.SecurityScheme = _field
	return nil
}
func (p *SecuritySchemeOrReference) ReadField2(iprot thrift.TProtocol) error {
	_field := NewReference()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Reference = _field
	return nil
}

func (p *SecuritySchemeOrReference) Write(oprot thrift.TProtocol) (err error) {

	var fieldId int16
	if err = oprot.WriteStructBegin("SecuritySchemeOrReference"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
		if err = p.writeField2(oprot); err != nil {
			fieldId = 2
			goto WriteFieldError
		}
	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *SecuritySchemeOrReference) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("security_scheme", thrift.STRUCT, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.SecurityScheme.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *SecuritySchemeOrReference) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("reference", thrift.STRUCT, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Reference.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err)
}

func (p *SecuritySchemeOrReference) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("SecuritySchemeOrReference(%+v)", *p)

}

func (p *SecuritySchemeOrReference) DeepEqual(ano *SecuritySchemeOrReference) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.SecurityScheme) {
		return false
	}
	if !p.Field2DeepEqual(ano.Reference) {
		return false
	}
	return true
}

func (p *SecuritySchemeOrReference) Field1DeepEqual(src *SecurityScheme) bool {

	if !p.SecurityScheme.DeepEqual(src) {
		return false
	}
	return true
}
func (p *SecuritySchemeOrReference) Field2DeepEqual(src *Reference) bool {

	if !p.Reference.DeepEqual(src) {
		return false
	}
	return true
}

type SecuritySchemesOrReferences struct {
	AdditionalProperties []*NamedSecuritySchemeOrReference `thrift:"additional_properties,1" frugal:"1,default,list<NamedSecuritySchemeOrReference>" json:"additional_properties"`
}

func NewSecuritySchemesOrReferences() *SecuritySchemesOrReferences {
	return &SecuritySchemesOrReferences{}
}

func (p *SecuritySchemesOrReferences) InitDefault() {
}

func (p *SecuritySchemesOrReferences) GetAdditionalProperties() (v []*NamedSecuritySchemeOrReference) {
	return p.AdditionalProperties
}
func (p *SecuritySchemesOrReferences) SetAdditionalProperties(val []*NamedSecuritySchemeOrReference) {
	p.AdditionalProperties = val
}

var fieldIDToName_SecuritySchemesOrReferences = map[int16]string{
	1: "additional_properties",
}

func (p *SecuritySchemesOrReferences) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.LIST {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}
		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_SecuritySchemesOrReferences[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *SecuritySchemesOrReferences) ReadField1(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	_field := make([]*NamedSecuritySchemeOrReference, 0, size)
	values := make([]NamedSecuritySchemeOrReference, size)
	for i := 0; i < size; i++ {
		_elem := &values[i]
		_elem.InitDefault()

		if err := _elem.Read(iprot); err != nil {
			return err
		}

		_field = append(_field, _elem)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return err
	}
	p.AdditionalProperties = _field
	return nil
}

func (p *SecuritySchemesOrReferences) Write(oprot thrift.TProtocol) (err error) {

	var fieldId int16
	if err = oprot.WriteStructBegin("SecuritySchemesOrReferences"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *SecuritySchemesOrReferences) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("additional_properties", thrift.LIST, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.AdditionalProperties)); err != nil {
		return err
	}
	for _, v := range p.AdditionalProperties {
		if err := v.Write(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *SecuritySchemesOrReferences) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("SecuritySchemesOrReferences(%+v)", *p)

}

func (p *SecuritySchemesOrReferences) DeepEqual(ano *SecuritySchemesOrReferences) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.AdditionalProperties) {
		return false
	}
	return true
}

func (p *SecuritySchemesOrReferences) Field1DeepEqual(src []*NamedSecuritySchemeOrReference) bool {

	if len(p.AdditionalProperties) != len(src) {
		return false
	}
	for i, v := range p.AdditionalProperties {
		_src := src[i]
		if !v.DeepEqual(_src) {
			return false
		}
	}
	return true
}

type Server struct {
	Url                    string           `thrift:"url,1" frugal:"1,default,string" json:"url"`
	Description            string           `thrift:"description,2" frugal:"2,default,string" json:"description"`
	Variables              *ServerVariables `thrift:"variables,3" frugal:"3,default,ServerVariables" json:"variables"`
	SpecificationExtension []*NamedAny      `thrift:"specification_extension,4" frugal:"4,default,list<NamedAny>" json:"specification_extension"`
}

func NewServer() *Server {
	return &Server{}
}

func (p *Server) InitDefault() {
}

func (p *Server) GetUrl() (v string) {
	return p.Url
}

func (p *Server) GetDescription() (v string) {
	return p.Description
}

var Server_Variables_DEFAULT *ServerVariables

func (p *Server) GetVariables() (v *ServerVariables) {
	if !p.IsSetVariables() {
		return Server_Variables_DEFAULT
	}
	return p.Variables
}

func (p *Server) GetSpecificationExtension() (v []*NamedAny) {
	return p.SpecificationExtension
}
func (p *Server) SetUrl(val string) {
	p.Url = val
}
func (p *Server) SetDescription(val string) {
	p.Description = val
}
func (p *Server) SetVariables(val *ServerVariables) {
	p.Variables = val
}
func (p *Server) SetSpecificationExtension(val []*NamedAny) {
	p.SpecificationExtension = val
}

var fieldIDToName_Server = map[int16]string{
	1: "url",
	2: "description",
	3: "variables",
	4: "specification_extension",
}

func (p *Server) IsSetVariables() bool {
	return p.Variables != nil
}

func (p *Server) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 2:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField2(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 3:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField3(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 4:
			if fieldTypeId == thrift.LIST {
				if err = p.ReadField4(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}
		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_Server[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *Server) ReadField1(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Url = _field
	return nil
}
func (p *Server) ReadField2(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Description = _field
	return nil
}
func (p *Server) ReadField3(iprot thrift.TProtocol) error {
	_field := NewServerVariables()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.Variables = _field
	return nil
}
func (p *Server) ReadField4(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	_field := make([]*NamedAny, 0, size)
	values := make([]NamedAny, size)
	for i := 0; i < size; i++ {
		_elem := &values[i]
		_elem.InitDefault()

		if err := _elem.Read(iprot); err != nil {
			return err
		}

		_field = append(_field, _elem)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return err
	}
	p.SpecificationExtension = _field
	return nil
}

func (p *Server) Write(oprot thrift.TProtocol) (err error) {

	var fieldId int16
	if err = oprot.WriteStructBegin("Server"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
		if err = p.writeField2(oprot); err != nil {
			fieldId = 2
			goto WriteFieldError
		}
		if err = p.writeField3(oprot); err != nil {
			fieldId = 3
			goto WriteFieldError
		}
		if err = p.writeField4(oprot); err != nil {
			fieldId = 4
			goto WriteFieldError
		}
	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *Server) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("url", thrift.STRING, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.Url); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *Server) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("description", thrift.STRING, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.Description); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err)
}

func (p *Server) writeField3(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("variables", thrift.STRUCT, 3); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Variables.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err)
}

func (p *Server) writeField4(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("specification_extension", thrift.LIST, 4); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.SpecificationExtension)); err != nil {
		return err
	}
	for _, v := range p.SpecificationExtension {
		if err := v.Write(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err)
}

func (p *Server) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("Server(%+v)", *p)

}

func (p *Server) DeepEqual(ano *Server) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.Url) {
		return false
	}
	if !p.Field2DeepEqual(ano.Description) {
		return false
	}
	if !p.Field3DeepEqual(ano.Variables) {
		return false
	}
	if !p.Field4DeepEqual(ano.SpecificationExtension) {
		return false
	}
	return true
}

func (p *Server) Field1DeepEqual(src string) bool {

	if strings.Compare(p.Url, src) != 0 {
		return false
	}
	return true
}
func (p *Server) Field2DeepEqual(src string) bool {

	if strings.Compare(p.Description, src) != 0 {
		return false
	}
	return true
}
func (p *Server) Field3DeepEqual(src *ServerVariables) bool {

	if !p.Variables.DeepEqual(src) {
		return false
	}
	return true
}
func (p *Server) Field4DeepEqual(src []*NamedAny) bool {

	if len(p.SpecificationExtension) != len(src) {
		return false
	}
	for i, v := range p.SpecificationExtension {
		_src := src[i]
		if !v.DeepEqual(_src) {
			return false
		}
	}
	return true
}

type ServerVariable struct {
	_Default               string      `thrift:"_default,1" frugal:"1,default,string" json:"_default"`
	Enum                   []string    `thrift:"enum,2" frugal:"2,default,list<string>" json:"enum"`
	Description            string      `thrift:"description,3" frugal:"3,default,string" json:"description"`
	SpecificationExtension []*NamedAny `thrift:"specification_extension,4" frugal:"4,default,list<NamedAny>" json:"specification_extension"`
}

func NewServerVariable() *ServerVariable {
	return &ServerVariable{}
}

func (p *ServerVariable) InitDefault() {
}

func (p *ServerVariable) Get_Default() (v string) {
	return p._Default
}

func (p *ServerVariable) GetEnum() (v []string) {
	return p.Enum
}

func (p *ServerVariable) GetDescription() (v string) {
	return p.Description
}

func (p *ServerVariable) GetSpecificationExtension() (v []*NamedAny) {
	return p.SpecificationExtension
}
func (p *ServerVariable) Set_Default(val string) {
	p._Default = val
}
func (p *ServerVariable) SetEnum(val []string) {
	p.Enum = val
}
func (p *ServerVariable) SetDescription(val string) {
	p.Description = val
}
func (p *ServerVariable) SetSpecificationExtension(val []*NamedAny) {
	p.SpecificationExtension = val
}

var fieldIDToName_ServerVariable = map[int16]string{
	1: "_default",
	2: "enum",
	3: "description",
	4: "specification_extension",
}

func (p *ServerVariable) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 2:
			if fieldTypeId == thrift.LIST {
				if err = p.ReadField2(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 3:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField3(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 4:
			if fieldTypeId == thrift.LIST {
				if err = p.ReadField4(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}
		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_ServerVariable[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *ServerVariable) ReadField1(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p._Default = _field
	return nil
}
func (p *ServerVariable) ReadField2(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	_field := make([]string, 0, size)
	for i := 0; i < size; i++ {

		var _elem string
		if v, err := iprot.ReadString(); err != nil {
			return err
		} else {
			_elem = v
		}

		_field = append(_field, _elem)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return err
	}
	p.Enum = _field
	return nil
}
func (p *ServerVariable) ReadField3(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Description = _field
	return nil
}
func (p *ServerVariable) ReadField4(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	_field := make([]*NamedAny, 0, size)
	values := make([]NamedAny, size)
	for i := 0; i < size; i++ {
		_elem := &values[i]
		_elem.InitDefault()

		if err := _elem.Read(iprot); err != nil {
			return err
		}

		_field = append(_field, _elem)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return err
	}
	p.SpecificationExtension = _field
	return nil
}

func (p *ServerVariable) Write(oprot thrift.TProtocol) (err error) {

	var fieldId int16
	if err = oprot.WriteStructBegin("ServerVariable"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
		if err = p.writeField2(oprot); err != nil {
			fieldId = 2
			goto WriteFieldError
		}
		if err = p.writeField3(oprot); err != nil {
			fieldId = 3
			goto WriteFieldError
		}
		if err = p.writeField4(oprot); err != nil {
			fieldId = 4
			goto WriteFieldError
		}
	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *ServerVariable) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("_default", thrift.STRING, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p._Default); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *ServerVariable) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("enum", thrift.LIST, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRING, len(p.Enum)); err != nil {
		return err
	}
	for _, v := range p.Enum {
		if err := oprot.WriteString(v); err != nil {
			return err
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err)
}

func (p *ServerVariable) writeField3(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("description", thrift.STRING, 3); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.Description); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err)
}

func (p *ServerVariable) writeField4(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("specification_extension", thrift.LIST, 4); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.SpecificationExtension)); err != nil {
		return err
	}
	for _, v := range p.SpecificationExtension {
		if err := v.Write(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err)
}

func (p *ServerVariable) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("ServerVariable(%+v)", *p)

}

func (p *ServerVariable) DeepEqual(ano *ServerVariable) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano._Default) {
		return false
	}
	if !p.Field2DeepEqual(ano.Enum) {
		return false
	}
	if !p.Field3DeepEqual(ano.Description) {
		return false
	}
	if !p.Field4DeepEqual(ano.SpecificationExtension) {
		return false
	}
	return true
}

func (p *ServerVariable) Field1DeepEqual(src string) bool {

	if strings.Compare(p._Default, src) != 0 {
		return false
	}
	return true
}
func (p *ServerVariable) Field2DeepEqual(src []string) bool {

	if len(p.Enum) != len(src) {
		return false
	}
	for i, v := range p.Enum {
		_src := src[i]
		if strings.Compare(v, _src) != 0 {
			return false
		}
	}
	return true
}
func (p *ServerVariable) Field3DeepEqual(src string) bool {

	if strings.Compare(p.Description, src) != 0 {
		return false
	}
	return true
}
func (p *ServerVariable) Field4DeepEqual(src []*NamedAny) bool {

	if len(p.SpecificationExtension) != len(src) {
		return false
	}
	for i, v := range p.SpecificationExtension {
		_src := src[i]
		if !v.DeepEqual(_src) {
			return false
		}
	}
	return true
}

type ServerVariables struct {
	AdditionalProperties []*NamedServerVariable `thrift:"additional_properties,1" frugal:"1,default,list<NamedServerVariable>" json:"additional_properties"`
}

func NewServerVariables() *ServerVariables {
	return &ServerVariables{}
}

func (p *ServerVariables) InitDefault() {
}

func (p *ServerVariables) GetAdditionalProperties() (v []*NamedServerVariable) {
	return p.AdditionalProperties
}
func (p *ServerVariables) SetAdditionalProperties(val []*NamedServerVariable) {
	p.AdditionalProperties = val
}

var fieldIDToName_ServerVariables = map[int16]string{
	1: "additional_properties",
}

func (p *ServerVariables) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.LIST {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}
		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_ServerVariables[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *ServerVariables) ReadField1(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	_field := make([]*NamedServerVariable, 0, size)
	values := make([]NamedServerVariable, size)
	for i := 0; i < size; i++ {
		_elem := &values[i]
		_elem.InitDefault()

		if err := _elem.Read(iprot); err != nil {
			return err
		}

		_field = append(_field, _elem)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return err
	}
	p.AdditionalProperties = _field
	return nil
}

func (p *ServerVariables) Write(oprot thrift.TProtocol) (err error) {

	var fieldId int16
	if err = oprot.WriteStructBegin("ServerVariables"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *ServerVariables) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("additional_properties", thrift.LIST, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.AdditionalProperties)); err != nil {
		return err
	}
	for _, v := range p.AdditionalProperties {
		if err := v.Write(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *ServerVariables) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("ServerVariables(%+v)", *p)

}

func (p *ServerVariables) DeepEqual(ano *ServerVariables) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.AdditionalProperties) {
		return false
	}
	return true
}

func (p *ServerVariables) Field1DeepEqual(src []*NamedServerVariable) bool {

	if len(p.AdditionalProperties) != len(src) {
		return false
	}
	for i, v := range p.AdditionalProperties {
		_src := src[i]
		if !v.DeepEqual(_src) {
			return false
		}
	}
	return true
}

type SpecificationExtension struct {
	Number  float64 `thrift:"number,1" frugal:"1,default,double" json:"number"`
	Boolean bool    `thrift:"boolean,2" frugal:"2,default,bool" json:"boolean"`
	String_ string  `thrift:"string,3" frugal:"3,default,string" json:"string"`
}

func NewSpecificationExtension() *SpecificationExtension {
	return &SpecificationExtension{}
}

func (p *SpecificationExtension) InitDefault() {
}

func (p *SpecificationExtension) GetNumber() (v float64) {
	return p.Number
}

func (p *SpecificationExtension) GetBoolean() (v bool) {
	return p.Boolean
}

func (p *SpecificationExtension) GetString() (v string) {
	return p.String_
}
func (p *SpecificationExtension) SetNumber(val float64) {
	p.Number = val
}
func (p *SpecificationExtension) SetBoolean(val bool) {
	p.Boolean = val
}
func (p *SpecificationExtension) SetString(val string) {
	p.String_ = val
}

var fieldIDToName_SpecificationExtension = map[int16]string{
	1: "number",
	2: "boolean",
	3: "string",
}

func (p *SpecificationExtension) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.DOUBLE {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 2:
			if fieldTypeId == thrift.BOOL {
				if err = p.ReadField2(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 3:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField3(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}
		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_SpecificationExtension[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *SpecificationExtension) ReadField1(iprot thrift.TProtocol) error {

	var _field float64
	if v, err := iprot.ReadDouble(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Number = _field
	return nil
}
func (p *SpecificationExtension) ReadField2(iprot thrift.TProtocol) error {

	var _field bool
	if v, err := iprot.ReadBool(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Boolean = _field
	return nil
}
func (p *SpecificationExtension) ReadField3(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p.String_ = _field
	return nil
}

func (p *SpecificationExtension) Write(oprot thrift.TProtocol) (err error) {

	var fieldId int16
	if err = oprot.WriteStructBegin("SpecificationExtension"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
		if err = p.writeField2(oprot); err != nil {
			fieldId = 2
			goto WriteFieldError
		}
		if err = p.writeField3(oprot); err != nil {
			fieldId = 3
			goto WriteFieldError
		}
	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *SpecificationExtension) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("number", thrift.DOUBLE, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteDouble(p.Number); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *SpecificationExtension) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("boolean", thrift.BOOL, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteBool(p.Boolean); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err)
}

func (p *SpecificationExtension) writeField3(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("string", thrift.STRING, 3); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.String_); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err)
}

func (p *SpecificationExtension) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("SpecificationExtension(%+v)", *p)

}

func (p *SpecificationExtension) DeepEqual(ano *SpecificationExtension) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.Number) {
		return false
	}
	if !p.Field2DeepEqual(ano.Boolean) {
		return false
	}
	if !p.Field3DeepEqual(ano.String_) {
		return false
	}
	return true
}

func (p *SpecificationExtension) Field1DeepEqual(src float64) bool {

	if p.Number != src {
		return false
	}
	return true
}
func (p *SpecificationExtension) Field2DeepEqual(src bool) bool {

	if p.Boolean != src {
		return false
	}
	return true
}
func (p *SpecificationExtension) Field3DeepEqual(src string) bool {

	if strings.Compare(p.String_, src) != 0 {
		return false
	}
	return true
}

type StringArray struct {
	Values []string `thrift:"values,1" frugal:"1,default,list<string>" json:"values"`
}

func NewStringArray() *StringArray {
	return &StringArray{}
}

func (p *StringArray) InitDefault() {
}

func (p *StringArray) GetValues() (v []string) {
	return p.Values
}
func (p *StringArray) SetValues(val []string) {
	p.Values = val
}

var fieldIDToName_StringArray = map[int16]string{
	1: "values",
}

func (p *StringArray) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.LIST {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}
		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_StringArray[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *StringArray) ReadField1(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	_field := make([]string, 0, size)
	for i := 0; i < size; i++ {

		var _elem string
		if v, err := iprot.ReadString(); err != nil {
			return err
		} else {
			_elem = v
		}

		_field = append(_field, _elem)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return err
	}
	p.Values = _field
	return nil
}

func (p *StringArray) Write(oprot thrift.TProtocol) (err error) {

	var fieldId int16
	if err = oprot.WriteStructBegin("StringArray"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *StringArray) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("values", thrift.LIST, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRING, len(p.Values)); err != nil {
		return err
	}
	for _, v := range p.Values {
		if err := oprot.WriteString(v); err != nil {
			return err
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *StringArray) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("StringArray(%+v)", *p)

}

func (p *StringArray) DeepEqual(ano *StringArray) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.Values) {
		return false
	}
	return true
}

func (p *StringArray) Field1DeepEqual(src []string) bool {

	if len(p.Values) != len(src) {
		return false
	}
	for i, v := range p.Values {
		_src := src[i]
		if strings.Compare(v, _src) != 0 {
			return false
		}
	}
	return true
}

type Strings struct {
	AdditionalProperties []*NamedString `thrift:"additional_properties,1" frugal:"1,default,list<NamedString>" json:"additional_properties"`
}

func NewStrings() *Strings {
	return &Strings{}
}

func (p *Strings) InitDefault() {
}

func (p *Strings) GetAdditionalProperties() (v []*NamedString) {
	return p.AdditionalProperties
}
func (p *Strings) SetAdditionalProperties(val []*NamedString) {
	p.AdditionalProperties = val
}

var fieldIDToName_Strings = map[int16]string{
	1: "additional_properties",
}

func (p *Strings) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.LIST {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}
		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_Strings[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *Strings) ReadField1(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	_field := make([]*NamedString, 0, size)
	values := make([]NamedString, size)
	for i := 0; i < size; i++ {
		_elem := &values[i]
		_elem.InitDefault()

		if err := _elem.Read(iprot); err != nil {
			return err
		}

		_field = append(_field, _elem)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return err
	}
	p.AdditionalProperties = _field
	return nil
}

func (p *Strings) Write(oprot thrift.TProtocol) (err error) {

	var fieldId int16
	if err = oprot.WriteStructBegin("Strings"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *Strings) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("additional_properties", thrift.LIST, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.AdditionalProperties)); err != nil {
		return err
	}
	for _, v := range p.AdditionalProperties {
		if err := v.Write(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *Strings) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("Strings(%+v)", *p)

}

func (p *Strings) DeepEqual(ano *Strings) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.AdditionalProperties) {
		return false
	}
	return true
}

func (p *Strings) Field1DeepEqual(src []*NamedString) bool {

	if len(p.AdditionalProperties) != len(src) {
		return false
	}
	for i, v := range p.AdditionalProperties {
		_src := src[i]
		if !v.DeepEqual(_src) {
			return false
		}
	}
	return true
}

type Tag struct {
	Name                   string        `thrift:"name,1" frugal:"1,default,string" json:"name"`
	Description            string        `thrift:"description,2" frugal:"2,default,string" json:"description"`
	ExternalDocs           *ExternalDocs `thrift:"external_docs,3" frugal:"3,default,ExternalDocs" json:"external_docs"`
	SpecificationExtension []*NamedAny   `thrift:"specification_extension,4" frugal:"4,default,list<NamedAny>" json:"specification_extension"`
}

func NewTag() *Tag {
	return &Tag{}
}

func (p *Tag) InitDefault() {
}

func (p *Tag) GetName() (v string) {
	return p.Name
}

func (p *Tag) GetDescription() (v string) {
	return p.Description
}

var Tag_ExternalDocs_DEFAULT *ExternalDocs

func (p *Tag) GetExternalDocs() (v *ExternalDocs) {
	if !p.IsSetExternalDocs() {
		return Tag_ExternalDocs_DEFAULT
	}
	return p.ExternalDocs
}

func (p *Tag) GetSpecificationExtension() (v []*NamedAny) {
	return p.SpecificationExtension
}
func (p *Tag) SetName(val string) {
	p.Name = val
}
func (p *Tag) SetDescription(val string) {
	p.Description = val
}
func (p *Tag) SetExternalDocs(val *ExternalDocs) {
	p.ExternalDocs = val
}
func (p *Tag) SetSpecificationExtension(val []*NamedAny) {
	p.SpecificationExtension = val
}

var fieldIDToName_Tag = map[int16]string{
	1: "name",
	2: "description",
	3: "external_docs",
	4: "specification_extension",
}

func (p *Tag) IsSetExternalDocs() bool {
	return p.ExternalDocs != nil
}

func (p *Tag) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 2:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField2(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 3:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField3(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 4:
			if fieldTypeId == thrift.LIST {
				if err = p.ReadField4(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}
		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_Tag[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *Tag) ReadField1(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Name = _field
	return nil
}
func (p *Tag) ReadField2(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Description = _field
	return nil
}
func (p *Tag) ReadField3(iprot thrift.TProtocol) error {
	_field := NewExternalDocs()
	if err := _field.Read(iprot); err != nil {
		return err
	}
	p.ExternalDocs = _field
	return nil
}
func (p *Tag) ReadField4(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	_field := make([]*NamedAny, 0, size)
	values := make([]NamedAny, size)
	for i := 0; i < size; i++ {
		_elem := &values[i]
		_elem.InitDefault()

		if err := _elem.Read(iprot); err != nil {
			return err
		}

		_field = append(_field, _elem)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return err
	}
	p.SpecificationExtension = _field
	return nil
}

func (p *Tag) Write(oprot thrift.TProtocol) (err error) {

	var fieldId int16
	if err = oprot.WriteStructBegin("Tag"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
		if err = p.writeField2(oprot); err != nil {
			fieldId = 2
			goto WriteFieldError
		}
		if err = p.writeField3(oprot); err != nil {
			fieldId = 3
			goto WriteFieldError
		}
		if err = p.writeField4(oprot); err != nil {
			fieldId = 4
			goto WriteFieldError
		}
	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *Tag) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("name", thrift.STRING, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.Name); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *Tag) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("description", thrift.STRING, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.Description); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err)
}

func (p *Tag) writeField3(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("external_docs", thrift.STRUCT, 3); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.ExternalDocs.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err)
}

func (p *Tag) writeField4(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("specification_extension", thrift.LIST, 4); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.SpecificationExtension)); err != nil {
		return err
	}
	for _, v := range p.SpecificationExtension {
		if err := v.Write(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err)
}

func (p *Tag) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("Tag(%+v)", *p)

}

func (p *Tag) DeepEqual(ano *Tag) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.Name) {
		return false
	}
	if !p.Field2DeepEqual(ano.Description) {
		return false
	}
	if !p.Field3DeepEqual(ano.ExternalDocs) {
		return false
	}
	if !p.Field4DeepEqual(ano.SpecificationExtension) {
		return false
	}
	return true
}

func (p *Tag) Field1DeepEqual(src string) bool {

	if strings.Compare(p.Name, src) != 0 {
		return false
	}
	return true
}
func (p *Tag) Field2DeepEqual(src string) bool {

	if strings.Compare(p.Description, src) != 0 {
		return false
	}
	return true
}
func (p *Tag) Field3DeepEqual(src *ExternalDocs) bool {

	if !p.ExternalDocs.DeepEqual(src) {
		return false
	}
	return true
}
func (p *Tag) Field4DeepEqual(src []*NamedAny) bool {

	if len(p.SpecificationExtension) != len(src) {
		return false
	}
	for i, v := range p.SpecificationExtension {
		_src := src[i]
		if !v.DeepEqual(_src) {
			return false
		}
	}
	return true
}

type Xml struct {
	Name                   string      `thrift:"name,1" frugal:"1,default,string" json:"name"`
	Namespace              string      `thrift:"namespace,2" frugal:"2,default,string" json:"namespace"`
	Prefix                 string      `thrift:"prefix,3" frugal:"3,default,string" json:"prefix"`
	Attribute              bool        `thrift:"attribute,4" frugal:"4,default,bool" json:"attribute"`
	Wrapped                bool        `thrift:"wrapped,5" frugal:"5,default,bool" json:"wrapped"`
	SpecificationExtension []*NamedAny `thrift:"specification_extension,6" frugal:"6,default,list<NamedAny>" json:"specification_extension"`
}

func NewXml() *Xml {
	return &Xml{}
}

func (p *Xml) InitDefault() {
}

func (p *Xml) GetName() (v string) {
	return p.Name
}

func (p *Xml) GetNamespace() (v string) {
	return p.Namespace
}

func (p *Xml) GetPrefix() (v string) {
	return p.Prefix
}

func (p *Xml) GetAttribute() (v bool) {
	return p.Attribute
}

func (p *Xml) GetWrapped() (v bool) {
	return p.Wrapped
}

func (p *Xml) GetSpecificationExtension() (v []*NamedAny) {
	return p.SpecificationExtension
}
func (p *Xml) SetName(val string) {
	p.Name = val
}
func (p *Xml) SetNamespace(val string) {
	p.Namespace = val
}
func (p *Xml) SetPrefix(val string) {
	p.Prefix = val
}
func (p *Xml) SetAttribute(val bool) {
	p.Attribute = val
}
func (p *Xml) SetWrapped(val bool) {
	p.Wrapped = val
}
func (p *Xml) SetSpecificationExtension(val []*NamedAny) {
	p.SpecificationExtension = val
}

var fieldIDToName_Xml = map[int16]string{
	1: "name",
	2: "namespace",
	3: "prefix",
	4: "attribute",
	5: "wrapped",
	6: "specification_extension",
}

func (p *Xml) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 2:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField2(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 3:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField3(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 4:
			if fieldTypeId == thrift.BOOL {
				if err = p.ReadField4(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 5:
			if fieldTypeId == thrift.BOOL {
				if err = p.ReadField5(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		case 6:
			if fieldTypeId == thrift.LIST {
				if err = p.ReadField6(iprot); err != nil {
					goto ReadFieldError
				}
			} else if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}
		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_Xml[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *Xml) ReadField1(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Name = _field
	return nil
}
func (p *Xml) ReadField2(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Namespace = _field
	return nil
}
func (p *Xml) ReadField3(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Prefix = _field
	return nil
}
func (p *Xml) ReadField4(iprot thrift.TProtocol) error {

	var _field bool
	if v, err := iprot.ReadBool(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Attribute = _field
	return nil
}
func (p *Xml) ReadField5(iprot thrift.TProtocol) error {

	var _field bool
	if v, err := iprot.ReadBool(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Wrapped = _field
	return nil
}
func (p *Xml) ReadField6(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	_field := make([]*NamedAny, 0, size)
	values := make([]NamedAny, size)
	for i := 0; i < size; i++ {
		_elem := &values[i]
		_elem.InitDefault()

		if err := _elem.Read(iprot); err != nil {
			return err
		}

		_field = append(_field, _elem)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return err
	}
	p.SpecificationExtension = _field
	return nil
}

func (p *Xml) Write(oprot thrift.TProtocol) (err error) {

	var fieldId int16
	if err = oprot.WriteStructBegin("Xml"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
		if err = p.writeField2(oprot); err != nil {
			fieldId = 2
			goto WriteFieldError
		}
		if err = p.writeField3(oprot); err != nil {
			fieldId = 3
			goto WriteFieldError
		}
		if err = p.writeField4(oprot); err != nil {
			fieldId = 4
			goto WriteFieldError
		}
		if err = p.writeField5(oprot); err != nil {
			fieldId = 5
			goto WriteFieldError
		}
		if err = p.writeField6(oprot); err != nil {
			fieldId = 6
			goto WriteFieldError
		}
	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *Xml) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("name", thrift.STRING, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.Name); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *Xml) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("namespace", thrift.STRING, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.Namespace); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err)
}

func (p *Xml) writeField3(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("prefix", thrift.STRING, 3); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.Prefix); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err)
}

func (p *Xml) writeField4(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("attribute", thrift.BOOL, 4); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteBool(p.Attribute); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err)
}

func (p *Xml) writeField5(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("wrapped", thrift.BOOL, 5); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteBool(p.Wrapped); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err)
}

func (p *Xml) writeField6(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("specification_extension", thrift.LIST, 6); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.SpecificationExtension)); err != nil {
		return err
	}
	for _, v := range p.SpecificationExtension {
		if err := v.Write(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 6 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err)
}

func (p *Xml) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("Xml(%+v)", *p)

}

func (p *Xml) DeepEqual(ano *Xml) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.Name) {
		return false
	}
	if !p.Field2DeepEqual(ano.Namespace) {
		return false
	}
	if !p.Field3DeepEqual(ano.Prefix) {
		return false
	}
	if !p.Field4DeepEqual(ano.Attribute) {
		return false
	}
	if !p.Field5DeepEqual(ano.Wrapped) {
		return false
	}
	if !p.Field6DeepEqual(ano.SpecificationExtension) {
		return false
	}
	return true
}

func (p *Xml) Field1DeepEqual(src string) bool {

	if strings.Compare(p.Name, src) != 0 {
		return false
	}
	return true
}
func (p *Xml) Field2DeepEqual(src string) bool {

	if strings.Compare(p.Namespace, src) != 0 {
		return false
	}
	return true
}
func (p *Xml) Field3DeepEqual(src string) bool {

	if strings.Compare(p.Prefix, src) != 0 {
		return false
	}
	return true
}
func (p *Xml) Field4DeepEqual(src bool) bool {

	if p.Attribute != src {
		return false
	}
	return true
}
func (p *Xml) Field5DeepEqual(src bool) bool {

	if p.Wrapped != src {
		return false
	}
	return true
}
func (p *Xml) Field6DeepEqual(src []*NamedAny) bool {

	if len(p.SpecificationExtension) != len(src) {
		return false
	}
	for i, v := range p.SpecificationExtension {
		_src := src[i]
		if !v.DeepEqual(_src) {
			return false
		}
	}
	return true
}
