package network

import (
	"fmt"
	"github.com/apache/thrift/lib/go/thrift"
	"github.com/volcengine/vkectl/pkg/model/resource/kitex_gen/base"
	"strings"
)

const (
	ProtocolHTTP = "HTTP"

	ProtocolHTTPS = "HTTPS"

	TypeIngressNginx = "ingress-nginx"
)

type UpdateIngressRequest = CreateIngressRequest

func NewUpdateIngressRequest() *UpdateIngressRequest {
	return NewCreateIngressRequest()
}

type UpdateIngressResponse = CreateIngressResponse

func NewUpdateIngressResponse() *UpdateIngressResponse {
	return NewCreateIngressResponse()
}

type Certificate struct {
	Domains    []string `thrift:"Domains,1,required" validate:"required"`
	SecretName string   `thrift:"SecretName,2,required" validate:"required"`
}

func NewCertificate() *Certificate {
	return &Certificate{}
}

func (p *Certificate) GetDomains() (v []string) {
	return p.Domains
}

func (p *Certificate) GetSecretName() (v string) {
	return p.SecretName
}
func (p *Certificate) SetDomains(val []string) {
	p.Domains = val
}
func (p *Certificate) SetSecretName(val string) {
	p.SecretName = val
}

var fieldIDToName_Certificate = map[int16]string{
	1: "Domains",
	2: "SecretName",
}

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

	var fieldTypeId thrift.TType
	var fieldId int16
	var issetDomains bool = false
	var issetSecretName 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.LIST {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
				issetDomains = true
			} 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
				}
				issetSecretName = 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 !issetDomains {
		fieldId = 1
		goto RequiredFieldNotSetError
	}

	if !issetSecretName {
		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_Certificate[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_Certificate[fieldId]))
}

func (p *Certificate) ReadField1(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	p.Domains = 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
		}

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

func (p *Certificate) ReadField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.SecretName = v
	}
	return nil
}

func (p *Certificate) Write(oprot thrift.TProtocol) (err error) {
	var fieldId int16
	if err = oprot.WriteStructBegin("Certificate"); 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 *Certificate) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("Domains", thrift.LIST, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRING, len(p.Domains)); err != nil {
		return err
	}
	for _, v := range p.Domains {
		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 *Certificate) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("SecretName", thrift.STRING, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.SecretName); 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 *Certificate) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("Certificate(%+v)", *p)
}

func (p *Certificate) DeepEqual(ano *Certificate) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.Domains) {
		return false
	}
	if !p.Field2DeepEqual(ano.SecretName) {
		return false
	}
	return true
}

func (p *Certificate) Field1DeepEqual(src []string) bool {

	if len(p.Domains) != len(src) {
		return false
	}
	for i, v := range p.Domains {
		_src := src[i]
		if strings.Compare(v, _src) != 0 {
			return false
		}
	}
	return true
}
func (p *Certificate) Field2DeepEqual(src string) bool {

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

type IngressListener struct {
	ProtocolType string         `thrift:"ProtocolType,1,required" validate:"required,oneof=HTTP HTTPS"`
	Certificates []*Certificate `thrift:"Certificates,2" json:"Certificates,omitempty"`
}

func NewIngressListener() *IngressListener {
	return &IngressListener{}
}

func (p *IngressListener) GetProtocolType() (v string) {
	return p.ProtocolType
}

var IngressListener_Certificates_DEFAULT []*Certificate

func (p *IngressListener) GetCertificates() (v []*Certificate) {
	if !p.IsSetCertificates() {
		return IngressListener_Certificates_DEFAULT
	}
	return p.Certificates
}
func (p *IngressListener) SetProtocolType(val string) {
	p.ProtocolType = val
}
func (p *IngressListener) SetCertificates(val []*Certificate) {
	p.Certificates = val
}

var fieldIDToName_IngressListener = map[int16]string{
	1: "ProtocolType",
	2: "Certificates",
}

func (p *IngressListener) IsSetCertificates() bool {
	return p.Certificates != nil
}

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

	var fieldTypeId thrift.TType
	var fieldId int16
	var issetProtocolType 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.STRING {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
				issetProtocolType = true
			} 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
	}

	if !issetProtocolType {
		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_IngressListener[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_IngressListener[fieldId]))
}

func (p *IngressListener) ReadField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.ProtocolType = v
	}
	return nil
}

func (p *IngressListener) ReadField2(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	p.Certificates = make([]*Certificate, 0, size)
	for i := 0; i < size; i++ {
		_elem := NewCertificate()
		if err := _elem.Read(iprot); err != nil {
			return err
		}

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

func (p *IngressListener) Write(oprot thrift.TProtocol) (err error) {
	var fieldId int16
	if err = oprot.WriteStructBegin("IngressListener"); 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 *IngressListener) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("ProtocolType", thrift.STRING, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.ProtocolType); 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 *IngressListener) writeField2(oprot thrift.TProtocol) (err error) {
	if p.IsSetCertificates() {
		if err = oprot.WriteFieldBegin("Certificates", thrift.LIST, 2); err != nil {
			goto WriteFieldBeginError
		}
		if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Certificates)); err != nil {
			return err
		}
		for _, v := range p.Certificates {
			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 *IngressListener) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("IngressListener(%+v)", *p)
}

func (p *IngressListener) DeepEqual(ano *IngressListener) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.ProtocolType) {
		return false
	}
	if !p.Field2DeepEqual(ano.Certificates) {
		return false
	}
	return true
}

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

	if strings.Compare(p.ProtocolType, src) != 0 {
		return false
	}
	return true
}
func (p *IngressListener) Field2DeepEqual(src []*Certificate) bool {

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

type RulePath struct {
	Path        string `thrift:"Path,1,required" validate:"required"`
	ServiceName string `thrift:"ServiceName,2,required" validate:"required"`
	ServicePort int32  `thrift:"ServicePort,3,required" validate:"required"`
	PathType    string `thrift:"PathType,4" json:"PathType,omitempty"`
}

func NewRulePath() *RulePath {
	return &RulePath{

		PathType: "Exact",
	}
}

func (p *RulePath) GetPath() (v string) {
	return p.Path
}

func (p *RulePath) GetServiceName() (v string) {
	return p.ServiceName
}

func (p *RulePath) GetServicePort() (v int32) {
	return p.ServicePort
}

var RulePath_PathType_DEFAULT string = "Exact"

func (p *RulePath) GetPathType() (v string) {
	if !p.IsSetPathType() {
		return RulePath_PathType_DEFAULT
	}
	return p.PathType
}
func (p *RulePath) SetPath(val string) {
	p.Path = val
}
func (p *RulePath) SetServiceName(val string) {
	p.ServiceName = val
}
func (p *RulePath) SetServicePort(val int32) {
	p.ServicePort = val
}
func (p *RulePath) SetPathType(val string) {
	p.PathType = val
}

var fieldIDToName_RulePath = map[int16]string{
	1: "Path",
	2: "ServiceName",
	3: "ServicePort",
	4: "PathType",
}

func (p *RulePath) IsSetPathType() bool {
	return p.PathType != RulePath_PathType_DEFAULT
}

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

	var fieldTypeId thrift.TType
	var fieldId int16
	var issetPath bool = false
	var issetServiceName bool = false
	var issetServicePort 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.STRING {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
				issetPath = true
			} 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
				}
				issetServiceName = true
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		case 3:
			if fieldTypeId == thrift.I32 {
				if err = p.ReadField3(iprot); err != nil {
					goto ReadFieldError
				}
				issetServicePort = true
			} 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
				}
			}
		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 !issetPath {
		fieldId = 1
		goto RequiredFieldNotSetError
	}

	if !issetServiceName {
		fieldId = 2
		goto RequiredFieldNotSetError
	}

	if !issetServicePort {
		fieldId = 3
		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_RulePath[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_RulePath[fieldId]))
}

func (p *RulePath) ReadField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.Path = v
	}
	return nil
}

func (p *RulePath) ReadField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.ServiceName = v
	}
	return nil
}

func (p *RulePath) ReadField3(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return err
	} else {
		p.ServicePort = v
	}
	return nil
}

func (p *RulePath) ReadField4(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.PathType = v
	}
	return nil
}

func (p *RulePath) Write(oprot thrift.TProtocol) (err error) {
	var fieldId int16
	if err = oprot.WriteStructBegin("RulePath"); 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 *RulePath) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("Path", thrift.STRING, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.Path); 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 *RulePath) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("ServiceName", thrift.STRING, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.ServiceName); 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 *RulePath) writeField3(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("ServicePort", thrift.I32, 3); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteI32(p.ServicePort); 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 *RulePath) writeField4(oprot thrift.TProtocol) (err error) {
	if p.IsSetPathType() {
		if err = oprot.WriteFieldBegin("PathType", thrift.STRING, 4); err != nil {
			goto WriteFieldBeginError
		}
		if err := oprot.WriteString(p.PathType); 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 *RulePath) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("RulePath(%+v)", *p)
}

func (p *RulePath) DeepEqual(ano *RulePath) 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.ServiceName) {
		return false
	}
	if !p.Field3DeepEqual(ano.ServicePort) {
		return false
	}
	if !p.Field4DeepEqual(ano.PathType) {
		return false
	}
	return true
}

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

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

	if strings.Compare(p.ServiceName, src) != 0 {
		return false
	}
	return true
}
func (p *RulePath) Field3DeepEqual(src int32) bool {

	if p.ServicePort != src {
		return false
	}
	return true
}
func (p *RulePath) Field4DeepEqual(src string) bool {

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

type Rule struct {
	Domain string      `thrift:"Domain,1,required" validate:"required"`
	Paths  []*RulePath `thrift:"Paths,2,required" validate:"required"`
}

func NewRule() *Rule {
	return &Rule{}
}

func (p *Rule) GetDomain() (v string) {
	return p.Domain
}

func (p *Rule) GetPaths() (v []*RulePath) {
	return p.Paths
}
func (p *Rule) SetDomain(val string) {
	p.Domain = val
}
func (p *Rule) SetPaths(val []*RulePath) {
	p.Paths = val
}

var fieldIDToName_Rule = map[int16]string{
	1: "Domain",
	2: "Paths",
}

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

	var fieldTypeId thrift.TType
	var fieldId int16
	var issetDomain bool = false
	var issetPaths 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.STRING {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
				issetDomain = true
			} 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
				}
				issetPaths = 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 !issetDomain {
		fieldId = 1
		goto RequiredFieldNotSetError
	}

	if !issetPaths {
		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_Rule[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_Rule[fieldId]))
}

func (p *Rule) ReadField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.Domain = v
	}
	return nil
}

func (p *Rule) ReadField2(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	p.Paths = make([]*RulePath, 0, size)
	for i := 0; i < size; i++ {
		_elem := NewRulePath()
		if err := _elem.Read(iprot); err != nil {
			return err
		}

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

func (p *Rule) Write(oprot thrift.TProtocol) (err error) {
	var fieldId int16
	if err = oprot.WriteStructBegin("Rule"); 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 *Rule) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("Domain", thrift.STRING, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.Domain); 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 *Rule) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("Paths", thrift.LIST, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Paths)); err != nil {
		return err
	}
	for _, v := range p.Paths {
		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 *Rule) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("Rule(%+v)", *p)
}

func (p *Rule) DeepEqual(ano *Rule) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.Domain) {
		return false
	}
	if !p.Field2DeepEqual(ano.Paths) {
		return false
	}
	return true
}

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

	if strings.Compare(p.Domain, src) != 0 {
		return false
	}
	return true
}
func (p *Rule) Field2DeepEqual(src []*RulePath) bool {

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

type BackendService struct {
	Domain      *string `thrift:"Domain,1" json:"Domain,omitempty"`
	ServiceName string  `thrift:"ServiceName,2,required" validate:"required"`
	ServicePort int32   `thrift:"ServicePort,3,required" validate:"required"`
}

func NewBackendService() *BackendService {
	return &BackendService{}
}

var BackendService_Domain_DEFAULT string

func (p *BackendService) GetDomain() (v string) {
	if !p.IsSetDomain() {
		return BackendService_Domain_DEFAULT
	}
	return *p.Domain
}

func (p *BackendService) GetServiceName() (v string) {
	return p.ServiceName
}

func (p *BackendService) GetServicePort() (v int32) {
	return p.ServicePort
}
func (p *BackendService) SetDomain(val *string) {
	p.Domain = val
}
func (p *BackendService) SetServiceName(val string) {
	p.ServiceName = val
}
func (p *BackendService) SetServicePort(val int32) {
	p.ServicePort = val
}

var fieldIDToName_BackendService = map[int16]string{
	1: "Domain",
	2: "ServiceName",
	3: "ServicePort",
}

func (p *BackendService) IsSetDomain() bool {
	return p.Domain != nil
}

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

	var fieldTypeId thrift.TType
	var fieldId int16
	var issetServiceName bool = false
	var issetServicePort 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.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
				}
				issetServiceName = true
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		case 3:
			if fieldTypeId == thrift.I32 {
				if err = p.ReadField3(iprot); err != nil {
					goto ReadFieldError
				}
				issetServicePort = 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 !issetServiceName {
		fieldId = 2
		goto RequiredFieldNotSetError
	}

	if !issetServicePort {
		fieldId = 3
		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_BackendService[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_BackendService[fieldId]))
}

func (p *BackendService) ReadField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.Domain = &v
	}
	return nil
}

func (p *BackendService) ReadField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.ServiceName = v
	}
	return nil
}

func (p *BackendService) ReadField3(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return err
	} else {
		p.ServicePort = v
	}
	return nil
}

func (p *BackendService) Write(oprot thrift.TProtocol) (err error) {
	var fieldId int16
	if err = oprot.WriteStructBegin("BackendService"); 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 *BackendService) writeField1(oprot thrift.TProtocol) (err error) {
	if p.IsSetDomain() {
		if err = oprot.WriteFieldBegin("Domain", thrift.STRING, 1); err != nil {
			goto WriteFieldBeginError
		}
		if err := oprot.WriteString(*p.Domain); 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 *BackendService) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("ServiceName", thrift.STRING, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.ServiceName); 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 *BackendService) writeField3(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("ServicePort", thrift.I32, 3); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteI32(p.ServicePort); 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 *BackendService) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("BackendService(%+v)", *p)
}

func (p *BackendService) DeepEqual(ano *BackendService) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.Domain) {
		return false
	}
	if !p.Field2DeepEqual(ano.ServiceName) {
		return false
	}
	if !p.Field3DeepEqual(ano.ServicePort) {
		return false
	}
	return true
}

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

	if p.Domain == src {
		return true
	} else if p.Domain == nil || src == nil {
		return false
	}
	if strings.Compare(*p.Domain, *src) != 0 {
		return false
	}
	return true
}
func (p *BackendService) Field2DeepEqual(src string) bool {

	if strings.Compare(p.ServiceName, src) != 0 {
		return false
	}
	return true
}
func (p *BackendService) Field3DeepEqual(src int32) bool {

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

type ListIngressRequest struct {
	ClusterId string              `thrift:"ClusterId,1,required" validate:"required"`
	Start     int32               `thrift:"Start,2" validate:"gte=0"`
	Limit     int32               `thrift:"Limit,3" json:"Limit,omitempty"`
	Filters   map[string][]string `thrift:"Filters,4" json:"Filters,omitempty"`
	Top       *base.TopParam      `thrift:"Top,254,required" json:"Top"`
	Base      *base.Base          `thrift:"Base,255" json:"Base,omitempty"`
}

func NewListIngressRequest() *ListIngressRequest {
	return &ListIngressRequest{

		Start: 0,
		Limit: 10,
	}
}

func (p *ListIngressRequest) GetClusterId() (v string) {
	return p.ClusterId
}

var ListIngressRequest_Start_DEFAULT int32 = 0

func (p *ListIngressRequest) GetStart() (v int32) {
	if !p.IsSetStart() {
		return ListIngressRequest_Start_DEFAULT
	}
	return p.Start
}

var ListIngressRequest_Limit_DEFAULT int32 = 10

func (p *ListIngressRequest) GetLimit() (v int32) {
	if !p.IsSetLimit() {
		return ListIngressRequest_Limit_DEFAULT
	}
	return p.Limit
}

var ListIngressRequest_Filters_DEFAULT map[string][]string

func (p *ListIngressRequest) GetFilters() (v map[string][]string) {
	if !p.IsSetFilters() {
		return ListIngressRequest_Filters_DEFAULT
	}
	return p.Filters
}

var ListIngressRequest_Top_DEFAULT *base.TopParam

func (p *ListIngressRequest) GetTop() (v *base.TopParam) {
	if !p.IsSetTop() {
		return ListIngressRequest_Top_DEFAULT
	}
	return p.Top
}

var ListIngressRequest_Base_DEFAULT *base.Base

func (p *ListIngressRequest) GetBase() (v *base.Base) {
	if !p.IsSetBase() {
		return ListIngressRequest_Base_DEFAULT
	}
	return p.Base
}
func (p *ListIngressRequest) SetClusterId(val string) {
	p.ClusterId = val
}
func (p *ListIngressRequest) SetStart(val int32) {
	p.Start = val
}
func (p *ListIngressRequest) SetLimit(val int32) {
	p.Limit = val
}
func (p *ListIngressRequest) SetFilters(val map[string][]string) {
	p.Filters = val
}
func (p *ListIngressRequest) SetTop(val *base.TopParam) {
	p.Top = val
}
func (p *ListIngressRequest) SetBase(val *base.Base) {
	p.Base = val
}

var fieldIDToName_ListIngressRequest = map[int16]string{
	1:   "ClusterId",
	2:   "Start",
	3:   "Limit",
	4:   "Filters",
	254: "Top",
	255: "Base",
}

func (p *ListIngressRequest) IsSetStart() bool {
	return p.Start != ListIngressRequest_Start_DEFAULT
}

func (p *ListIngressRequest) IsSetLimit() bool {
	return p.Limit != ListIngressRequest_Limit_DEFAULT
}

func (p *ListIngressRequest) IsSetFilters() bool {
	return p.Filters != nil
}

func (p *ListIngressRequest) IsSetTop() bool {
	return p.Top != nil
}

func (p *ListIngressRequest) IsSetBase() bool {
	return p.Base != nil
}

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

	var fieldTypeId thrift.TType
	var fieldId int16
	var issetClusterId bool = false
	var issetTop 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.STRING {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
				issetClusterId = true
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		case 2:
			if fieldTypeId == thrift.I32 {
				if err = p.ReadField2(iprot); err != nil {
					goto ReadFieldError
				}
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		case 3:
			if fieldTypeId == thrift.I32 {
				if err = p.ReadField3(iprot); err != nil {
					goto ReadFieldError
				}
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		case 4:
			if fieldTypeId == thrift.MAP {
				if err = p.ReadField4(iprot); err != nil {
					goto ReadFieldError
				}
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		case 254:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField254(iprot); err != nil {
					goto ReadFieldError
				}
				issetTop = true
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		case 255:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField255(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
	}

	if !issetClusterId {
		fieldId = 1
		goto RequiredFieldNotSetError
	}

	if !issetTop {
		fieldId = 254
		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_ListIngressRequest[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_ListIngressRequest[fieldId]))
}

func (p *ListIngressRequest) ReadField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.ClusterId = v
	}
	return nil
}

func (p *ListIngressRequest) ReadField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return err
	} else {
		p.Start = v
	}
	return nil
}

func (p *ListIngressRequest) ReadField3(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return err
	} else {
		p.Limit = v
	}
	return nil
}

func (p *ListIngressRequest) ReadField4(iprot thrift.TProtocol) error {
	_, _, size, err := iprot.ReadMapBegin()
	if err != nil {
		return err
	}
	p.Filters = make(map[string][]string, size)
	for i := 0; i < size; i++ {
		var _key string
		if v, err := iprot.ReadString(); err != nil {
			return err
		} else {
			_key = v
		}

		_, size, err := iprot.ReadListBegin()
		if err != nil {
			return err
		}
		_val := 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
			}

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

		p.Filters[_key] = _val
	}
	if err := iprot.ReadMapEnd(); err != nil {
		return err
	}
	return nil
}

func (p *ListIngressRequest) ReadField254(iprot thrift.TProtocol) error {
	p.Top = base.NewTopParam()
	if err := p.Top.Read(iprot); err != nil {
		return err
	}
	return nil
}

func (p *ListIngressRequest) ReadField255(iprot thrift.TProtocol) error {
	p.Base = base.NewBase()
	if err := p.Base.Read(iprot); err != nil {
		return err
	}
	return nil
}

func (p *ListIngressRequest) Write(oprot thrift.TProtocol) (err error) {
	var fieldId int16
	if err = oprot.WriteStructBegin("ListIngressRequest"); 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.writeField254(oprot); err != nil {
			fieldId = 254
			goto WriteFieldError
		}
		if err = p.writeField255(oprot); err != nil {
			fieldId = 255
			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 *ListIngressRequest) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("ClusterId", thrift.STRING, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.ClusterId); 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 *ListIngressRequest) writeField2(oprot thrift.TProtocol) (err error) {
	if p.IsSetStart() {
		if err = oprot.WriteFieldBegin("Start", thrift.I32, 2); err != nil {
			goto WriteFieldBeginError
		}
		if err := oprot.WriteI32(p.Start); 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 *ListIngressRequest) writeField3(oprot thrift.TProtocol) (err error) {
	if p.IsSetLimit() {
		if err = oprot.WriteFieldBegin("Limit", thrift.I32, 3); err != nil {
			goto WriteFieldBeginError
		}
		if err := oprot.WriteI32(p.Limit); 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 *ListIngressRequest) writeField4(oprot thrift.TProtocol) (err error) {
	if p.IsSetFilters() {
		if err = oprot.WriteFieldBegin("Filters", thrift.MAP, 4); err != nil {
			goto WriteFieldBeginError
		}
		if err := oprot.WriteMapBegin(thrift.STRING, thrift.LIST, len(p.Filters)); err != nil {
			return err
		}
		for k, v := range p.Filters {

			if err := oprot.WriteString(k); err != nil {
				return err
			}

			if err := oprot.WriteListBegin(thrift.STRING, len(v)); err != nil {
				return err
			}
			for _, v := range v {
				if err := oprot.WriteString(v); err != nil {
					return err
				}
			}
			if err := oprot.WriteListEnd(); err != nil {
				return err
			}
		}
		if err := oprot.WriteMapEnd(); 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 *ListIngressRequest) writeField254(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("Top", thrift.STRUCT, 254); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Top.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 254 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 254 end error: ", p), err)
}

func (p *ListIngressRequest) writeField255(oprot thrift.TProtocol) (err error) {
	if p.IsSetBase() {
		if err = oprot.WriteFieldBegin("Base", thrift.STRUCT, 255); err != nil {
			goto WriteFieldBeginError
		}
		if err := p.Base.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 255 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err)
}

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

func (p *ListIngressRequest) DeepEqual(ano *ListIngressRequest) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.ClusterId) {
		return false
	}
	if !p.Field2DeepEqual(ano.Start) {
		return false
	}
	if !p.Field3DeepEqual(ano.Limit) {
		return false
	}
	if !p.Field4DeepEqual(ano.Filters) {
		return false
	}
	if !p.Field254DeepEqual(ano.Top) {
		return false
	}
	if !p.Field255DeepEqual(ano.Base) {
		return false
	}
	return true
}

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

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

	if p.Start != src {
		return false
	}
	return true
}
func (p *ListIngressRequest) Field3DeepEqual(src int32) bool {

	if p.Limit != src {
		return false
	}
	return true
}
func (p *ListIngressRequest) Field4DeepEqual(src map[string][]string) bool {

	if len(p.Filters) != len(src) {
		return false
	}
	for k, v := range p.Filters {
		_src := src[k]
		if len(v) != len(_src) {
			return false
		}
		for i, v := range v {
			_src1 := _src[i]
			if strings.Compare(v, _src1) != 0 {
				return false
			}
		}
	}
	return true
}
func (p *ListIngressRequest) Field254DeepEqual(src *base.TopParam) bool {

	if !p.Top.DeepEqual(src) {
		return false
	}
	return true
}
func (p *ListIngressRequest) Field255DeepEqual(src *base.Base) bool {

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

type IngressItem struct {
	Name            string             `thrift:"Name,1,required" validate:"required"`
	Namespace       string             `thrift:"Namespace,2,required" json:"Namespace"`
	Type            string             `thrift:"Type,3,required" validate:"required,eq=ingress-nginx"`
	Vip             string             `thrift:"Vip,4,required" validate:"required"`
	Listeners       []*IngressListener `thrift:"Listeners,5,required" validate:"required"`
	BacekendService []*BackendService  `thrift:"BacekendService,6,required" validate:"required"`
	CreateTime      string             `thrift:"CreateTime,7,required" json:"CreateTime"`
}

func NewIngressItem() *IngressItem {
	return &IngressItem{}
}

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

func (p *IngressItem) GetNamespace() (v string) {
	return p.Namespace
}

func (p *IngressItem) GetType() (v string) {
	return p.Type
}

func (p *IngressItem) GetVip() (v string) {
	return p.Vip
}

func (p *IngressItem) GetListeners() (v []*IngressListener) {
	return p.Listeners
}

func (p *IngressItem) GetBacekendService() (v []*BackendService) {
	return p.BacekendService
}

func (p *IngressItem) GetCreateTime() (v string) {
	return p.CreateTime
}
func (p *IngressItem) SetName(val string) {
	p.Name = val
}
func (p *IngressItem) SetNamespace(val string) {
	p.Namespace = val
}
func (p *IngressItem) SetType(val string) {
	p.Type = val
}
func (p *IngressItem) SetVip(val string) {
	p.Vip = val
}
func (p *IngressItem) SetListeners(val []*IngressListener) {
	p.Listeners = val
}
func (p *IngressItem) SetBacekendService(val []*BackendService) {
	p.BacekendService = val
}
func (p *IngressItem) SetCreateTime(val string) {
	p.CreateTime = val
}

var fieldIDToName_IngressItem = map[int16]string{
	1: "Name",
	2: "Namespace",
	3: "Type",
	4: "Vip",
	5: "Listeners",
	6: "BacekendService",
	7: "CreateTime",
}

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

	var fieldTypeId thrift.TType
	var fieldId int16
	var issetName bool = false
	var issetNamespace bool = false
	var issetType bool = false
	var issetVip bool = false
	var issetListeners bool = false
	var issetBacekendService bool = false
	var issetCreateTime 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.STRING {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
				issetName = true
			} 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
				}
				issetNamespace = true
			} 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
				}
				issetType = true
			} 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
				}
				issetVip = true
			} 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
				}
				issetListeners = true
			} 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
				}
				issetBacekendService = true
			} 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
				}
				issetCreateTime = 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 !issetName {
		fieldId = 1
		goto RequiredFieldNotSetError
	}

	if !issetNamespace {
		fieldId = 2
		goto RequiredFieldNotSetError
	}

	if !issetType {
		fieldId = 3
		goto RequiredFieldNotSetError
	}

	if !issetVip {
		fieldId = 4
		goto RequiredFieldNotSetError
	}

	if !issetListeners {
		fieldId = 5
		goto RequiredFieldNotSetError
	}

	if !issetBacekendService {
		fieldId = 6
		goto RequiredFieldNotSetError
	}

	if !issetCreateTime {
		fieldId = 7
		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_IngressItem[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_IngressItem[fieldId]))
}

func (p *IngressItem) ReadField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.Name = v
	}
	return nil
}

func (p *IngressItem) ReadField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.Namespace = v
	}
	return nil
}

func (p *IngressItem) ReadField3(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.Type = v
	}
	return nil
}

func (p *IngressItem) ReadField4(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.Vip = v
	}
	return nil
}

func (p *IngressItem) ReadField5(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	p.Listeners = make([]*IngressListener, 0, size)
	for i := 0; i < size; i++ {
		_elem := NewIngressListener()
		if err := _elem.Read(iprot); err != nil {
			return err
		}

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

func (p *IngressItem) ReadField6(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	p.BacekendService = make([]*BackendService, 0, size)
	for i := 0; i < size; i++ {
		_elem := NewBackendService()
		if err := _elem.Read(iprot); err != nil {
			return err
		}

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

func (p *IngressItem) ReadField7(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.CreateTime = v
	}
	return nil
}

func (p *IngressItem) Write(oprot thrift.TProtocol) (err error) {
	var fieldId int16
	if err = oprot.WriteStructBegin("IngressItem"); 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 *IngressItem) 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 *IngressItem) 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 *IngressItem) writeField3(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("Type", thrift.STRING, 3); 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 3 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err)
}

func (p *IngressItem) writeField4(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("Vip", thrift.STRING, 4); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.Vip); 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 *IngressItem) writeField5(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("Listeners", thrift.LIST, 5); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Listeners)); err != nil {
		return err
	}
	for _, v := range p.Listeners {
		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 *IngressItem) writeField6(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("BacekendService", thrift.LIST, 6); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.BacekendService)); err != nil {
		return err
	}
	for _, v := range p.BacekendService {
		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 *IngressItem) writeField7(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("CreateTime", thrift.STRING, 7); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.CreateTime); 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 *IngressItem) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("IngressItem(%+v)", *p)
}

func (p *IngressItem) DeepEqual(ano *IngressItem) 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.Type) {
		return false
	}
	if !p.Field4DeepEqual(ano.Vip) {
		return false
	}
	if !p.Field5DeepEqual(ano.Listeners) {
		return false
	}
	if !p.Field6DeepEqual(ano.BacekendService) {
		return false
	}
	if !p.Field7DeepEqual(ano.CreateTime) {
		return false
	}
	return true
}

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

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

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

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

	if strings.Compare(p.Vip, src) != 0 {
		return false
	}
	return true
}
func (p *IngressItem) Field5DeepEqual(src []*IngressListener) bool {

	if len(p.Listeners) != len(src) {
		return false
	}
	for i, v := range p.Listeners {
		_src := src[i]
		if !v.DeepEqual(_src) {
			return false
		}
	}
	return true
}
func (p *IngressItem) Field6DeepEqual(src []*BackendService) bool {

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

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

type ListIngressResponse struct {
	Items []*IngressItem `thrift:"Items,1,required" json:"Items"`
	Total int32          `thrift:"Total,2,required" json:"Total"`
	Base  *base.Base     `thrift:"Base,255" json:"Base,omitempty"`
}

func NewListIngressResponse() *ListIngressResponse {
	return &ListIngressResponse{}
}

func (p *ListIngressResponse) GetItems() (v []*IngressItem) {
	return p.Items
}

func (p *ListIngressResponse) GetTotal() (v int32) {
	return p.Total
}

var ListIngressResponse_Base_DEFAULT *base.Base

func (p *ListIngressResponse) GetBase() (v *base.Base) {
	if !p.IsSetBase() {
		return ListIngressResponse_Base_DEFAULT
	}
	return p.Base
}
func (p *ListIngressResponse) SetItems(val []*IngressItem) {
	p.Items = val
}
func (p *ListIngressResponse) SetTotal(val int32) {
	p.Total = val
}
func (p *ListIngressResponse) SetBase(val *base.Base) {
	p.Base = val
}

var fieldIDToName_ListIngressResponse = map[int16]string{
	1:   "Items",
	2:   "Total",
	255: "Base",
}

func (p *ListIngressResponse) IsSetBase() bool {
	return p.Base != nil
}

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

	var fieldTypeId thrift.TType
	var fieldId int16
	var issetItems bool = false
	var issetTotal 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.LIST {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
				issetItems = true
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		case 2:
			if fieldTypeId == thrift.I32 {
				if err = p.ReadField2(iprot); err != nil {
					goto ReadFieldError
				}
				issetTotal = true
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		case 255:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField255(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
	}

	if !issetItems {
		fieldId = 1
		goto RequiredFieldNotSetError
	}

	if !issetTotal {
		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_ListIngressResponse[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_ListIngressResponse[fieldId]))
}

func (p *ListIngressResponse) ReadField1(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	p.Items = make([]*IngressItem, 0, size)
	for i := 0; i < size; i++ {
		_elem := NewIngressItem()
		if err := _elem.Read(iprot); err != nil {
			return err
		}

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

func (p *ListIngressResponse) ReadField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return err
	} else {
		p.Total = v
	}
	return nil
}

func (p *ListIngressResponse) ReadField255(iprot thrift.TProtocol) error {
	p.Base = base.NewBase()
	if err := p.Base.Read(iprot); err != nil {
		return err
	}
	return nil
}

func (p *ListIngressResponse) Write(oprot thrift.TProtocol) (err error) {
	var fieldId int16
	if err = oprot.WriteStructBegin("ListIngressResponse"); 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.writeField255(oprot); err != nil {
			fieldId = 255
			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 *ListIngressResponse) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("Items", thrift.LIST, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Items)); err != nil {
		return err
	}
	for _, v := range p.Items {
		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 *ListIngressResponse) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("Total", thrift.I32, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteI32(p.Total); 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 *ListIngressResponse) writeField255(oprot thrift.TProtocol) (err error) {
	if p.IsSetBase() {
		if err = oprot.WriteFieldBegin("Base", thrift.STRUCT, 255); err != nil {
			goto WriteFieldBeginError
		}
		if err := p.Base.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 255 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err)
}

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

func (p *ListIngressResponse) DeepEqual(ano *ListIngressResponse) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.Items) {
		return false
	}
	if !p.Field2DeepEqual(ano.Total) {
		return false
	}
	if !p.Field255DeepEqual(ano.Base) {
		return false
	}
	return true
}

func (p *ListIngressResponse) Field1DeepEqual(src []*IngressItem) bool {

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

	if p.Total != src {
		return false
	}
	return true
}
func (p *ListIngressResponse) Field255DeepEqual(src *base.Base) bool {

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

type ListIngressTypeRequest struct {
	Top  *base.TopParam `thrift:"Top,254,required" json:"Top"`
	Base *base.Base     `thrift:"Base,255" json:"Base,omitempty"`
}

func NewListIngressTypeRequest() *ListIngressTypeRequest {
	return &ListIngressTypeRequest{}
}

var ListIngressTypeRequest_Top_DEFAULT *base.TopParam

func (p *ListIngressTypeRequest) GetTop() (v *base.TopParam) {
	if !p.IsSetTop() {
		return ListIngressTypeRequest_Top_DEFAULT
	}
	return p.Top
}

var ListIngressTypeRequest_Base_DEFAULT *base.Base

func (p *ListIngressTypeRequest) GetBase() (v *base.Base) {
	if !p.IsSetBase() {
		return ListIngressTypeRequest_Base_DEFAULT
	}
	return p.Base
}
func (p *ListIngressTypeRequest) SetTop(val *base.TopParam) {
	p.Top = val
}
func (p *ListIngressTypeRequest) SetBase(val *base.Base) {
	p.Base = val
}

var fieldIDToName_ListIngressTypeRequest = map[int16]string{
	254: "Top",
	255: "Base",
}

func (p *ListIngressTypeRequest) IsSetTop() bool {
	return p.Top != nil
}

func (p *ListIngressTypeRequest) IsSetBase() bool {
	return p.Base != nil
}

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

	var fieldTypeId thrift.TType
	var fieldId int16
	var issetTop 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 254:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField254(iprot); err != nil {
					goto ReadFieldError
				}
				issetTop = true
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		case 255:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField255(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
	}

	if !issetTop {
		fieldId = 254
		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_ListIngressTypeRequest[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_ListIngressTypeRequest[fieldId]))
}

func (p *ListIngressTypeRequest) ReadField254(iprot thrift.TProtocol) error {
	p.Top = base.NewTopParam()
	if err := p.Top.Read(iprot); err != nil {
		return err
	}
	return nil
}

func (p *ListIngressTypeRequest) ReadField255(iprot thrift.TProtocol) error {
	p.Base = base.NewBase()
	if err := p.Base.Read(iprot); err != nil {
		return err
	}
	return nil
}

func (p *ListIngressTypeRequest) Write(oprot thrift.TProtocol) (err error) {
	var fieldId int16
	if err = oprot.WriteStructBegin("ListIngressTypeRequest"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField254(oprot); err != nil {
			fieldId = 254
			goto WriteFieldError
		}
		if err = p.writeField255(oprot); err != nil {
			fieldId = 255
			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 *ListIngressTypeRequest) writeField254(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("Top", thrift.STRUCT, 254); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Top.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 254 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 254 end error: ", p), err)
}

func (p *ListIngressTypeRequest) writeField255(oprot thrift.TProtocol) (err error) {
	if p.IsSetBase() {
		if err = oprot.WriteFieldBegin("Base", thrift.STRUCT, 255); err != nil {
			goto WriteFieldBeginError
		}
		if err := p.Base.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 255 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err)
}

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

func (p *ListIngressTypeRequest) DeepEqual(ano *ListIngressTypeRequest) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field254DeepEqual(ano.Top) {
		return false
	}
	if !p.Field255DeepEqual(ano.Base) {
		return false
	}
	return true
}

func (p *ListIngressTypeRequest) Field254DeepEqual(src *base.TopParam) bool {

	if !p.Top.DeepEqual(src) {
		return false
	}
	return true
}
func (p *ListIngressTypeRequest) Field255DeepEqual(src *base.Base) bool {

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

type ListIngressTypeResponse struct {
	Items []string   `thrift:"Items,1,required" json:"Items"`
	Base  *base.Base `thrift:"Base,255" json:"Base,omitempty"`
}

func NewListIngressTypeResponse() *ListIngressTypeResponse {
	return &ListIngressTypeResponse{}
}

func (p *ListIngressTypeResponse) GetItems() (v []string) {
	return p.Items
}

var ListIngressTypeResponse_Base_DEFAULT *base.Base

func (p *ListIngressTypeResponse) GetBase() (v *base.Base) {
	if !p.IsSetBase() {
		return ListIngressTypeResponse_Base_DEFAULT
	}
	return p.Base
}
func (p *ListIngressTypeResponse) SetItems(val []string) {
	p.Items = val
}
func (p *ListIngressTypeResponse) SetBase(val *base.Base) {
	p.Base = val
}

var fieldIDToName_ListIngressTypeResponse = map[int16]string{
	1:   "Items",
	255: "Base",
}

func (p *ListIngressTypeResponse) IsSetBase() bool {
	return p.Base != nil
}

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

	var fieldTypeId thrift.TType
	var fieldId int16
	var issetItems 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.LIST {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
				issetItems = true
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		case 255:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField255(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
	}

	if !issetItems {
		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_ListIngressTypeResponse[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_ListIngressTypeResponse[fieldId]))
}

func (p *ListIngressTypeResponse) ReadField1(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	p.Items = 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
		}

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

func (p *ListIngressTypeResponse) ReadField255(iprot thrift.TProtocol) error {
	p.Base = base.NewBase()
	if err := p.Base.Read(iprot); err != nil {
		return err
	}
	return nil
}

func (p *ListIngressTypeResponse) Write(oprot thrift.TProtocol) (err error) {
	var fieldId int16
	if err = oprot.WriteStructBegin("ListIngressTypeResponse"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
		if err = p.writeField255(oprot); err != nil {
			fieldId = 255
			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 *ListIngressTypeResponse) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("Items", thrift.LIST, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRING, len(p.Items)); err != nil {
		return err
	}
	for _, v := range p.Items {
		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 *ListIngressTypeResponse) writeField255(oprot thrift.TProtocol) (err error) {
	if p.IsSetBase() {
		if err = oprot.WriteFieldBegin("Base", thrift.STRUCT, 255); err != nil {
			goto WriteFieldBeginError
		}
		if err := p.Base.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 255 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err)
}

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

func (p *ListIngressTypeResponse) DeepEqual(ano *ListIngressTypeResponse) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.Items) {
		return false
	}
	if !p.Field255DeepEqual(ano.Base) {
		return false
	}
	return true
}

func (p *ListIngressTypeResponse) Field1DeepEqual(src []string) bool {

	if len(p.Items) != len(src) {
		return false
	}
	for i, v := range p.Items {
		_src := src[i]
		if strings.Compare(v, _src) != 0 {
			return false
		}
	}
	return true
}
func (p *ListIngressTypeResponse) Field255DeepEqual(src *base.Base) bool {

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

type CreateIngressRequest struct {
	ClusterId     string             `thrift:"ClusterId,1,required" validate:"required"`
	Namespace     string             `thrift:"Namespace,2,required" validate:"required"`
	Name          string             `thrift:"Name,3,required" validate:"required,k8sName"`
	Description   *string            `thrift:"Description,4" json:"Description,omitempty"`
	Type          string             `thrift:"Type,5,required" json:"Type"`
	Listeners     []*IngressListener `thrift:"Listeners,6" json:"Listeners,omitempty"`
	SessionSticky *bool              `thrift:"SessionSticky,7" json:"SessionSticky,omitempty"`
	Rules         []*Rule            `thrift:"Rules,8" json:"Rules,omitempty"`
	Top           *base.TopParam     `thrift:"Top,254,required" json:"Top"`
	Base          *base.Base         `thrift:"Base,255" json:"Base,omitempty"`
}

func NewCreateIngressRequest() *CreateIngressRequest {
	return &CreateIngressRequest{

		Type: "",
	}
}

func (p *CreateIngressRequest) GetClusterId() (v string) {
	return p.ClusterId
}

func (p *CreateIngressRequest) GetNamespace() (v string) {
	return p.Namespace
}

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

var CreateIngressRequest_Description_DEFAULT string

func (p *CreateIngressRequest) GetDescription() (v string) {
	if !p.IsSetDescription() {
		return CreateIngressRequest_Description_DEFAULT
	}
	return *p.Description
}

func (p *CreateIngressRequest) GetType() (v string) {
	return p.Type
}

var CreateIngressRequest_Listeners_DEFAULT []*IngressListener

func (p *CreateIngressRequest) GetListeners() (v []*IngressListener) {
	if !p.IsSetListeners() {
		return CreateIngressRequest_Listeners_DEFAULT
	}
	return p.Listeners
}

var CreateIngressRequest_SessionSticky_DEFAULT bool

func (p *CreateIngressRequest) GetSessionSticky() (v bool) {
	if !p.IsSetSessionSticky() {
		return CreateIngressRequest_SessionSticky_DEFAULT
	}
	return *p.SessionSticky
}

var CreateIngressRequest_Rules_DEFAULT []*Rule

func (p *CreateIngressRequest) GetRules() (v []*Rule) {
	if !p.IsSetRules() {
		return CreateIngressRequest_Rules_DEFAULT
	}
	return p.Rules
}

var CreateIngressRequest_Top_DEFAULT *base.TopParam

func (p *CreateIngressRequest) GetTop() (v *base.TopParam) {
	if !p.IsSetTop() {
		return CreateIngressRequest_Top_DEFAULT
	}
	return p.Top
}

var CreateIngressRequest_Base_DEFAULT *base.Base

func (p *CreateIngressRequest) GetBase() (v *base.Base) {
	if !p.IsSetBase() {
		return CreateIngressRequest_Base_DEFAULT
	}
	return p.Base
}
func (p *CreateIngressRequest) SetClusterId(val string) {
	p.ClusterId = val
}
func (p *CreateIngressRequest) SetNamespace(val string) {
	p.Namespace = val
}
func (p *CreateIngressRequest) SetName(val string) {
	p.Name = val
}
func (p *CreateIngressRequest) SetDescription(val *string) {
	p.Description = val
}
func (p *CreateIngressRequest) SetType(val string) {
	p.Type = val
}
func (p *CreateIngressRequest) SetListeners(val []*IngressListener) {
	p.Listeners = val
}
func (p *CreateIngressRequest) SetSessionSticky(val *bool) {
	p.SessionSticky = val
}
func (p *CreateIngressRequest) SetRules(val []*Rule) {
	p.Rules = val
}
func (p *CreateIngressRequest) SetTop(val *base.TopParam) {
	p.Top = val
}
func (p *CreateIngressRequest) SetBase(val *base.Base) {
	p.Base = val
}

var fieldIDToName_CreateIngressRequest = map[int16]string{
	1:   "ClusterId",
	2:   "Namespace",
	3:   "Name",
	4:   "Description",
	5:   "Type",
	6:   "Listeners",
	7:   "SessionSticky",
	8:   "Rules",
	254: "Top",
	255: "Base",
}

func (p *CreateIngressRequest) IsSetDescription() bool {
	return p.Description != nil
}

func (p *CreateIngressRequest) IsSetListeners() bool {
	return p.Listeners != nil
}

func (p *CreateIngressRequest) IsSetSessionSticky() bool {
	return p.SessionSticky != nil
}

func (p *CreateIngressRequest) IsSetRules() bool {
	return p.Rules != nil
}

func (p *CreateIngressRequest) IsSetTop() bool {
	return p.Top != nil
}

func (p *CreateIngressRequest) IsSetBase() bool {
	return p.Base != nil
}

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

	var fieldTypeId thrift.TType
	var fieldId int16
	var issetClusterId bool = false
	var issetNamespace bool = false
	var issetName bool = false
	var issetType bool = false
	var issetTop 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.STRING {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
				issetClusterId = true
			} 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
				}
				issetNamespace = true
			} 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
				}
				issetName = true
			} 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
				}
				issetType = true
			} 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.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.LIST {
				if err = p.ReadField8(iprot); err != nil {
					goto ReadFieldError
				}
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		case 254:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField254(iprot); err != nil {
					goto ReadFieldError
				}
				issetTop = true
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		case 255:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField255(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
	}

	if !issetClusterId {
		fieldId = 1
		goto RequiredFieldNotSetError
	}

	if !issetNamespace {
		fieldId = 2
		goto RequiredFieldNotSetError
	}

	if !issetName {
		fieldId = 3
		goto RequiredFieldNotSetError
	}

	if !issetType {
		fieldId = 5
		goto RequiredFieldNotSetError
	}

	if !issetTop {
		fieldId = 254
		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_CreateIngressRequest[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_CreateIngressRequest[fieldId]))
}

func (p *CreateIngressRequest) ReadField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.ClusterId = v
	}
	return nil
}

func (p *CreateIngressRequest) ReadField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.Namespace = v
	}
	return nil
}

func (p *CreateIngressRequest) ReadField3(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.Name = v
	}
	return nil
}

func (p *CreateIngressRequest) ReadField4(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.Description = &v
	}
	return nil
}

func (p *CreateIngressRequest) ReadField5(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.Type = v
	}
	return nil
}

func (p *CreateIngressRequest) ReadField6(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	p.Listeners = make([]*IngressListener, 0, size)
	for i := 0; i < size; i++ {
		_elem := NewIngressListener()
		if err := _elem.Read(iprot); err != nil {
			return err
		}

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

func (p *CreateIngressRequest) ReadField7(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadBool(); err != nil {
		return err
	} else {
		p.SessionSticky = &v
	}
	return nil
}

func (p *CreateIngressRequest) ReadField8(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	p.Rules = make([]*Rule, 0, size)
	for i := 0; i < size; i++ {
		_elem := NewRule()
		if err := _elem.Read(iprot); err != nil {
			return err
		}

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

func (p *CreateIngressRequest) ReadField254(iprot thrift.TProtocol) error {
	p.Top = base.NewTopParam()
	if err := p.Top.Read(iprot); err != nil {
		return err
	}
	return nil
}

func (p *CreateIngressRequest) ReadField255(iprot thrift.TProtocol) error {
	p.Base = base.NewBase()
	if err := p.Base.Read(iprot); err != nil {
		return err
	}
	return nil
}

func (p *CreateIngressRequest) Write(oprot thrift.TProtocol) (err error) {
	var fieldId int16
	if err = oprot.WriteStructBegin("CreateIngressRequest"); 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.writeField254(oprot); err != nil {
			fieldId = 254
			goto WriteFieldError
		}
		if err = p.writeField255(oprot); err != nil {
			fieldId = 255
			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 *CreateIngressRequest) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("ClusterId", thrift.STRING, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.ClusterId); 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 *CreateIngressRequest) 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 *CreateIngressRequest) 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 *CreateIngressRequest) writeField4(oprot thrift.TProtocol) (err error) {
	if p.IsSetDescription() {
		if err = oprot.WriteFieldBegin("Description", thrift.STRING, 4); 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 4 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err)
}

func (p *CreateIngressRequest) writeField5(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("Type", thrift.STRING, 5); 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 5 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err)
}

func (p *CreateIngressRequest) writeField6(oprot thrift.TProtocol) (err error) {
	if p.IsSetListeners() {
		if err = oprot.WriteFieldBegin("Listeners", thrift.LIST, 6); err != nil {
			goto WriteFieldBeginError
		}
		if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Listeners)); err != nil {
			return err
		}
		for _, v := range p.Listeners {
			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 *CreateIngressRequest) writeField7(oprot thrift.TProtocol) (err error) {
	if p.IsSetSessionSticky() {
		if err = oprot.WriteFieldBegin("SessionSticky", thrift.BOOL, 7); err != nil {
			goto WriteFieldBeginError
		}
		if err := oprot.WriteBool(*p.SessionSticky); 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 *CreateIngressRequest) writeField8(oprot thrift.TProtocol) (err error) {
	if p.IsSetRules() {
		if err = oprot.WriteFieldBegin("Rules", thrift.LIST, 8); err != nil {
			goto WriteFieldBeginError
		}
		if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Rules)); err != nil {
			return err
		}
		for _, v := range p.Rules {
			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 8 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 8 end error: ", p), err)
}

func (p *CreateIngressRequest) writeField254(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("Top", thrift.STRUCT, 254); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Top.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 254 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 254 end error: ", p), err)
}

func (p *CreateIngressRequest) writeField255(oprot thrift.TProtocol) (err error) {
	if p.IsSetBase() {
		if err = oprot.WriteFieldBegin("Base", thrift.STRUCT, 255); err != nil {
			goto WriteFieldBeginError
		}
		if err := p.Base.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 255 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err)
}

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

func (p *CreateIngressRequest) DeepEqual(ano *CreateIngressRequest) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.ClusterId) {
		return false
	}
	if !p.Field2DeepEqual(ano.Namespace) {
		return false
	}
	if !p.Field3DeepEqual(ano.Name) {
		return false
	}
	if !p.Field4DeepEqual(ano.Description) {
		return false
	}
	if !p.Field5DeepEqual(ano.Type) {
		return false
	}
	if !p.Field6DeepEqual(ano.Listeners) {
		return false
	}
	if !p.Field7DeepEqual(ano.SessionSticky) {
		return false
	}
	if !p.Field8DeepEqual(ano.Rules) {
		return false
	}
	if !p.Field254DeepEqual(ano.Top) {
		return false
	}
	if !p.Field255DeepEqual(ano.Base) {
		return false
	}
	return true
}

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

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

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

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

	if p.Description == src {
		return true
	} else if p.Description == nil || src == nil {
		return false
	}
	if strings.Compare(*p.Description, *src) != 0 {
		return false
	}
	return true
}
func (p *CreateIngressRequest) Field5DeepEqual(src string) bool {

	if strings.Compare(p.Type, src) != 0 {
		return false
	}
	return true
}
func (p *CreateIngressRequest) Field6DeepEqual(src []*IngressListener) bool {

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

	if p.SessionSticky == src {
		return true
	} else if p.SessionSticky == nil || src == nil {
		return false
	}
	if *p.SessionSticky != *src {
		return false
	}
	return true
}
func (p *CreateIngressRequest) Field8DeepEqual(src []*Rule) bool {

	if len(p.Rules) != len(src) {
		return false
	}
	for i, v := range p.Rules {
		_src := src[i]
		if !v.DeepEqual(_src) {
			return false
		}
	}
	return true
}
func (p *CreateIngressRequest) Field254DeepEqual(src *base.TopParam) bool {

	if !p.Top.DeepEqual(src) {
		return false
	}
	return true
}
func (p *CreateIngressRequest) Field255DeepEqual(src *base.Base) bool {

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

type CreateIngressResponse struct {
	ClusterId string     `thrift:"ClusterId,1,required" json:"ClusterId"`
	Namespace string     `thrift:"Namespace,2,required" json:"Namespace"`
	Name      string     `thrift:"Name,3,required" json:"Name"`
	Base      *base.Base `thrift:"Base,255" json:"Base,omitempty"`
}

func NewCreateIngressResponse() *CreateIngressResponse {
	return &CreateIngressResponse{}
}

func (p *CreateIngressResponse) GetClusterId() (v string) {
	return p.ClusterId
}

func (p *CreateIngressResponse) GetNamespace() (v string) {
	return p.Namespace
}

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

var CreateIngressResponse_Base_DEFAULT *base.Base

func (p *CreateIngressResponse) GetBase() (v *base.Base) {
	if !p.IsSetBase() {
		return CreateIngressResponse_Base_DEFAULT
	}
	return p.Base
}
func (p *CreateIngressResponse) SetClusterId(val string) {
	p.ClusterId = val
}
func (p *CreateIngressResponse) SetNamespace(val string) {
	p.Namespace = val
}
func (p *CreateIngressResponse) SetName(val string) {
	p.Name = val
}
func (p *CreateIngressResponse) SetBase(val *base.Base) {
	p.Base = val
}

var fieldIDToName_CreateIngressResponse = map[int16]string{
	1:   "ClusterId",
	2:   "Namespace",
	3:   "Name",
	255: "Base",
}

func (p *CreateIngressResponse) IsSetBase() bool {
	return p.Base != nil
}

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

	var fieldTypeId thrift.TType
	var fieldId int16
	var issetClusterId bool = false
	var issetNamespace bool = false
	var issetName 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.STRING {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
				issetClusterId = true
			} 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
				}
				issetNamespace = true
			} 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
				}
				issetName = true
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		case 255:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField255(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
	}

	if !issetClusterId {
		fieldId = 1
		goto RequiredFieldNotSetError
	}

	if !issetNamespace {
		fieldId = 2
		goto RequiredFieldNotSetError
	}

	if !issetName {
		fieldId = 3
		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_CreateIngressResponse[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_CreateIngressResponse[fieldId]))
}

func (p *CreateIngressResponse) ReadField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.ClusterId = v
	}
	return nil
}

func (p *CreateIngressResponse) ReadField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.Namespace = v
	}
	return nil
}

func (p *CreateIngressResponse) ReadField3(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.Name = v
	}
	return nil
}

func (p *CreateIngressResponse) ReadField255(iprot thrift.TProtocol) error {
	p.Base = base.NewBase()
	if err := p.Base.Read(iprot); err != nil {
		return err
	}
	return nil
}

func (p *CreateIngressResponse) Write(oprot thrift.TProtocol) (err error) {
	var fieldId int16
	if err = oprot.WriteStructBegin("CreateIngressResponse"); 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.writeField255(oprot); err != nil {
			fieldId = 255
			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 *CreateIngressResponse) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("ClusterId", thrift.STRING, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.ClusterId); 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 *CreateIngressResponse) 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 *CreateIngressResponse) 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 *CreateIngressResponse) writeField255(oprot thrift.TProtocol) (err error) {
	if p.IsSetBase() {
		if err = oprot.WriteFieldBegin("Base", thrift.STRUCT, 255); err != nil {
			goto WriteFieldBeginError
		}
		if err := p.Base.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 255 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err)
}

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

func (p *CreateIngressResponse) DeepEqual(ano *CreateIngressResponse) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.ClusterId) {
		return false
	}
	if !p.Field2DeepEqual(ano.Namespace) {
		return false
	}
	if !p.Field3DeepEqual(ano.Name) {
		return false
	}
	if !p.Field255DeepEqual(ano.Base) {
		return false
	}
	return true
}

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

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

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

	if strings.Compare(p.Name, src) != 0 {
		return false
	}
	return true
}
func (p *CreateIngressResponse) Field255DeepEqual(src *base.Base) bool {

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

type GetIngressRequest struct {
	ClusterId string         `thrift:"ClusterId,1,required" validate:"required"`
	Namespace string         `thrift:"Namespace,2,required" validate:"required"`
	Name      string         `thrift:"Name,3,required" validate:"required,k8sName"`
	Top       *base.TopParam `thrift:"Top,254,required" json:"Top"`
	Base      *base.Base     `thrift:"Base,255" json:"Base,omitempty"`
}

func NewGetIngressRequest() *GetIngressRequest {
	return &GetIngressRequest{}
}

func (p *GetIngressRequest) GetClusterId() (v string) {
	return p.ClusterId
}

func (p *GetIngressRequest) GetNamespace() (v string) {
	return p.Namespace
}

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

var GetIngressRequest_Top_DEFAULT *base.TopParam

func (p *GetIngressRequest) GetTop() (v *base.TopParam) {
	if !p.IsSetTop() {
		return GetIngressRequest_Top_DEFAULT
	}
	return p.Top
}

var GetIngressRequest_Base_DEFAULT *base.Base

func (p *GetIngressRequest) GetBase() (v *base.Base) {
	if !p.IsSetBase() {
		return GetIngressRequest_Base_DEFAULT
	}
	return p.Base
}
func (p *GetIngressRequest) SetClusterId(val string) {
	p.ClusterId = val
}
func (p *GetIngressRequest) SetNamespace(val string) {
	p.Namespace = val
}
func (p *GetIngressRequest) SetName(val string) {
	p.Name = val
}
func (p *GetIngressRequest) SetTop(val *base.TopParam) {
	p.Top = val
}
func (p *GetIngressRequest) SetBase(val *base.Base) {
	p.Base = val
}

var fieldIDToName_GetIngressRequest = map[int16]string{
	1:   "ClusterId",
	2:   "Namespace",
	3:   "Name",
	254: "Top",
	255: "Base",
}

func (p *GetIngressRequest) IsSetTop() bool {
	return p.Top != nil
}

func (p *GetIngressRequest) IsSetBase() bool {
	return p.Base != nil
}

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

	var fieldTypeId thrift.TType
	var fieldId int16
	var issetClusterId bool = false
	var issetNamespace bool = false
	var issetName bool = false
	var issetTop 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.STRING {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
				issetClusterId = true
			} 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
				}
				issetNamespace = true
			} 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
				}
				issetName = true
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		case 254:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField254(iprot); err != nil {
					goto ReadFieldError
				}
				issetTop = true
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		case 255:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField255(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
	}

	if !issetClusterId {
		fieldId = 1
		goto RequiredFieldNotSetError
	}

	if !issetNamespace {
		fieldId = 2
		goto RequiredFieldNotSetError
	}

	if !issetName {
		fieldId = 3
		goto RequiredFieldNotSetError
	}

	if !issetTop {
		fieldId = 254
		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_GetIngressRequest[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_GetIngressRequest[fieldId]))
}

func (p *GetIngressRequest) ReadField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.ClusterId = v
	}
	return nil
}

func (p *GetIngressRequest) ReadField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.Namespace = v
	}
	return nil
}

func (p *GetIngressRequest) ReadField3(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.Name = v
	}
	return nil
}

func (p *GetIngressRequest) ReadField254(iprot thrift.TProtocol) error {
	p.Top = base.NewTopParam()
	if err := p.Top.Read(iprot); err != nil {
		return err
	}
	return nil
}

func (p *GetIngressRequest) ReadField255(iprot thrift.TProtocol) error {
	p.Base = base.NewBase()
	if err := p.Base.Read(iprot); err != nil {
		return err
	}
	return nil
}

func (p *GetIngressRequest) Write(oprot thrift.TProtocol) (err error) {
	var fieldId int16
	if err = oprot.WriteStructBegin("GetIngressRequest"); 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.writeField254(oprot); err != nil {
			fieldId = 254
			goto WriteFieldError
		}
		if err = p.writeField255(oprot); err != nil {
			fieldId = 255
			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 *GetIngressRequest) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("ClusterId", thrift.STRING, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.ClusterId); 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 *GetIngressRequest) 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 *GetIngressRequest) 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 *GetIngressRequest) writeField254(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("Top", thrift.STRUCT, 254); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Top.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 254 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 254 end error: ", p), err)
}

func (p *GetIngressRequest) writeField255(oprot thrift.TProtocol) (err error) {
	if p.IsSetBase() {
		if err = oprot.WriteFieldBegin("Base", thrift.STRUCT, 255); err != nil {
			goto WriteFieldBeginError
		}
		if err := p.Base.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 255 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err)
}

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

func (p *GetIngressRequest) DeepEqual(ano *GetIngressRequest) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.ClusterId) {
		return false
	}
	if !p.Field2DeepEqual(ano.Namespace) {
		return false
	}
	if !p.Field3DeepEqual(ano.Name) {
		return false
	}
	if !p.Field254DeepEqual(ano.Top) {
		return false
	}
	if !p.Field255DeepEqual(ano.Base) {
		return false
	}
	return true
}

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

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

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

	if strings.Compare(p.Name, src) != 0 {
		return false
	}
	return true
}
func (p *GetIngressRequest) Field254DeepEqual(src *base.TopParam) bool {

	if !p.Top.DeepEqual(src) {
		return false
	}
	return true
}
func (p *GetIngressRequest) Field255DeepEqual(src *base.Base) bool {

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

type GetIngressResponse struct {
	Name          string             `thrift:"Name,1,required" json:"Name"`
	Region        string             `thrift:"Region,2,required" json:"Region"`
	ClusterId     string             `thrift:"ClusterId,3,required" json:"ClusterId"`
	Namespace     string             `thrift:"Namespace,4,required" json:"Namespace"`
	Description   string             `thrift:"Description,5,required" json:"Description"`
	SessionSticky bool               `thrift:"SessionSticky,6,required" json:"SessionSticky"`
	Type          string             `thrift:"Type,7,required" json:"Type"`
	Vip           string             `thrift:"Vip,8,required" json:"Vip"`
	Listeners     []*IngressListener `thrift:"Listeners,9,required" json:"Listeners"`
	Rules         []*Rule            `thrift:"Rules,10,required" json:"Rules"`
	CreateTime    string             `thrift:"CreateTime,11,required" json:"CreateTime"`
	Base          *base.Base         `thrift:"Base,255" json:"Base,omitempty"`
}

func NewGetIngressResponse() *GetIngressResponse {
	return &GetIngressResponse{}
}

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

func (p *GetIngressResponse) GetRegion() (v string) {
	return p.Region
}

func (p *GetIngressResponse) GetClusterId() (v string) {
	return p.ClusterId
}

func (p *GetIngressResponse) GetNamespace() (v string) {
	return p.Namespace
}

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

func (p *GetIngressResponse) GetSessionSticky() (v bool) {
	return p.SessionSticky
}

func (p *GetIngressResponse) GetType() (v string) {
	return p.Type
}

func (p *GetIngressResponse) GetVip() (v string) {
	return p.Vip
}

func (p *GetIngressResponse) GetListeners() (v []*IngressListener) {
	return p.Listeners
}

func (p *GetIngressResponse) GetRules() (v []*Rule) {
	return p.Rules
}

func (p *GetIngressResponse) GetCreateTime() (v string) {
	return p.CreateTime
}

var GetIngressResponse_Base_DEFAULT *base.Base

func (p *GetIngressResponse) GetBase() (v *base.Base) {
	if !p.IsSetBase() {
		return GetIngressResponse_Base_DEFAULT
	}
	return p.Base
}
func (p *GetIngressResponse) SetName(val string) {
	p.Name = val
}
func (p *GetIngressResponse) SetRegion(val string) {
	p.Region = val
}
func (p *GetIngressResponse) SetClusterId(val string) {
	p.ClusterId = val
}
func (p *GetIngressResponse) SetNamespace(val string) {
	p.Namespace = val
}
func (p *GetIngressResponse) SetDescription(val string) {
	p.Description = val
}
func (p *GetIngressResponse) SetSessionSticky(val bool) {
	p.SessionSticky = val
}
func (p *GetIngressResponse) SetType(val string) {
	p.Type = val
}
func (p *GetIngressResponse) SetVip(val string) {
	p.Vip = val
}
func (p *GetIngressResponse) SetListeners(val []*IngressListener) {
	p.Listeners = val
}
func (p *GetIngressResponse) SetRules(val []*Rule) {
	p.Rules = val
}
func (p *GetIngressResponse) SetCreateTime(val string) {
	p.CreateTime = val
}
func (p *GetIngressResponse) SetBase(val *base.Base) {
	p.Base = val
}

var fieldIDToName_GetIngressResponse = map[int16]string{
	1:   "Name",
	2:   "Region",
	3:   "ClusterId",
	4:   "Namespace",
	5:   "Description",
	6:   "SessionSticky",
	7:   "Type",
	8:   "Vip",
	9:   "Listeners",
	10:  "Rules",
	11:  "CreateTime",
	255: "Base",
}

func (p *GetIngressResponse) IsSetBase() bool {
	return p.Base != nil
}

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

	var fieldTypeId thrift.TType
	var fieldId int16
	var issetName bool = false
	var issetRegion bool = false
	var issetClusterId bool = false
	var issetNamespace bool = false
	var issetDescription bool = false
	var issetSessionSticky bool = false
	var issetType bool = false
	var issetVip bool = false
	var issetListeners bool = false
	var issetRules bool = false
	var issetCreateTime 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.STRING {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
				issetName = true
			} 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
				}
				issetRegion = true
			} 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
				}
				issetClusterId = true
			} 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
				}
				issetNamespace = true
			} 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
				}
				issetDescription = true
			} 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
				}
				issetSessionSticky = true
			} 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
				}
				issetType = true
			} 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
				}
				issetVip = true
			} 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
				}
				issetListeners = true
			} 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
				}
				issetRules = true
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		case 11:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField11(iprot); err != nil {
					goto ReadFieldError
				}
				issetCreateTime = true
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		case 255:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField255(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
	}

	if !issetName {
		fieldId = 1
		goto RequiredFieldNotSetError
	}

	if !issetRegion {
		fieldId = 2
		goto RequiredFieldNotSetError
	}

	if !issetClusterId {
		fieldId = 3
		goto RequiredFieldNotSetError
	}

	if !issetNamespace {
		fieldId = 4
		goto RequiredFieldNotSetError
	}

	if !issetDescription {
		fieldId = 5
		goto RequiredFieldNotSetError
	}

	if !issetSessionSticky {
		fieldId = 6
		goto RequiredFieldNotSetError
	}

	if !issetType {
		fieldId = 7
		goto RequiredFieldNotSetError
	}

	if !issetVip {
		fieldId = 8
		goto RequiredFieldNotSetError
	}

	if !issetListeners {
		fieldId = 9
		goto RequiredFieldNotSetError
	}

	if !issetRules {
		fieldId = 10
		goto RequiredFieldNotSetError
	}

	if !issetCreateTime {
		fieldId = 11
		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_GetIngressResponse[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_GetIngressResponse[fieldId]))
}

func (p *GetIngressResponse) ReadField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.Name = v
	}
	return nil
}

func (p *GetIngressResponse) ReadField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.Region = v
	}
	return nil
}

func (p *GetIngressResponse) ReadField3(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.ClusterId = v
	}
	return nil
}

func (p *GetIngressResponse) ReadField4(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.Namespace = v
	}
	return nil
}

func (p *GetIngressResponse) ReadField5(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.Description = v
	}
	return nil
}

func (p *GetIngressResponse) ReadField6(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadBool(); err != nil {
		return err
	} else {
		p.SessionSticky = v
	}
	return nil
}

func (p *GetIngressResponse) ReadField7(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.Type = v
	}
	return nil
}

func (p *GetIngressResponse) ReadField8(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.Vip = v
	}
	return nil
}

func (p *GetIngressResponse) ReadField9(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	p.Listeners = make([]*IngressListener, 0, size)
	for i := 0; i < size; i++ {
		_elem := NewIngressListener()
		if err := _elem.Read(iprot); err != nil {
			return err
		}

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

func (p *GetIngressResponse) ReadField10(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	p.Rules = make([]*Rule, 0, size)
	for i := 0; i < size; i++ {
		_elem := NewRule()
		if err := _elem.Read(iprot); err != nil {
			return err
		}

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

func (p *GetIngressResponse) ReadField11(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.CreateTime = v
	}
	return nil
}

func (p *GetIngressResponse) ReadField255(iprot thrift.TProtocol) error {
	p.Base = base.NewBase()
	if err := p.Base.Read(iprot); err != nil {
		return err
	}
	return nil
}

func (p *GetIngressResponse) Write(oprot thrift.TProtocol) (err error) {
	var fieldId int16
	if err = oprot.WriteStructBegin("GetIngressResponse"); 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.writeField255(oprot); err != nil {
			fieldId = 255
			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 *GetIngressResponse) 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 *GetIngressResponse) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("Region", thrift.STRING, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.Region); 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 *GetIngressResponse) writeField3(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("ClusterId", thrift.STRING, 3); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.ClusterId); 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 *GetIngressResponse) writeField4(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("Namespace", thrift.STRING, 4); 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 4 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err)
}

func (p *GetIngressResponse) 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 *GetIngressResponse) writeField6(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("SessionSticky", thrift.BOOL, 6); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteBool(p.SessionSticky); 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 *GetIngressResponse) writeField7(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("Type", thrift.STRING, 7); 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 7 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 7 end error: ", p), err)
}

func (p *GetIngressResponse) writeField8(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("Vip", thrift.STRING, 8); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.Vip); 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 *GetIngressResponse) writeField9(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("Listeners", thrift.LIST, 9); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Listeners)); err != nil {
		return err
	}
	for _, v := range p.Listeners {
		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 *GetIngressResponse) writeField10(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("Rules", thrift.LIST, 10); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Rules)); err != nil {
		return err
	}
	for _, v := range p.Rules {
		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 *GetIngressResponse) writeField11(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("CreateTime", thrift.STRING, 11); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.CreateTime); 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 *GetIngressResponse) writeField255(oprot thrift.TProtocol) (err error) {
	if p.IsSetBase() {
		if err = oprot.WriteFieldBegin("Base", thrift.STRUCT, 255); err != nil {
			goto WriteFieldBeginError
		}
		if err := p.Base.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 255 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err)
}

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

func (p *GetIngressResponse) DeepEqual(ano *GetIngressResponse) 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.Region) {
		return false
	}
	if !p.Field3DeepEqual(ano.ClusterId) {
		return false
	}
	if !p.Field4DeepEqual(ano.Namespace) {
		return false
	}
	if !p.Field5DeepEqual(ano.Description) {
		return false
	}
	if !p.Field6DeepEqual(ano.SessionSticky) {
		return false
	}
	if !p.Field7DeepEqual(ano.Type) {
		return false
	}
	if !p.Field8DeepEqual(ano.Vip) {
		return false
	}
	if !p.Field9DeepEqual(ano.Listeners) {
		return false
	}
	if !p.Field10DeepEqual(ano.Rules) {
		return false
	}
	if !p.Field11DeepEqual(ano.CreateTime) {
		return false
	}
	if !p.Field255DeepEqual(ano.Base) {
		return false
	}
	return true
}

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

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

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

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

	if strings.Compare(p.Namespace, src) != 0 {
		return false
	}
	return true
}
func (p *GetIngressResponse) Field5DeepEqual(src string) bool {

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

	if p.SessionSticky != src {
		return false
	}
	return true
}
func (p *GetIngressResponse) Field7DeepEqual(src string) bool {

	if strings.Compare(p.Type, src) != 0 {
		return false
	}
	return true
}
func (p *GetIngressResponse) Field8DeepEqual(src string) bool {

	if strings.Compare(p.Vip, src) != 0 {
		return false
	}
	return true
}
func (p *GetIngressResponse) Field9DeepEqual(src []*IngressListener) bool {

	if len(p.Listeners) != len(src) {
		return false
	}
	for i, v := range p.Listeners {
		_src := src[i]
		if !v.DeepEqual(_src) {
			return false
		}
	}
	return true
}
func (p *GetIngressResponse) Field10DeepEqual(src []*Rule) bool {

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

	if strings.Compare(p.CreateTime, src) != 0 {
		return false
	}
	return true
}
func (p *GetIngressResponse) Field255DeepEqual(src *base.Base) bool {

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

type DeleteIngressRequest struct {
	ClusterId string         `thrift:"ClusterId,1,required" validate:"required"`
	Namespace string         `thrift:"Namespace,2,required" validate:"required"`
	Name      string         `thrift:"Name,3,required" validate:"required,k8sName"`
	Top       *base.TopParam `thrift:"Top,254,required" json:"Top"`
	Base      *base.Base     `thrift:"Base,255" json:"Base,omitempty"`
}

func NewDeleteIngressRequest() *DeleteIngressRequest {
	return &DeleteIngressRequest{}
}

func (p *DeleteIngressRequest) GetClusterId() (v string) {
	return p.ClusterId
}

func (p *DeleteIngressRequest) GetNamespace() (v string) {
	return p.Namespace
}

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

var DeleteIngressRequest_Top_DEFAULT *base.TopParam

func (p *DeleteIngressRequest) GetTop() (v *base.TopParam) {
	if !p.IsSetTop() {
		return DeleteIngressRequest_Top_DEFAULT
	}
	return p.Top
}

var DeleteIngressRequest_Base_DEFAULT *base.Base

func (p *DeleteIngressRequest) GetBase() (v *base.Base) {
	if !p.IsSetBase() {
		return DeleteIngressRequest_Base_DEFAULT
	}
	return p.Base
}
func (p *DeleteIngressRequest) SetClusterId(val string) {
	p.ClusterId = val
}
func (p *DeleteIngressRequest) SetNamespace(val string) {
	p.Namespace = val
}
func (p *DeleteIngressRequest) SetName(val string) {
	p.Name = val
}
func (p *DeleteIngressRequest) SetTop(val *base.TopParam) {
	p.Top = val
}
func (p *DeleteIngressRequest) SetBase(val *base.Base) {
	p.Base = val
}

var fieldIDToName_DeleteIngressRequest = map[int16]string{
	1:   "ClusterId",
	2:   "Namespace",
	3:   "Name",
	254: "Top",
	255: "Base",
}

func (p *DeleteIngressRequest) IsSetTop() bool {
	return p.Top != nil
}

func (p *DeleteIngressRequest) IsSetBase() bool {
	return p.Base != nil
}

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

	var fieldTypeId thrift.TType
	var fieldId int16
	var issetClusterId bool = false
	var issetNamespace bool = false
	var issetName bool = false
	var issetTop 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.STRING {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
				issetClusterId = true
			} 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
				}
				issetNamespace = true
			} 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
				}
				issetName = true
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		case 254:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField254(iprot); err != nil {
					goto ReadFieldError
				}
				issetTop = true
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		case 255:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField255(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
	}

	if !issetClusterId {
		fieldId = 1
		goto RequiredFieldNotSetError
	}

	if !issetNamespace {
		fieldId = 2
		goto RequiredFieldNotSetError
	}

	if !issetName {
		fieldId = 3
		goto RequiredFieldNotSetError
	}

	if !issetTop {
		fieldId = 254
		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_DeleteIngressRequest[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_DeleteIngressRequest[fieldId]))
}

func (p *DeleteIngressRequest) ReadField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.ClusterId = v
	}
	return nil
}

func (p *DeleteIngressRequest) ReadField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.Namespace = v
	}
	return nil
}

func (p *DeleteIngressRequest) ReadField3(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.Name = v
	}
	return nil
}

func (p *DeleteIngressRequest) ReadField254(iprot thrift.TProtocol) error {
	p.Top = base.NewTopParam()
	if err := p.Top.Read(iprot); err != nil {
		return err
	}
	return nil
}

func (p *DeleteIngressRequest) ReadField255(iprot thrift.TProtocol) error {
	p.Base = base.NewBase()
	if err := p.Base.Read(iprot); err != nil {
		return err
	}
	return nil
}

func (p *DeleteIngressRequest) Write(oprot thrift.TProtocol) (err error) {
	var fieldId int16
	if err = oprot.WriteStructBegin("DeleteIngressRequest"); 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.writeField254(oprot); err != nil {
			fieldId = 254
			goto WriteFieldError
		}
		if err = p.writeField255(oprot); err != nil {
			fieldId = 255
			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 *DeleteIngressRequest) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("ClusterId", thrift.STRING, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.ClusterId); 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 *DeleteIngressRequest) 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 *DeleteIngressRequest) 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 *DeleteIngressRequest) writeField254(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("Top", thrift.STRUCT, 254); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Top.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 254 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 254 end error: ", p), err)
}

func (p *DeleteIngressRequest) writeField255(oprot thrift.TProtocol) (err error) {
	if p.IsSetBase() {
		if err = oprot.WriteFieldBegin("Base", thrift.STRUCT, 255); err != nil {
			goto WriteFieldBeginError
		}
		if err := p.Base.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 255 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err)
}

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

func (p *DeleteIngressRequest) DeepEqual(ano *DeleteIngressRequest) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.ClusterId) {
		return false
	}
	if !p.Field2DeepEqual(ano.Namespace) {
		return false
	}
	if !p.Field3DeepEqual(ano.Name) {
		return false
	}
	if !p.Field254DeepEqual(ano.Top) {
		return false
	}
	if !p.Field255DeepEqual(ano.Base) {
		return false
	}
	return true
}

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

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

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

	if strings.Compare(p.Name, src) != 0 {
		return false
	}
	return true
}
func (p *DeleteIngressRequest) Field254DeepEqual(src *base.TopParam) bool {

	if !p.Top.DeepEqual(src) {
		return false
	}
	return true
}
func (p *DeleteIngressRequest) Field255DeepEqual(src *base.Base) bool {

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

type DeleteIngressResponse struct {
}

func NewDeleteIngressResponse() *DeleteIngressResponse {
	return &DeleteIngressResponse{}
}

var fieldIDToName_DeleteIngressResponse = map[int16]string{}

func (p *DeleteIngressResponse) 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
		}
		if err = iprot.Skip(fieldTypeId); err != nil {
			goto SkipFieldTypeError
		}

		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)
SkipFieldTypeError:
	return thrift.PrependError(fmt.Sprintf("%T skip field type %d error", p, 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 *DeleteIngressResponse) Write(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteStructBegin("DeleteIngressResponse"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {

	}
	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)
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 *DeleteIngressResponse) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("DeleteIngressResponse(%+v)", *p)
}

func (p *DeleteIngressResponse) DeepEqual(ano *DeleteIngressResponse) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	return true
}

type GetSecretDomainsRequest struct {
	ClusterId string         `thrift:"ClusterId,1,required" json:"ClusterId"`
	Namespace string         `thrift:"Namespace,2,required" json:"Namespace"`
	Names     []string       `thrift:"Names,3,required" json:"Names"`
	Top       *base.TopParam `thrift:"Top,254,required" json:"Top"`
	Base      *base.Base     `thrift:"Base,255" json:"Base,omitempty"`
}

func NewGetSecretDomainsRequest() *GetSecretDomainsRequest {
	return &GetSecretDomainsRequest{}
}

func (p *GetSecretDomainsRequest) GetClusterId() (v string) {
	return p.ClusterId
}

func (p *GetSecretDomainsRequest) GetNamespace() (v string) {
	return p.Namespace
}

func (p *GetSecretDomainsRequest) GetNames() (v []string) {
	return p.Names
}

var GetSecretDomainsRequest_Top_DEFAULT *base.TopParam

func (p *GetSecretDomainsRequest) GetTop() (v *base.TopParam) {
	if !p.IsSetTop() {
		return GetSecretDomainsRequest_Top_DEFAULT
	}
	return p.Top
}

var GetSecretDomainsRequest_Base_DEFAULT *base.Base

func (p *GetSecretDomainsRequest) GetBase() (v *base.Base) {
	if !p.IsSetBase() {
		return GetSecretDomainsRequest_Base_DEFAULT
	}
	return p.Base
}
func (p *GetSecretDomainsRequest) SetClusterId(val string) {
	p.ClusterId = val
}
func (p *GetSecretDomainsRequest) SetNamespace(val string) {
	p.Namespace = val
}
func (p *GetSecretDomainsRequest) SetNames(val []string) {
	p.Names = val
}
func (p *GetSecretDomainsRequest) SetTop(val *base.TopParam) {
	p.Top = val
}
func (p *GetSecretDomainsRequest) SetBase(val *base.Base) {
	p.Base = val
}

var fieldIDToName_GetSecretDomainsRequest = map[int16]string{
	1:   "ClusterId",
	2:   "Namespace",
	3:   "Names",
	254: "Top",
	255: "Base",
}

func (p *GetSecretDomainsRequest) IsSetTop() bool {
	return p.Top != nil
}

func (p *GetSecretDomainsRequest) IsSetBase() bool {
	return p.Base != nil
}

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

	var fieldTypeId thrift.TType
	var fieldId int16
	var issetClusterId bool = false
	var issetNamespace bool = false
	var issetNames bool = false
	var issetTop 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.STRING {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
				issetClusterId = true
			} 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
				}
				issetNamespace = true
			} 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
				}
				issetNames = true
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		case 254:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField254(iprot); err != nil {
					goto ReadFieldError
				}
				issetTop = true
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		case 255:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField255(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
	}

	if !issetClusterId {
		fieldId = 1
		goto RequiredFieldNotSetError
	}

	if !issetNamespace {
		fieldId = 2
		goto RequiredFieldNotSetError
	}

	if !issetNames {
		fieldId = 3
		goto RequiredFieldNotSetError
	}

	if !issetTop {
		fieldId = 254
		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_GetSecretDomainsRequest[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_GetSecretDomainsRequest[fieldId]))
}

func (p *GetSecretDomainsRequest) ReadField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.ClusterId = v
	}
	return nil
}

func (p *GetSecretDomainsRequest) ReadField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.Namespace = v
	}
	return nil
}

func (p *GetSecretDomainsRequest) ReadField3(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	p.Names = 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
		}

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

func (p *GetSecretDomainsRequest) ReadField254(iprot thrift.TProtocol) error {
	p.Top = base.NewTopParam()
	if err := p.Top.Read(iprot); err != nil {
		return err
	}
	return nil
}

func (p *GetSecretDomainsRequest) ReadField255(iprot thrift.TProtocol) error {
	p.Base = base.NewBase()
	if err := p.Base.Read(iprot); err != nil {
		return err
	}
	return nil
}

func (p *GetSecretDomainsRequest) Write(oprot thrift.TProtocol) (err error) {
	var fieldId int16
	if err = oprot.WriteStructBegin("GetSecretDomainsRequest"); 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.writeField254(oprot); err != nil {
			fieldId = 254
			goto WriteFieldError
		}
		if err = p.writeField255(oprot); err != nil {
			fieldId = 255
			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 *GetSecretDomainsRequest) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("ClusterId", thrift.STRING, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.ClusterId); 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 *GetSecretDomainsRequest) 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 *GetSecretDomainsRequest) writeField3(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("Names", thrift.LIST, 3); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRING, len(p.Names)); err != nil {
		return err
	}
	for _, v := range p.Names {
		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 3 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err)
}

func (p *GetSecretDomainsRequest) writeField254(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("Top", thrift.STRUCT, 254); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Top.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 254 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 254 end error: ", p), err)
}

func (p *GetSecretDomainsRequest) writeField255(oprot thrift.TProtocol) (err error) {
	if p.IsSetBase() {
		if err = oprot.WriteFieldBegin("Base", thrift.STRUCT, 255); err != nil {
			goto WriteFieldBeginError
		}
		if err := p.Base.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 255 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err)
}

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

func (p *GetSecretDomainsRequest) DeepEqual(ano *GetSecretDomainsRequest) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.ClusterId) {
		return false
	}
	if !p.Field2DeepEqual(ano.Namespace) {
		return false
	}
	if !p.Field3DeepEqual(ano.Names) {
		return false
	}
	if !p.Field254DeepEqual(ano.Top) {
		return false
	}
	if !p.Field255DeepEqual(ano.Base) {
		return false
	}
	return true
}

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

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

	if strings.Compare(p.Namespace, src) != 0 {
		return false
	}
	return true
}
func (p *GetSecretDomainsRequest) Field3DeepEqual(src []string) bool {

	if len(p.Names) != len(src) {
		return false
	}
	for i, v := range p.Names {
		_src := src[i]
		if strings.Compare(v, _src) != 0 {
			return false
		}
	}
	return true
}
func (p *GetSecretDomainsRequest) Field254DeepEqual(src *base.TopParam) bool {

	if !p.Top.DeepEqual(src) {
		return false
	}
	return true
}
func (p *GetSecretDomainsRequest) Field255DeepEqual(src *base.Base) bool {

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

type SecretDomain struct {
	SecretName string   `thrift:"SecretName,1,required" json:"SecretName"`
	Domains    []string `thrift:"Domains,2,required" json:"Domains"`
}

func NewSecretDomain() *SecretDomain {
	return &SecretDomain{}
}

func (p *SecretDomain) GetSecretName() (v string) {
	return p.SecretName
}

func (p *SecretDomain) GetDomains() (v []string) {
	return p.Domains
}
func (p *SecretDomain) SetSecretName(val string) {
	p.SecretName = val
}
func (p *SecretDomain) SetDomains(val []string) {
	p.Domains = val
}

var fieldIDToName_SecretDomain = map[int16]string{
	1: "SecretName",
	2: "Domains",
}

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

	var fieldTypeId thrift.TType
	var fieldId int16
	var issetSecretName bool = false
	var issetDomains 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.STRING {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
				issetSecretName = true
			} 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
				}
				issetDomains = 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 !issetSecretName {
		fieldId = 1
		goto RequiredFieldNotSetError
	}

	if !issetDomains {
		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_SecretDomain[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_SecretDomain[fieldId]))
}

func (p *SecretDomain) ReadField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.SecretName = v
	}
	return nil
}

func (p *SecretDomain) ReadField2(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	p.Domains = 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
		}

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

func (p *SecretDomain) Write(oprot thrift.TProtocol) (err error) {
	var fieldId int16
	if err = oprot.WriteStructBegin("SecretDomain"); 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 *SecretDomain) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("SecretName", thrift.STRING, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.SecretName); 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 *SecretDomain) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("Domains", thrift.LIST, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRING, len(p.Domains)); err != nil {
		return err
	}
	for _, v := range p.Domains {
		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 *SecretDomain) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("SecretDomain(%+v)", *p)
}

func (p *SecretDomain) DeepEqual(ano *SecretDomain) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.SecretName) {
		return false
	}
	if !p.Field2DeepEqual(ano.Domains) {
		return false
	}
	return true
}

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

	if strings.Compare(p.SecretName, src) != 0 {
		return false
	}
	return true
}
func (p *SecretDomain) Field2DeepEqual(src []string) bool {

	if len(p.Domains) != len(src) {
		return false
	}
	for i, v := range p.Domains {
		_src := src[i]
		if strings.Compare(v, _src) != 0 {
			return false
		}
	}
	return true
}

type GetSecretDomainsResponse struct {
	SecretDomains []*SecretDomain `thrift:"SecretDomains,1,required" json:"SecretDomains"`
	Base          *base.Base      `thrift:"Base,255" json:"Base,omitempty"`
}

func NewGetSecretDomainsResponse() *GetSecretDomainsResponse {
	return &GetSecretDomainsResponse{}
}

func (p *GetSecretDomainsResponse) GetSecretDomains() (v []*SecretDomain) {
	return p.SecretDomains
}

var GetSecretDomainsResponse_Base_DEFAULT *base.Base

func (p *GetSecretDomainsResponse) GetBase() (v *base.Base) {
	if !p.IsSetBase() {
		return GetSecretDomainsResponse_Base_DEFAULT
	}
	return p.Base
}
func (p *GetSecretDomainsResponse) SetSecretDomains(val []*SecretDomain) {
	p.SecretDomains = val
}
func (p *GetSecretDomainsResponse) SetBase(val *base.Base) {
	p.Base = val
}

var fieldIDToName_GetSecretDomainsResponse = map[int16]string{
	1:   "SecretDomains",
	255: "Base",
}

func (p *GetSecretDomainsResponse) IsSetBase() bool {
	return p.Base != nil
}

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

	var fieldTypeId thrift.TType
	var fieldId int16
	var issetSecretDomains 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.LIST {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
				issetSecretDomains = true
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		case 255:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField255(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
	}

	if !issetSecretDomains {
		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_GetSecretDomainsResponse[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_GetSecretDomainsResponse[fieldId]))
}

func (p *GetSecretDomainsResponse) ReadField1(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	p.SecretDomains = make([]*SecretDomain, 0, size)
	for i := 0; i < size; i++ {
		_elem := NewSecretDomain()
		if err := _elem.Read(iprot); err != nil {
			return err
		}

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

func (p *GetSecretDomainsResponse) ReadField255(iprot thrift.TProtocol) error {
	p.Base = base.NewBase()
	if err := p.Base.Read(iprot); err != nil {
		return err
	}
	return nil
}

func (p *GetSecretDomainsResponse) Write(oprot thrift.TProtocol) (err error) {
	var fieldId int16
	if err = oprot.WriteStructBegin("GetSecretDomainsResponse"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
		if err = p.writeField255(oprot); err != nil {
			fieldId = 255
			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 *GetSecretDomainsResponse) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("SecretDomains", thrift.LIST, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.SecretDomains)); err != nil {
		return err
	}
	for _, v := range p.SecretDomains {
		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 *GetSecretDomainsResponse) writeField255(oprot thrift.TProtocol) (err error) {
	if p.IsSetBase() {
		if err = oprot.WriteFieldBegin("Base", thrift.STRUCT, 255); err != nil {
			goto WriteFieldBeginError
		}
		if err := p.Base.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 255 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err)
}

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

func (p *GetSecretDomainsResponse) DeepEqual(ano *GetSecretDomainsResponse) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.SecretDomains) {
		return false
	}
	if !p.Field255DeepEqual(ano.Base) {
		return false
	}
	return true
}

func (p *GetSecretDomainsResponse) Field1DeepEqual(src []*SecretDomain) bool {

	if len(p.SecretDomains) != len(src) {
		return false
	}
	for i, v := range p.SecretDomains {
		_src := src[i]
		if !v.DeepEqual(_src) {
			return false
		}
	}
	return true
}
func (p *GetSecretDomainsResponse) Field255DeepEqual(src *base.Base) bool {

	if !p.Base.DeepEqual(src) {
		return false
	}
	return true
}
// Code generated by thriftgo (0.1.3). DO NOT EDIT.

package network

import (
	"fmt"
	"github.com/apache/thrift/lib/go/thrift"
	"github.com/volcengine/vkectl/pkg/model/resource/kitex_gen/base"
	"strings"
)

const (
	ProtocolHTTP = "HTTP"

	ProtocolHTTPS = "HTTPS"

	TypeIngressNginx = "ingress-nginx"
)

type UpdateIngressRequest = CreateIngressRequest

func NewUpdateIngressRequest() *UpdateIngressRequest {
	return NewCreateIngressRequest()
}

type UpdateIngressResponse = CreateIngressResponse

func NewUpdateIngressResponse() *UpdateIngressResponse {
	return NewCreateIngressResponse()
}

type Certificate struct {
	Domains    []string `thrift:"Domains,1,required" validate:"required"`
	SecretName string   `thrift:"SecretName,2,required" validate:"required"`
}

func NewCertificate() *Certificate {
	return &Certificate{}
}

func (p *Certificate) GetDomains() (v []string) {
	return p.Domains
}

func (p *Certificate) GetSecretName() (v string) {
	return p.SecretName
}
func (p *Certificate) SetDomains(val []string) {
	p.Domains = val
}
func (p *Certificate) SetSecretName(val string) {
	p.SecretName = val
}

var fieldIDToName_Certificate = map[int16]string{
	1: "Domains",
	2: "SecretName",
}

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

	var fieldTypeId thrift.TType
	var fieldId int16
	var issetDomains bool = false
	var issetSecretName 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.LIST {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
				issetDomains = true
			} 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
				}
				issetSecretName = 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 !issetDomains {
		fieldId = 1
		goto RequiredFieldNotSetError
	}

	if !issetSecretName {
		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_Certificate[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_Certificate[fieldId]))
}

func (p *Certificate) ReadField1(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	p.Domains = 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
		}

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

func (p *Certificate) ReadField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.SecretName = v
	}
	return nil
}

func (p *Certificate) Write(oprot thrift.TProtocol) (err error) {
	var fieldId int16
	if err = oprot.WriteStructBegin("Certificate"); 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 *Certificate) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("Domains", thrift.LIST, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRING, len(p.Domains)); err != nil {
		return err
	}
	for _, v := range p.Domains {
		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 *Certificate) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("SecretName", thrift.STRING, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.SecretName); 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 *Certificate) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("Certificate(%+v)", *p)
}

func (p *Certificate) DeepEqual(ano *Certificate) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.Domains) {
		return false
	}
	if !p.Field2DeepEqual(ano.SecretName) {
		return false
	}
	return true
}

func (p *Certificate) Field1DeepEqual(src []string) bool {

	if len(p.Domains) != len(src) {
		return false
	}
	for i, v := range p.Domains {
		_src := src[i]
		if strings.Compare(v, _src) != 0 {
			return false
		}
	}
	return true
}
func (p *Certificate) Field2DeepEqual(src string) bool {

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

type IngressListener struct {
	ProtocolType string         `thrift:"ProtocolType,1,required" validate:"required,oneof=HTTP HTTPS"`
	Certificates []*Certificate `thrift:"Certificates,2" json:"Certificates,omitempty"`
}

func NewIngressListener() *IngressListener {
	return &IngressListener{}
}

func (p *IngressListener) GetProtocolType() (v string) {
	return p.ProtocolType
}

var IngressListener_Certificates_DEFAULT []*Certificate

func (p *IngressListener) GetCertificates() (v []*Certificate) {
	if !p.IsSetCertificates() {
		return IngressListener_Certificates_DEFAULT
	}
	return p.Certificates
}
func (p *IngressListener) SetProtocolType(val string) {
	p.ProtocolType = val
}
func (p *IngressListener) SetCertificates(val []*Certificate) {
	p.Certificates = val
}

var fieldIDToName_IngressListener = map[int16]string{
	1: "ProtocolType",
	2: "Certificates",
}

func (p *IngressListener) IsSetCertificates() bool {
	return p.Certificates != nil
}

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

	var fieldTypeId thrift.TType
	var fieldId int16
	var issetProtocolType 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.STRING {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
				issetProtocolType = true
			} 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
	}

	if !issetProtocolType {
		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_IngressListener[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_IngressListener[fieldId]))
}

func (p *IngressListener) ReadField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.ProtocolType = v
	}
	return nil
}

func (p *IngressListener) ReadField2(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	p.Certificates = make([]*Certificate, 0, size)
	for i := 0; i < size; i++ {
		_elem := NewCertificate()
		if err := _elem.Read(iprot); err != nil {
			return err
		}

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

func (p *IngressListener) Write(oprot thrift.TProtocol) (err error) {
	var fieldId int16
	if err = oprot.WriteStructBegin("IngressListener"); 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 *IngressListener) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("ProtocolType", thrift.STRING, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.ProtocolType); 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 *IngressListener) writeField2(oprot thrift.TProtocol) (err error) {
	if p.IsSetCertificates() {
		if err = oprot.WriteFieldBegin("Certificates", thrift.LIST, 2); err != nil {
			goto WriteFieldBeginError
		}
		if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Certificates)); err != nil {
			return err
		}
		for _, v := range p.Certificates {
			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 *IngressListener) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("IngressListener(%+v)", *p)
}

func (p *IngressListener) DeepEqual(ano *IngressListener) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.ProtocolType) {
		return false
	}
	if !p.Field2DeepEqual(ano.Certificates) {
		return false
	}
	return true
}

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

	if strings.Compare(p.ProtocolType, src) != 0 {
		return false
	}
	return true
}
func (p *IngressListener) Field2DeepEqual(src []*Certificate) bool {

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

type RulePath struct {
	Path        string `thrift:"Path,1,required" validate:"required"`
	ServiceName string `thrift:"ServiceName,2,required" validate:"required"`
	ServicePort int32  `thrift:"ServicePort,3,required" validate:"required"`
	PathType    string `thrift:"PathType,4" json:"PathType,omitempty"`
}

func NewRulePath() *RulePath {
	return &RulePath{

		PathType: "Exact",
	}
}

func (p *RulePath) GetPath() (v string) {
	return p.Path
}

func (p *RulePath) GetServiceName() (v string) {
	return p.ServiceName
}

func (p *RulePath) GetServicePort() (v int32) {
	return p.ServicePort
}

var RulePath_PathType_DEFAULT string = "Exact"

func (p *RulePath) GetPathType() (v string) {
	if !p.IsSetPathType() {
		return RulePath_PathType_DEFAULT
	}
	return p.PathType
}
func (p *RulePath) SetPath(val string) {
	p.Path = val
}
func (p *RulePath) SetServiceName(val string) {
	p.ServiceName = val
}
func (p *RulePath) SetServicePort(val int32) {
	p.ServicePort = val
}
func (p *RulePath) SetPathType(val string) {
	p.PathType = val
}

var fieldIDToName_RulePath = map[int16]string{
	1: "Path",
	2: "ServiceName",
	3: "ServicePort",
	4: "PathType",
}

func (p *RulePath) IsSetPathType() bool {
	return p.PathType != RulePath_PathType_DEFAULT
}

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

	var fieldTypeId thrift.TType
	var fieldId int16
	var issetPath bool = false
	var issetServiceName bool = false
	var issetServicePort 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.STRING {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
				issetPath = true
			} 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
				}
				issetServiceName = true
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		case 3:
			if fieldTypeId == thrift.I32 {
				if err = p.ReadField3(iprot); err != nil {
					goto ReadFieldError
				}
				issetServicePort = true
			} 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
				}
			}
		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 !issetPath {
		fieldId = 1
		goto RequiredFieldNotSetError
	}

	if !issetServiceName {
		fieldId = 2
		goto RequiredFieldNotSetError
	}

	if !issetServicePort {
		fieldId = 3
		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_RulePath[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_RulePath[fieldId]))
}

func (p *RulePath) ReadField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.Path = v
	}
	return nil
}

func (p *RulePath) ReadField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.ServiceName = v
	}
	return nil
}

func (p *RulePath) ReadField3(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return err
	} else {
		p.ServicePort = v
	}
	return nil
}

func (p *RulePath) ReadField4(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.PathType = v
	}
	return nil
}

func (p *RulePath) Write(oprot thrift.TProtocol) (err error) {
	var fieldId int16
	if err = oprot.WriteStructBegin("RulePath"); 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 *RulePath) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("Path", thrift.STRING, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.Path); 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 *RulePath) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("ServiceName", thrift.STRING, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.ServiceName); 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 *RulePath) writeField3(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("ServicePort", thrift.I32, 3); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteI32(p.ServicePort); 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 *RulePath) writeField4(oprot thrift.TProtocol) (err error) {
	if p.IsSetPathType() {
		if err = oprot.WriteFieldBegin("PathType", thrift.STRING, 4); err != nil {
			goto WriteFieldBeginError
		}
		if err := oprot.WriteString(p.PathType); 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 *RulePath) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("RulePath(%+v)", *p)
}

func (p *RulePath) DeepEqual(ano *RulePath) 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.ServiceName) {
		return false
	}
	if !p.Field3DeepEqual(ano.ServicePort) {
		return false
	}
	if !p.Field4DeepEqual(ano.PathType) {
		return false
	}
	return true
}

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

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

	if strings.Compare(p.ServiceName, src) != 0 {
		return false
	}
	return true
}
func (p *RulePath) Field3DeepEqual(src int32) bool {

	if p.ServicePort != src {
		return false
	}
	return true
}
func (p *RulePath) Field4DeepEqual(src string) bool {

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

type Rule struct {
	Domain string      `thrift:"Domain,1,required" validate:"required"`
	Paths  []*RulePath `thrift:"Paths,2,required" validate:"required"`
}

func NewRule() *Rule {
	return &Rule{}
}

func (p *Rule) GetDomain() (v string) {
	return p.Domain
}

func (p *Rule) GetPaths() (v []*RulePath) {
	return p.Paths
}
func (p *Rule) SetDomain(val string) {
	p.Domain = val
}
func (p *Rule) SetPaths(val []*RulePath) {
	p.Paths = val
}

var fieldIDToName_Rule = map[int16]string{
	1: "Domain",
	2: "Paths",
}

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

	var fieldTypeId thrift.TType
	var fieldId int16
	var issetDomain bool = false
	var issetPaths 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.STRING {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
				issetDomain = true
			} 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
				}
				issetPaths = 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 !issetDomain {
		fieldId = 1
		goto RequiredFieldNotSetError
	}

	if !issetPaths {
		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_Rule[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_Rule[fieldId]))
}

func (p *Rule) ReadField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.Domain = v
	}
	return nil
}

func (p *Rule) ReadField2(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	p.Paths = make([]*RulePath, 0, size)
	for i := 0; i < size; i++ {
		_elem := NewRulePath()
		if err := _elem.Read(iprot); err != nil {
			return err
		}

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

func (p *Rule) Write(oprot thrift.TProtocol) (err error) {
	var fieldId int16
	if err = oprot.WriteStructBegin("Rule"); 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 *Rule) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("Domain", thrift.STRING, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.Domain); 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 *Rule) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("Paths", thrift.LIST, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Paths)); err != nil {
		return err
	}
	for _, v := range p.Paths {
		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 *Rule) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("Rule(%+v)", *p)
}

func (p *Rule) DeepEqual(ano *Rule) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.Domain) {
		return false
	}
	if !p.Field2DeepEqual(ano.Paths) {
		return false
	}
	return true
}

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

	if strings.Compare(p.Domain, src) != 0 {
		return false
	}
	return true
}
func (p *Rule) Field2DeepEqual(src []*RulePath) bool {

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

type BackendService struct {
	Domain      *string `thrift:"Domain,1" json:"Domain,omitempty"`
	ServiceName string  `thrift:"ServiceName,2,required" validate:"required"`
	ServicePort int32   `thrift:"ServicePort,3,required" validate:"required"`
}

func NewBackendService() *BackendService {
	return &BackendService{}
}

var BackendService_Domain_DEFAULT string

func (p *BackendService) GetDomain() (v string) {
	if !p.IsSetDomain() {
		return BackendService_Domain_DEFAULT
	}
	return *p.Domain
}

func (p *BackendService) GetServiceName() (v string) {
	return p.ServiceName
}

func (p *BackendService) GetServicePort() (v int32) {
	return p.ServicePort
}
func (p *BackendService) SetDomain(val *string) {
	p.Domain = val
}
func (p *BackendService) SetServiceName(val string) {
	p.ServiceName = val
}
func (p *BackendService) SetServicePort(val int32) {
	p.ServicePort = val
}

var fieldIDToName_BackendService = map[int16]string{
	1: "Domain",
	2: "ServiceName",
	3: "ServicePort",
}

func (p *BackendService) IsSetDomain() bool {
	return p.Domain != nil
}

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

	var fieldTypeId thrift.TType
	var fieldId int16
	var issetServiceName bool = false
	var issetServicePort 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.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
				}
				issetServiceName = true
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		case 3:
			if fieldTypeId == thrift.I32 {
				if err = p.ReadField3(iprot); err != nil {
					goto ReadFieldError
				}
				issetServicePort = 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 !issetServiceName {
		fieldId = 2
		goto RequiredFieldNotSetError
	}

	if !issetServicePort {
		fieldId = 3
		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_BackendService[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_BackendService[fieldId]))
}

func (p *BackendService) ReadField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.Domain = &v
	}
	return nil
}

func (p *BackendService) ReadField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.ServiceName = v
	}
	return nil
}

func (p *BackendService) ReadField3(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return err
	} else {
		p.ServicePort = v
	}
	return nil
}

func (p *BackendService) Write(oprot thrift.TProtocol) (err error) {
	var fieldId int16
	if err = oprot.WriteStructBegin("BackendService"); 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 *BackendService) writeField1(oprot thrift.TProtocol) (err error) {
	if p.IsSetDomain() {
		if err = oprot.WriteFieldBegin("Domain", thrift.STRING, 1); err != nil {
			goto WriteFieldBeginError
		}
		if err := oprot.WriteString(*p.Domain); 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 *BackendService) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("ServiceName", thrift.STRING, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.ServiceName); 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 *BackendService) writeField3(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("ServicePort", thrift.I32, 3); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteI32(p.ServicePort); 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 *BackendService) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("BackendService(%+v)", *p)
}

func (p *BackendService) DeepEqual(ano *BackendService) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.Domain) {
		return false
	}
	if !p.Field2DeepEqual(ano.ServiceName) {
		return false
	}
	if !p.Field3DeepEqual(ano.ServicePort) {
		return false
	}
	return true
}

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

	if p.Domain == src {
		return true
	} else if p.Domain == nil || src == nil {
		return false
	}
	if strings.Compare(*p.Domain, *src) != 0 {
		return false
	}
	return true
}
func (p *BackendService) Field2DeepEqual(src string) bool {

	if strings.Compare(p.ServiceName, src) != 0 {
		return false
	}
	return true
}
func (p *BackendService) Field3DeepEqual(src int32) bool {

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

type ListIngressRequest struct {
	ClusterId string              `thrift:"ClusterId,1,required" validate:"required"`
	Start     int32               `thrift:"Start,2" validate:"gte=0"`
	Limit     int32               `thrift:"Limit,3" json:"Limit,omitempty"`
	Filters   map[string][]string `thrift:"Filters,4" json:"Filters,omitempty"`
	Top       *base.TopParam      `thrift:"Top,254,required" json:"Top"`
	Base      *base.Base          `thrift:"Base,255" json:"Base,omitempty"`
}

func NewListIngressRequest() *ListIngressRequest {
	return &ListIngressRequest{

		Start: 0,
		Limit: 10,
	}
}

func (p *ListIngressRequest) GetClusterId() (v string) {
	return p.ClusterId
}

var ListIngressRequest_Start_DEFAULT int32 = 0

func (p *ListIngressRequest) GetStart() (v int32) {
	if !p.IsSetStart() {
		return ListIngressRequest_Start_DEFAULT
	}
	return p.Start
}

var ListIngressRequest_Limit_DEFAULT int32 = 10

func (p *ListIngressRequest) GetLimit() (v int32) {
	if !p.IsSetLimit() {
		return ListIngressRequest_Limit_DEFAULT
	}
	return p.Limit
}

var ListIngressRequest_Filters_DEFAULT map[string][]string

func (p *ListIngressRequest) GetFilters() (v map[string][]string) {
	if !p.IsSetFilters() {
		return ListIngressRequest_Filters_DEFAULT
	}
	return p.Filters
}

var ListIngressRequest_Top_DEFAULT *base.TopParam

func (p *ListIngressRequest) GetTop() (v *base.TopParam) {
	if !p.IsSetTop() {
		return ListIngressRequest_Top_DEFAULT
	}
	return p.Top
}

var ListIngressRequest_Base_DEFAULT *base.Base

func (p *ListIngressRequest) GetBase() (v *base.Base) {
	if !p.IsSetBase() {
		return ListIngressRequest_Base_DEFAULT
	}
	return p.Base
}
func (p *ListIngressRequest) SetClusterId(val string) {
	p.ClusterId = val
}
func (p *ListIngressRequest) SetStart(val int32) {
	p.Start = val
}
func (p *ListIngressRequest) SetLimit(val int32) {
	p.Limit = val
}
func (p *ListIngressRequest) SetFilters(val map[string][]string) {
	p.Filters = val
}
func (p *ListIngressRequest) SetTop(val *base.TopParam) {
	p.Top = val
}
func (p *ListIngressRequest) SetBase(val *base.Base) {
	p.Base = val
}

var fieldIDToName_ListIngressRequest = map[int16]string{
	1:   "ClusterId",
	2:   "Start",
	3:   "Limit",
	4:   "Filters",
	254: "Top",
	255: "Base",
}

func (p *ListIngressRequest) IsSetStart() bool {
	return p.Start != ListIngressRequest_Start_DEFAULT
}

func (p *ListIngressRequest) IsSetLimit() bool {
	return p.Limit != ListIngressRequest_Limit_DEFAULT
}

func (p *ListIngressRequest) IsSetFilters() bool {
	return p.Filters != nil
}

func (p *ListIngressRequest) IsSetTop() bool {
	return p.Top != nil
}

func (p *ListIngressRequest) IsSetBase() bool {
	return p.Base != nil
}

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

	var fieldTypeId thrift.TType
	var fieldId int16
	var issetClusterId bool = false
	var issetTop 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.STRING {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
				issetClusterId = true
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		case 2:
			if fieldTypeId == thrift.I32 {
				if err = p.ReadField2(iprot); err != nil {
					goto ReadFieldError
				}
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		case 3:
			if fieldTypeId == thrift.I32 {
				if err = p.ReadField3(iprot); err != nil {
					goto ReadFieldError
				}
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		case 4:
			if fieldTypeId == thrift.MAP {
				if err = p.ReadField4(iprot); err != nil {
					goto ReadFieldError
				}
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		case 254:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField254(iprot); err != nil {
					goto ReadFieldError
				}
				issetTop = true
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		case 255:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField255(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
	}

	if !issetClusterId {
		fieldId = 1
		goto RequiredFieldNotSetError
	}

	if !issetTop {
		fieldId = 254
		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_ListIngressRequest[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_ListIngressRequest[fieldId]))
}

func (p *ListIngressRequest) ReadField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.ClusterId = v
	}
	return nil
}

func (p *ListIngressRequest) ReadField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return err
	} else {
		p.Start = v
	}
	return nil
}

func (p *ListIngressRequest) ReadField3(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return err
	} else {
		p.Limit = v
	}
	return nil
}

func (p *ListIngressRequest) ReadField4(iprot thrift.TProtocol) error {
	_, _, size, err := iprot.ReadMapBegin()
	if err != nil {
		return err
	}
	p.Filters = make(map[string][]string, size)
	for i := 0; i < size; i++ {
		var _key string
		if v, err := iprot.ReadString(); err != nil {
			return err
		} else {
			_key = v
		}

		_, size, err := iprot.ReadListBegin()
		if err != nil {
			return err
		}
		_val := 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
			}

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

		p.Filters[_key] = _val
	}
	if err := iprot.ReadMapEnd(); err != nil {
		return err
	}
	return nil
}

func (p *ListIngressRequest) ReadField254(iprot thrift.TProtocol) error {
	p.Top = base.NewTopParam()
	if err := p.Top.Read(iprot); err != nil {
		return err
	}
	return nil
}

func (p *ListIngressRequest) ReadField255(iprot thrift.TProtocol) error {
	p.Base = base.NewBase()
	if err := p.Base.Read(iprot); err != nil {
		return err
	}
	return nil
}

func (p *ListIngressRequest) Write(oprot thrift.TProtocol) (err error) {
	var fieldId int16
	if err = oprot.WriteStructBegin("ListIngressRequest"); 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.writeField254(oprot); err != nil {
			fieldId = 254
			goto WriteFieldError
		}
		if err = p.writeField255(oprot); err != nil {
			fieldId = 255
			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 *ListIngressRequest) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("ClusterId", thrift.STRING, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.ClusterId); 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 *ListIngressRequest) writeField2(oprot thrift.TProtocol) (err error) {
	if p.IsSetStart() {
		if err = oprot.WriteFieldBegin("Start", thrift.I32, 2); err != nil {
			goto WriteFieldBeginError
		}
		if err := oprot.WriteI32(p.Start); 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 *ListIngressRequest) writeField3(oprot thrift.TProtocol) (err error) {
	if p.IsSetLimit() {
		if err = oprot.WriteFieldBegin("Limit", thrift.I32, 3); err != nil {
			goto WriteFieldBeginError
		}
		if err := oprot.WriteI32(p.Limit); 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 *ListIngressRequest) writeField4(oprot thrift.TProtocol) (err error) {
	if p.IsSetFilters() {
		if err = oprot.WriteFieldBegin("Filters", thrift.MAP, 4); err != nil {
			goto WriteFieldBeginError
		}
		if err := oprot.WriteMapBegin(thrift.STRING, thrift.LIST, len(p.Filters)); err != nil {
			return err
		}
		for k, v := range p.Filters {

			if err := oprot.WriteString(k); err != nil {
				return err
			}

			if err := oprot.WriteListBegin(thrift.STRING, len(v)); err != nil {
				return err
			}
			for _, v := range v {
				if err := oprot.WriteString(v); err != nil {
					return err
				}
			}
			if err := oprot.WriteListEnd(); err != nil {
				return err
			}
		}
		if err := oprot.WriteMapEnd(); 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 *ListIngressRequest) writeField254(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("Top", thrift.STRUCT, 254); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Top.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 254 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 254 end error: ", p), err)
}

func (p *ListIngressRequest) writeField255(oprot thrift.TProtocol) (err error) {
	if p.IsSetBase() {
		if err = oprot.WriteFieldBegin("Base", thrift.STRUCT, 255); err != nil {
			goto WriteFieldBeginError
		}
		if err := p.Base.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 255 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err)
}

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

func (p *ListIngressRequest) DeepEqual(ano *ListIngressRequest) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.ClusterId) {
		return false
	}
	if !p.Field2DeepEqual(ano.Start) {
		return false
	}
	if !p.Field3DeepEqual(ano.Limit) {
		return false
	}
	if !p.Field4DeepEqual(ano.Filters) {
		return false
	}
	if !p.Field254DeepEqual(ano.Top) {
		return false
	}
	if !p.Field255DeepEqual(ano.Base) {
		return false
	}
	return true
}

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

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

	if p.Start != src {
		return false
	}
	return true
}
func (p *ListIngressRequest) Field3DeepEqual(src int32) bool {

	if p.Limit != src {
		return false
	}
	return true
}
func (p *ListIngressRequest) Field4DeepEqual(src map[string][]string) bool {

	if len(p.Filters) != len(src) {
		return false
	}
	for k, v := range p.Filters {
		_src := src[k]
		if len(v) != len(_src) {
			return false
		}
		for i, v := range v {
			_src1 := _src[i]
			if strings.Compare(v, _src1) != 0 {
				return false
			}
		}
	}
	return true
}
func (p *ListIngressRequest) Field254DeepEqual(src *base.TopParam) bool {

	if !p.Top.DeepEqual(src) {
		return false
	}
	return true
}
func (p *ListIngressRequest) Field255DeepEqual(src *base.Base) bool {

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

type IngressItem struct {
	Name            string             `thrift:"Name,1,required" validate:"required"`
	Namespace       string             `thrift:"Namespace,2,required" json:"Namespace"`
	Type            string             `thrift:"Type,3,required" validate:"required,eq=ingress-nginx"`
	Vip             string             `thrift:"Vip,4,required" validate:"required"`
	Listeners       []*IngressListener `thrift:"Listeners,5,required" validate:"required"`
	BacekendService []*BackendService  `thrift:"BacekendService,6,required" validate:"required"`
	CreateTime      string             `thrift:"CreateTime,7,required" json:"CreateTime"`
}

func NewIngressItem() *IngressItem {
	return &IngressItem{}
}

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

func (p *IngressItem) GetNamespace() (v string) {
	return p.Namespace
}

func (p *IngressItem) GetType() (v string) {
	return p.Type
}

func (p *IngressItem) GetVip() (v string) {
	return p.Vip
}

func (p *IngressItem) GetListeners() (v []*IngressListener) {
	return p.Listeners
}

func (p *IngressItem) GetBacekendService() (v []*BackendService) {
	return p.BacekendService
}

func (p *IngressItem) GetCreateTime() (v string) {
	return p.CreateTime
}
func (p *IngressItem) SetName(val string) {
	p.Name = val
}
func (p *IngressItem) SetNamespace(val string) {
	p.Namespace = val
}
func (p *IngressItem) SetType(val string) {
	p.Type = val
}
func (p *IngressItem) SetVip(val string) {
	p.Vip = val
}
func (p *IngressItem) SetListeners(val []*IngressListener) {
	p.Listeners = val
}
func (p *IngressItem) SetBacekendService(val []*BackendService) {
	p.BacekendService = val
}
func (p *IngressItem) SetCreateTime(val string) {
	p.CreateTime = val
}

var fieldIDToName_IngressItem = map[int16]string{
	1: "Name",
	2: "Namespace",
	3: "Type",
	4: "Vip",
	5: "Listeners",
	6: "BacekendService",
	7: "CreateTime",
}

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

	var fieldTypeId thrift.TType
	var fieldId int16
	var issetName bool = false
	var issetNamespace bool = false
	var issetType bool = false
	var issetVip bool = false
	var issetListeners bool = false
	var issetBacekendService bool = false
	var issetCreateTime 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.STRING {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
				issetName = true
			} 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
				}
				issetNamespace = true
			} 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
				}
				issetType = true
			} 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
				}
				issetVip = true
			} 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
				}
				issetListeners = true
			} 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
				}
				issetBacekendService = true
			} 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
				}
				issetCreateTime = 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 !issetName {
		fieldId = 1
		goto RequiredFieldNotSetError
	}

	if !issetNamespace {
		fieldId = 2
		goto RequiredFieldNotSetError
	}

	if !issetType {
		fieldId = 3
		goto RequiredFieldNotSetError
	}

	if !issetVip {
		fieldId = 4
		goto RequiredFieldNotSetError
	}

	if !issetListeners {
		fieldId = 5
		goto RequiredFieldNotSetError
	}

	if !issetBacekendService {
		fieldId = 6
		goto RequiredFieldNotSetError
	}

	if !issetCreateTime {
		fieldId = 7
		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_IngressItem[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_IngressItem[fieldId]))
}

func (p *IngressItem) ReadField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.Name = v
	}
	return nil
}

func (p *IngressItem) ReadField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.Namespace = v
	}
	return nil
}

func (p *IngressItem) ReadField3(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.Type = v
	}
	return nil
}

func (p *IngressItem) ReadField4(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.Vip = v
	}
	return nil
}

func (p *IngressItem) ReadField5(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	p.Listeners = make([]*IngressListener, 0, size)
	for i := 0; i < size; i++ {
		_elem := NewIngressListener()
		if err := _elem.Read(iprot); err != nil {
			return err
		}

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

func (p *IngressItem) ReadField6(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	p.BacekendService = make([]*BackendService, 0, size)
	for i := 0; i < size; i++ {
		_elem := NewBackendService()
		if err := _elem.Read(iprot); err != nil {
			return err
		}

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

func (p *IngressItem) ReadField7(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.CreateTime = v
	}
	return nil
}

func (p *IngressItem) Write(oprot thrift.TProtocol) (err error) {
	var fieldId int16
	if err = oprot.WriteStructBegin("IngressItem"); 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 *IngressItem) 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 *IngressItem) 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 *IngressItem) writeField3(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("Type", thrift.STRING, 3); 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 3 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err)
}

func (p *IngressItem) writeField4(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("Vip", thrift.STRING, 4); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.Vip); 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 *IngressItem) writeField5(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("Listeners", thrift.LIST, 5); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Listeners)); err != nil {
		return err
	}
	for _, v := range p.Listeners {
		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 *IngressItem) writeField6(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("BacekendService", thrift.LIST, 6); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.BacekendService)); err != nil {
		return err
	}
	for _, v := range p.BacekendService {
		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 *IngressItem) writeField7(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("CreateTime", thrift.STRING, 7); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.CreateTime); 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 *IngressItem) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("IngressItem(%+v)", *p)
}

func (p *IngressItem) DeepEqual(ano *IngressItem) 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.Type) {
		return false
	}
	if !p.Field4DeepEqual(ano.Vip) {
		return false
	}
	if !p.Field5DeepEqual(ano.Listeners) {
		return false
	}
	if !p.Field6DeepEqual(ano.BacekendService) {
		return false
	}
	if !p.Field7DeepEqual(ano.CreateTime) {
		return false
	}
	return true
}

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

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

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

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

	if strings.Compare(p.Vip, src) != 0 {
		return false
	}
	return true
}
func (p *IngressItem) Field5DeepEqual(src []*IngressListener) bool {

	if len(p.Listeners) != len(src) {
		return false
	}
	for i, v := range p.Listeners {
		_src := src[i]
		if !v.DeepEqual(_src) {
			return false
		}
	}
	return true
}
func (p *IngressItem) Field6DeepEqual(src []*BackendService) bool {

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

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

type ListIngressResponse struct {
	Items []*IngressItem `thrift:"Items,1,required" json:"Items"`
	Total int32          `thrift:"Total,2,required" json:"Total"`
	Base  *base.Base     `thrift:"Base,255" json:"Base,omitempty"`
}

func NewListIngressResponse() *ListIngressResponse {
	return &ListIngressResponse{}
}

func (p *ListIngressResponse) GetItems() (v []*IngressItem) {
	return p.Items
}

func (p *ListIngressResponse) GetTotal() (v int32) {
	return p.Total
}

var ListIngressResponse_Base_DEFAULT *base.Base

func (p *ListIngressResponse) GetBase() (v *base.Base) {
	if !p.IsSetBase() {
		return ListIngressResponse_Base_DEFAULT
	}
	return p.Base
}
func (p *ListIngressResponse) SetItems(val []*IngressItem) {
	p.Items = val
}
func (p *ListIngressResponse) SetTotal(val int32) {
	p.Total = val
}
func (p *ListIngressResponse) SetBase(val *base.Base) {
	p.Base = val
}

var fieldIDToName_ListIngressResponse = map[int16]string{
	1:   "Items",
	2:   "Total",
	255: "Base",
}

func (p *ListIngressResponse) IsSetBase() bool {
	return p.Base != nil
}

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

	var fieldTypeId thrift.TType
	var fieldId int16
	var issetItems bool = false
	var issetTotal 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.LIST {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
				issetItems = true
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		case 2:
			if fieldTypeId == thrift.I32 {
				if err = p.ReadField2(iprot); err != nil {
					goto ReadFieldError
				}
				issetTotal = true
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		case 255:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField255(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
	}

	if !issetItems {
		fieldId = 1
		goto RequiredFieldNotSetError
	}

	if !issetTotal {
		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_ListIngressResponse[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_ListIngressResponse[fieldId]))
}

func (p *ListIngressResponse) ReadField1(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	p.Items = make([]*IngressItem, 0, size)
	for i := 0; i < size; i++ {
		_elem := NewIngressItem()
		if err := _elem.Read(iprot); err != nil {
			return err
		}

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

func (p *ListIngressResponse) ReadField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return err
	} else {
		p.Total = v
	}
	return nil
}

func (p *ListIngressResponse) ReadField255(iprot thrift.TProtocol) error {
	p.Base = base.NewBase()
	if err := p.Base.Read(iprot); err != nil {
		return err
	}
	return nil
}

func (p *ListIngressResponse) Write(oprot thrift.TProtocol) (err error) {
	var fieldId int16
	if err = oprot.WriteStructBegin("ListIngressResponse"); 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.writeField255(oprot); err != nil {
			fieldId = 255
			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 *ListIngressResponse) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("Items", thrift.LIST, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Items)); err != nil {
		return err
	}
	for _, v := range p.Items {
		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 *ListIngressResponse) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("Total", thrift.I32, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteI32(p.Total); 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 *ListIngressResponse) writeField255(oprot thrift.TProtocol) (err error) {
	if p.IsSetBase() {
		if err = oprot.WriteFieldBegin("Base", thrift.STRUCT, 255); err != nil {
			goto WriteFieldBeginError
		}
		if err := p.Base.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 255 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err)
}

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

func (p *ListIngressResponse) DeepEqual(ano *ListIngressResponse) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.Items) {
		return false
	}
	if !p.Field2DeepEqual(ano.Total) {
		return false
	}
	if !p.Field255DeepEqual(ano.Base) {
		return false
	}
	return true
}

func (p *ListIngressResponse) Field1DeepEqual(src []*IngressItem) bool {

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

	if p.Total != src {
		return false
	}
	return true
}
func (p *ListIngressResponse) Field255DeepEqual(src *base.Base) bool {

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

type ListIngressTypeRequest struct {
	Top  *base.TopParam `thrift:"Top,254,required" json:"Top"`
	Base *base.Base     `thrift:"Base,255" json:"Base,omitempty"`
}

func NewListIngressTypeRequest() *ListIngressTypeRequest {
	return &ListIngressTypeRequest{}
}

var ListIngressTypeRequest_Top_DEFAULT *base.TopParam

func (p *ListIngressTypeRequest) GetTop() (v *base.TopParam) {
	if !p.IsSetTop() {
		return ListIngressTypeRequest_Top_DEFAULT
	}
	return p.Top
}

var ListIngressTypeRequest_Base_DEFAULT *base.Base

func (p *ListIngressTypeRequest) GetBase() (v *base.Base) {
	if !p.IsSetBase() {
		return ListIngressTypeRequest_Base_DEFAULT
	}
	return p.Base
}
func (p *ListIngressTypeRequest) SetTop(val *base.TopParam) {
	p.Top = val
}
func (p *ListIngressTypeRequest) SetBase(val *base.Base) {
	p.Base = val
}

var fieldIDToName_ListIngressTypeRequest = map[int16]string{
	254: "Top",
	255: "Base",
}

func (p *ListIngressTypeRequest) IsSetTop() bool {
	return p.Top != nil
}

func (p *ListIngressTypeRequest) IsSetBase() bool {
	return p.Base != nil
}

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

	var fieldTypeId thrift.TType
	var fieldId int16
	var issetTop 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 254:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField254(iprot); err != nil {
					goto ReadFieldError
				}
				issetTop = true
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		case 255:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField255(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
	}

	if !issetTop {
		fieldId = 254
		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_ListIngressTypeRequest[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_ListIngressTypeRequest[fieldId]))
}

func (p *ListIngressTypeRequest) ReadField254(iprot thrift.TProtocol) error {
	p.Top = base.NewTopParam()
	if err := p.Top.Read(iprot); err != nil {
		return err
	}
	return nil
}

func (p *ListIngressTypeRequest) ReadField255(iprot thrift.TProtocol) error {
	p.Base = base.NewBase()
	if err := p.Base.Read(iprot); err != nil {
		return err
	}
	return nil
}

func (p *ListIngressTypeRequest) Write(oprot thrift.TProtocol) (err error) {
	var fieldId int16
	if err = oprot.WriteStructBegin("ListIngressTypeRequest"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField254(oprot); err != nil {
			fieldId = 254
			goto WriteFieldError
		}
		if err = p.writeField255(oprot); err != nil {
			fieldId = 255
			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 *ListIngressTypeRequest) writeField254(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("Top", thrift.STRUCT, 254); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Top.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 254 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 254 end error: ", p), err)
}

func (p *ListIngressTypeRequest) writeField255(oprot thrift.TProtocol) (err error) {
	if p.IsSetBase() {
		if err = oprot.WriteFieldBegin("Base", thrift.STRUCT, 255); err != nil {
			goto WriteFieldBeginError
		}
		if err := p.Base.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 255 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err)
}

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

func (p *ListIngressTypeRequest) DeepEqual(ano *ListIngressTypeRequest) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field254DeepEqual(ano.Top) {
		return false
	}
	if !p.Field255DeepEqual(ano.Base) {
		return false
	}
	return true
}

func (p *ListIngressTypeRequest) Field254DeepEqual(src *base.TopParam) bool {

	if !p.Top.DeepEqual(src) {
		return false
	}
	return true
}
func (p *ListIngressTypeRequest) Field255DeepEqual(src *base.Base) bool {

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

type ListIngressTypeResponse struct {
	Items []string   `thrift:"Items,1,required" json:"Items"`
	Base  *base.Base `thrift:"Base,255" json:"Base,omitempty"`
}

func NewListIngressTypeResponse() *ListIngressTypeResponse {
	return &ListIngressTypeResponse{}
}

func (p *ListIngressTypeResponse) GetItems() (v []string) {
	return p.Items
}

var ListIngressTypeResponse_Base_DEFAULT *base.Base

func (p *ListIngressTypeResponse) GetBase() (v *base.Base) {
	if !p.IsSetBase() {
		return ListIngressTypeResponse_Base_DEFAULT
	}
	return p.Base
}
func (p *ListIngressTypeResponse) SetItems(val []string) {
	p.Items = val
}
func (p *ListIngressTypeResponse) SetBase(val *base.Base) {
	p.Base = val
}

var fieldIDToName_ListIngressTypeResponse = map[int16]string{
	1:   "Items",
	255: "Base",
}

func (p *ListIngressTypeResponse) IsSetBase() bool {
	return p.Base != nil
}

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

	var fieldTypeId thrift.TType
	var fieldId int16
	var issetItems 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.LIST {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
				issetItems = true
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		case 255:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField255(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
	}

	if !issetItems {
		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_ListIngressTypeResponse[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_ListIngressTypeResponse[fieldId]))
}

func (p *ListIngressTypeResponse) ReadField1(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	p.Items = 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
		}

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

func (p *ListIngressTypeResponse) ReadField255(iprot thrift.TProtocol) error {
	p.Base = base.NewBase()
	if err := p.Base.Read(iprot); err != nil {
		return err
	}
	return nil
}

func (p *ListIngressTypeResponse) Write(oprot thrift.TProtocol) (err error) {
	var fieldId int16
	if err = oprot.WriteStructBegin("ListIngressTypeResponse"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
		if err = p.writeField255(oprot); err != nil {
			fieldId = 255
			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 *ListIngressTypeResponse) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("Items", thrift.LIST, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRING, len(p.Items)); err != nil {
		return err
	}
	for _, v := range p.Items {
		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 *ListIngressTypeResponse) writeField255(oprot thrift.TProtocol) (err error) {
	if p.IsSetBase() {
		if err = oprot.WriteFieldBegin("Base", thrift.STRUCT, 255); err != nil {
			goto WriteFieldBeginError
		}
		if err := p.Base.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 255 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err)
}

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

func (p *ListIngressTypeResponse) DeepEqual(ano *ListIngressTypeResponse) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.Items) {
		return false
	}
	if !p.Field255DeepEqual(ano.Base) {
		return false
	}
	return true
}

func (p *ListIngressTypeResponse) Field1DeepEqual(src []string) bool {

	if len(p.Items) != len(src) {
		return false
	}
	for i, v := range p.Items {
		_src := src[i]
		if strings.Compare(v, _src) != 0 {
			return false
		}
	}
	return true
}
func (p *ListIngressTypeResponse) Field255DeepEqual(src *base.Base) bool {

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

type CreateIngressRequest struct {
	ClusterId     string             `thrift:"ClusterId,1,required" validate:"required"`
	Namespace     string             `thrift:"Namespace,2,required" validate:"required"`
	Name          string             `thrift:"Name,3,required" validate:"required,k8sName"`
	Description   *string            `thrift:"Description,4" json:"Description,omitempty"`
	Type          string             `thrift:"Type,5,required" json:"Type"`
	Listeners     []*IngressListener `thrift:"Listeners,6" json:"Listeners,omitempty"`
	SessionSticky *bool              `thrift:"SessionSticky,7" json:"SessionSticky,omitempty"`
	Rules         []*Rule            `thrift:"Rules,8" json:"Rules,omitempty"`
	Top           *base.TopParam     `thrift:"Top,254,required" json:"Top"`
	Base          *base.Base         `thrift:"Base,255" json:"Base,omitempty"`
}

func NewCreateIngressRequest() *CreateIngressRequest {
	return &CreateIngressRequest{

		Type: "",
	}
}

func (p *CreateIngressRequest) GetClusterId() (v string) {
	return p.ClusterId
}

func (p *CreateIngressRequest) GetNamespace() (v string) {
	return p.Namespace
}

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

var CreateIngressRequest_Description_DEFAULT string

func (p *CreateIngressRequest) GetDescription() (v string) {
	if !p.IsSetDescription() {
		return CreateIngressRequest_Description_DEFAULT
	}
	return *p.Description
}

func (p *CreateIngressRequest) GetType() (v string) {
	return p.Type
}

var CreateIngressRequest_Listeners_DEFAULT []*IngressListener

func (p *CreateIngressRequest) GetListeners() (v []*IngressListener) {
	if !p.IsSetListeners() {
		return CreateIngressRequest_Listeners_DEFAULT
	}
	return p.Listeners
}

var CreateIngressRequest_SessionSticky_DEFAULT bool

func (p *CreateIngressRequest) GetSessionSticky() (v bool) {
	if !p.IsSetSessionSticky() {
		return CreateIngressRequest_SessionSticky_DEFAULT
	}
	return *p.SessionSticky
}

var CreateIngressRequest_Rules_DEFAULT []*Rule

func (p *CreateIngressRequest) GetRules() (v []*Rule) {
	if !p.IsSetRules() {
		return CreateIngressRequest_Rules_DEFAULT
	}
	return p.Rules
}

var CreateIngressRequest_Top_DEFAULT *base.TopParam

func (p *CreateIngressRequest) GetTop() (v *base.TopParam) {
	if !p.IsSetTop() {
		return CreateIngressRequest_Top_DEFAULT
	}
	return p.Top
}

var CreateIngressRequest_Base_DEFAULT *base.Base

func (p *CreateIngressRequest) GetBase() (v *base.Base) {
	if !p.IsSetBase() {
		return CreateIngressRequest_Base_DEFAULT
	}
	return p.Base
}
func (p *CreateIngressRequest) SetClusterId(val string) {
	p.ClusterId = val
}
func (p *CreateIngressRequest) SetNamespace(val string) {
	p.Namespace = val
}
func (p *CreateIngressRequest) SetName(val string) {
	p.Name = val
}
func (p *CreateIngressRequest) SetDescription(val *string) {
	p.Description = val
}
func (p *CreateIngressRequest) SetType(val string) {
	p.Type = val
}
func (p *CreateIngressRequest) SetListeners(val []*IngressListener) {
	p.Listeners = val
}
func (p *CreateIngressRequest) SetSessionSticky(val *bool) {
	p.SessionSticky = val
}
func (p *CreateIngressRequest) SetRules(val []*Rule) {
	p.Rules = val
}
func (p *CreateIngressRequest) SetTop(val *base.TopParam) {
	p.Top = val
}
func (p *CreateIngressRequest) SetBase(val *base.Base) {
	p.Base = val
}

var fieldIDToName_CreateIngressRequest = map[int16]string{
	1:   "ClusterId",
	2:   "Namespace",
	3:   "Name",
	4:   "Description",
	5:   "Type",
	6:   "Listeners",
	7:   "SessionSticky",
	8:   "Rules",
	254: "Top",
	255: "Base",
}

func (p *CreateIngressRequest) IsSetDescription() bool {
	return p.Description != nil
}

func (p *CreateIngressRequest) IsSetListeners() bool {
	return p.Listeners != nil
}

func (p *CreateIngressRequest) IsSetSessionSticky() bool {
	return p.SessionSticky != nil
}

func (p *CreateIngressRequest) IsSetRules() bool {
	return p.Rules != nil
}

func (p *CreateIngressRequest) IsSetTop() bool {
	return p.Top != nil
}

func (p *CreateIngressRequest) IsSetBase() bool {
	return p.Base != nil
}

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

	var fieldTypeId thrift.TType
	var fieldId int16
	var issetClusterId bool = false
	var issetNamespace bool = false
	var issetName bool = false
	var issetType bool = false
	var issetTop 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.STRING {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
				issetClusterId = true
			} 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
				}
				issetNamespace = true
			} 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
				}
				issetName = true
			} 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
				}
				issetType = true
			} 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.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.LIST {
				if err = p.ReadField8(iprot); err != nil {
					goto ReadFieldError
				}
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		case 254:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField254(iprot); err != nil {
					goto ReadFieldError
				}
				issetTop = true
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		case 255:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField255(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
	}

	if !issetClusterId {
		fieldId = 1
		goto RequiredFieldNotSetError
	}

	if !issetNamespace {
		fieldId = 2
		goto RequiredFieldNotSetError
	}

	if !issetName {
		fieldId = 3
		goto RequiredFieldNotSetError
	}

	if !issetType {
		fieldId = 5
		goto RequiredFieldNotSetError
	}

	if !issetTop {
		fieldId = 254
		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_CreateIngressRequest[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_CreateIngressRequest[fieldId]))
}

func (p *CreateIngressRequest) ReadField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.ClusterId = v
	}
	return nil
}

func (p *CreateIngressRequest) ReadField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.Namespace = v
	}
	return nil
}

func (p *CreateIngressRequest) ReadField3(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.Name = v
	}
	return nil
}

func (p *CreateIngressRequest) ReadField4(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.Description = &v
	}
	return nil
}

func (p *CreateIngressRequest) ReadField5(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.Type = v
	}
	return nil
}

func (p *CreateIngressRequest) ReadField6(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	p.Listeners = make([]*IngressListener, 0, size)
	for i := 0; i < size; i++ {
		_elem := NewIngressListener()
		if err := _elem.Read(iprot); err != nil {
			return err
		}

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

func (p *CreateIngressRequest) ReadField7(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadBool(); err != nil {
		return err
	} else {
		p.SessionSticky = &v
	}
	return nil
}

func (p *CreateIngressRequest) ReadField8(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	p.Rules = make([]*Rule, 0, size)
	for i := 0; i < size; i++ {
		_elem := NewRule()
		if err := _elem.Read(iprot); err != nil {
			return err
		}

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

func (p *CreateIngressRequest) ReadField254(iprot thrift.TProtocol) error {
	p.Top = base.NewTopParam()
	if err := p.Top.Read(iprot); err != nil {
		return err
	}
	return nil
}

func (p *CreateIngressRequest) ReadField255(iprot thrift.TProtocol) error {
	p.Base = base.NewBase()
	if err := p.Base.Read(iprot); err != nil {
		return err
	}
	return nil
}

func (p *CreateIngressRequest) Write(oprot thrift.TProtocol) (err error) {
	var fieldId int16
	if err = oprot.WriteStructBegin("CreateIngressRequest"); 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.writeField254(oprot); err != nil {
			fieldId = 254
			goto WriteFieldError
		}
		if err = p.writeField255(oprot); err != nil {
			fieldId = 255
			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 *CreateIngressRequest) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("ClusterId", thrift.STRING, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.ClusterId); 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 *CreateIngressRequest) 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 *CreateIngressRequest) 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 *CreateIngressRequest) writeField4(oprot thrift.TProtocol) (err error) {
	if p.IsSetDescription() {
		if err = oprot.WriteFieldBegin("Description", thrift.STRING, 4); 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 4 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err)
}

func (p *CreateIngressRequest) writeField5(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("Type", thrift.STRING, 5); 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 5 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err)
}

func (p *CreateIngressRequest) writeField6(oprot thrift.TProtocol) (err error) {
	if p.IsSetListeners() {
		if err = oprot.WriteFieldBegin("Listeners", thrift.LIST, 6); err != nil {
			goto WriteFieldBeginError
		}
		if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Listeners)); err != nil {
			return err
		}
		for _, v := range p.Listeners {
			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 *CreateIngressRequest) writeField7(oprot thrift.TProtocol) (err error) {
	if p.IsSetSessionSticky() {
		if err = oprot.WriteFieldBegin("SessionSticky", thrift.BOOL, 7); err != nil {
			goto WriteFieldBeginError
		}
		if err := oprot.WriteBool(*p.SessionSticky); 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 *CreateIngressRequest) writeField8(oprot thrift.TProtocol) (err error) {
	if p.IsSetRules() {
		if err = oprot.WriteFieldBegin("Rules", thrift.LIST, 8); err != nil {
			goto WriteFieldBeginError
		}
		if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Rules)); err != nil {
			return err
		}
		for _, v := range p.Rules {
			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 8 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 8 end error: ", p), err)
}

func (p *CreateIngressRequest) writeField254(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("Top", thrift.STRUCT, 254); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Top.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 254 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 254 end error: ", p), err)
}

func (p *CreateIngressRequest) writeField255(oprot thrift.TProtocol) (err error) {
	if p.IsSetBase() {
		if err = oprot.WriteFieldBegin("Base", thrift.STRUCT, 255); err != nil {
			goto WriteFieldBeginError
		}
		if err := p.Base.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 255 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err)
}

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

func (p *CreateIngressRequest) DeepEqual(ano *CreateIngressRequest) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.ClusterId) {
		return false
	}
	if !p.Field2DeepEqual(ano.Namespace) {
		return false
	}
	if !p.Field3DeepEqual(ano.Name) {
		return false
	}
	if !p.Field4DeepEqual(ano.Description) {
		return false
	}
	if !p.Field5DeepEqual(ano.Type) {
		return false
	}
	if !p.Field6DeepEqual(ano.Listeners) {
		return false
	}
	if !p.Field7DeepEqual(ano.SessionSticky) {
		return false
	}
	if !p.Field8DeepEqual(ano.Rules) {
		return false
	}
	if !p.Field254DeepEqual(ano.Top) {
		return false
	}
	if !p.Field255DeepEqual(ano.Base) {
		return false
	}
	return true
}

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

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

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

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

	if p.Description == src {
		return true
	} else if p.Description == nil || src == nil {
		return false
	}
	if strings.Compare(*p.Description, *src) != 0 {
		return false
	}
	return true
}
func (p *CreateIngressRequest) Field5DeepEqual(src string) bool {

	if strings.Compare(p.Type, src) != 0 {
		return false
	}
	return true
}
func (p *CreateIngressRequest) Field6DeepEqual(src []*IngressListener) bool {

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

	if p.SessionSticky == src {
		return true
	} else if p.SessionSticky == nil || src == nil {
		return false
	}
	if *p.SessionSticky != *src {
		return false
	}
	return true
}
func (p *CreateIngressRequest) Field8DeepEqual(src []*Rule) bool {

	if len(p.Rules) != len(src) {
		return false
	}
	for i, v := range p.Rules {
		_src := src[i]
		if !v.DeepEqual(_src) {
			return false
		}
	}
	return true
}
func (p *CreateIngressRequest) Field254DeepEqual(src *base.TopParam) bool {

	if !p.Top.DeepEqual(src) {
		return false
	}
	return true
}
func (p *CreateIngressRequest) Field255DeepEqual(src *base.Base) bool {

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

type CreateIngressResponse struct {
	ClusterId string     `thrift:"ClusterId,1,required" json:"ClusterId"`
	Namespace string     `thrift:"Namespace,2,required" json:"Namespace"`
	Name      string     `thrift:"Name,3,required" json:"Name"`
	Base      *base.Base `thrift:"Base,255" json:"Base,omitempty"`
}

func NewCreateIngressResponse() *CreateIngressResponse {
	return &CreateIngressResponse{}
}

func (p *CreateIngressResponse) GetClusterId() (v string) {
	return p.ClusterId
}

func (p *CreateIngressResponse) GetNamespace() (v string) {
	return p.Namespace
}

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

var CreateIngressResponse_Base_DEFAULT *base.Base

func (p *CreateIngressResponse) GetBase() (v *base.Base) {
	if !p.IsSetBase() {
		return CreateIngressResponse_Base_DEFAULT
	}
	return p.Base
}
func (p *CreateIngressResponse) SetClusterId(val string) {
	p.ClusterId = val
}
func (p *CreateIngressResponse) SetNamespace(val string) {
	p.Namespace = val
}
func (p *CreateIngressResponse) SetName(val string) {
	p.Name = val
}
func (p *CreateIngressResponse) SetBase(val *base.Base) {
	p.Base = val
}

var fieldIDToName_CreateIngressResponse = map[int16]string{
	1:   "ClusterId",
	2:   "Namespace",
	3:   "Name",
	255: "Base",
}

func (p *CreateIngressResponse) IsSetBase() bool {
	return p.Base != nil
}

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

	var fieldTypeId thrift.TType
	var fieldId int16
	var issetClusterId bool = false
	var issetNamespace bool = false
	var issetName 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.STRING {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
				issetClusterId = true
			} 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
				}
				issetNamespace = true
			} 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
				}
				issetName = true
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		case 255:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField255(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
	}

	if !issetClusterId {
		fieldId = 1
		goto RequiredFieldNotSetError
	}

	if !issetNamespace {
		fieldId = 2
		goto RequiredFieldNotSetError
	}

	if !issetName {
		fieldId = 3
		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_CreateIngressResponse[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_CreateIngressResponse[fieldId]))
}

func (p *CreateIngressResponse) ReadField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.ClusterId = v
	}
	return nil
}

func (p *CreateIngressResponse) ReadField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.Namespace = v
	}
	return nil
}

func (p *CreateIngressResponse) ReadField3(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.Name = v
	}
	return nil
}

func (p *CreateIngressResponse) ReadField255(iprot thrift.TProtocol) error {
	p.Base = base.NewBase()
	if err := p.Base.Read(iprot); err != nil {
		return err
	}
	return nil
}

func (p *CreateIngressResponse) Write(oprot thrift.TProtocol) (err error) {
	var fieldId int16
	if err = oprot.WriteStructBegin("CreateIngressResponse"); 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.writeField255(oprot); err != nil {
			fieldId = 255
			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 *CreateIngressResponse) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("ClusterId", thrift.STRING, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.ClusterId); 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 *CreateIngressResponse) 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 *CreateIngressResponse) 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 *CreateIngressResponse) writeField255(oprot thrift.TProtocol) (err error) {
	if p.IsSetBase() {
		if err = oprot.WriteFieldBegin("Base", thrift.STRUCT, 255); err != nil {
			goto WriteFieldBeginError
		}
		if err := p.Base.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 255 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err)
}

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

func (p *CreateIngressResponse) DeepEqual(ano *CreateIngressResponse) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.ClusterId) {
		return false
	}
	if !p.Field2DeepEqual(ano.Namespace) {
		return false
	}
	if !p.Field3DeepEqual(ano.Name) {
		return false
	}
	if !p.Field255DeepEqual(ano.Base) {
		return false
	}
	return true
}

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

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

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

	if strings.Compare(p.Name, src) != 0 {
		return false
	}
	return true
}
func (p *CreateIngressResponse) Field255DeepEqual(src *base.Base) bool {

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

type GetIngressRequest struct {
	ClusterId string         `thrift:"ClusterId,1,required" validate:"required"`
	Namespace string         `thrift:"Namespace,2,required" validate:"required"`
	Name      string         `thrift:"Name,3,required" validate:"required,k8sName"`
	Top       *base.TopParam `thrift:"Top,254,required" json:"Top"`
	Base      *base.Base     `thrift:"Base,255" json:"Base,omitempty"`
}

func NewGetIngressRequest() *GetIngressRequest {
	return &GetIngressRequest{}
}

func (p *GetIngressRequest) GetClusterId() (v string) {
	return p.ClusterId
}

func (p *GetIngressRequest) GetNamespace() (v string) {
	return p.Namespace
}

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

var GetIngressRequest_Top_DEFAULT *base.TopParam

func (p *GetIngressRequest) GetTop() (v *base.TopParam) {
	if !p.IsSetTop() {
		return GetIngressRequest_Top_DEFAULT
	}
	return p.Top
}

var GetIngressRequest_Base_DEFAULT *base.Base

func (p *GetIngressRequest) GetBase() (v *base.Base) {
	if !p.IsSetBase() {
		return GetIngressRequest_Base_DEFAULT
	}
	return p.Base
}
func (p *GetIngressRequest) SetClusterId(val string) {
	p.ClusterId = val
}
func (p *GetIngressRequest) SetNamespace(val string) {
	p.Namespace = val
}
func (p *GetIngressRequest) SetName(val string) {
	p.Name = val
}
func (p *GetIngressRequest) SetTop(val *base.TopParam) {
	p.Top = val
}
func (p *GetIngressRequest) SetBase(val *base.Base) {
	p.Base = val
}

var fieldIDToName_GetIngressRequest = map[int16]string{
	1:   "ClusterId",
	2:   "Namespace",
	3:   "Name",
	254: "Top",
	255: "Base",
}

func (p *GetIngressRequest) IsSetTop() bool {
	return p.Top != nil
}

func (p *GetIngressRequest) IsSetBase() bool {
	return p.Base != nil
}

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

	var fieldTypeId thrift.TType
	var fieldId int16
	var issetClusterId bool = false
	var issetNamespace bool = false
	var issetName bool = false
	var issetTop 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.STRING {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
				issetClusterId = true
			} 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
				}
				issetNamespace = true
			} 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
				}
				issetName = true
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		case 254:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField254(iprot); err != nil {
					goto ReadFieldError
				}
				issetTop = true
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		case 255:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField255(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
	}

	if !issetClusterId {
		fieldId = 1
		goto RequiredFieldNotSetError
	}

	if !issetNamespace {
		fieldId = 2
		goto RequiredFieldNotSetError
	}

	if !issetName {
		fieldId = 3
		goto RequiredFieldNotSetError
	}

	if !issetTop {
		fieldId = 254
		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_GetIngressRequest[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_GetIngressRequest[fieldId]))
}

func (p *GetIngressRequest) ReadField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.ClusterId = v
	}
	return nil
}

func (p *GetIngressRequest) ReadField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.Namespace = v
	}
	return nil
}

func (p *GetIngressRequest) ReadField3(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.Name = v
	}
	return nil
}

func (p *GetIngressRequest) ReadField254(iprot thrift.TProtocol) error {
	p.Top = base.NewTopParam()
	if err := p.Top.Read(iprot); err != nil {
		return err
	}
	return nil
}

func (p *GetIngressRequest) ReadField255(iprot thrift.TProtocol) error {
	p.Base = base.NewBase()
	if err := p.Base.Read(iprot); err != nil {
		return err
	}
	return nil
}

func (p *GetIngressRequest) Write(oprot thrift.TProtocol) (err error) {
	var fieldId int16
	if err = oprot.WriteStructBegin("GetIngressRequest"); 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.writeField254(oprot); err != nil {
			fieldId = 254
			goto WriteFieldError
		}
		if err = p.writeField255(oprot); err != nil {
			fieldId = 255
			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 *GetIngressRequest) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("ClusterId", thrift.STRING, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.ClusterId); 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 *GetIngressRequest) 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 *GetIngressRequest) 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 *GetIngressRequest) writeField254(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("Top", thrift.STRUCT, 254); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Top.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 254 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 254 end error: ", p), err)
}

func (p *GetIngressRequest) writeField255(oprot thrift.TProtocol) (err error) {
	if p.IsSetBase() {
		if err = oprot.WriteFieldBegin("Base", thrift.STRUCT, 255); err != nil {
			goto WriteFieldBeginError
		}
		if err := p.Base.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 255 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err)
}

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

func (p *GetIngressRequest) DeepEqual(ano *GetIngressRequest) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.ClusterId) {
		return false
	}
	if !p.Field2DeepEqual(ano.Namespace) {
		return false
	}
	if !p.Field3DeepEqual(ano.Name) {
		return false
	}
	if !p.Field254DeepEqual(ano.Top) {
		return false
	}
	if !p.Field255DeepEqual(ano.Base) {
		return false
	}
	return true
}

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

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

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

	if strings.Compare(p.Name, src) != 0 {
		return false
	}
	return true
}
func (p *GetIngressRequest) Field254DeepEqual(src *base.TopParam) bool {

	if !p.Top.DeepEqual(src) {
		return false
	}
	return true
}
func (p *GetIngressRequest) Field255DeepEqual(src *base.Base) bool {

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

type GetIngressResponse struct {
	Name          string             `thrift:"Name,1,required" json:"Name"`
	Region        string             `thrift:"Region,2,required" json:"Region"`
	ClusterId     string             `thrift:"ClusterId,3,required" json:"ClusterId"`
	Namespace     string             `thrift:"Namespace,4,required" json:"Namespace"`
	Description   string             `thrift:"Description,5,required" json:"Description"`
	SessionSticky bool               `thrift:"SessionSticky,6,required" json:"SessionSticky"`
	Type          string             `thrift:"Type,7,required" json:"Type"`
	Vip           string             `thrift:"Vip,8,required" json:"Vip"`
	Listeners     []*IngressListener `thrift:"Listeners,9,required" json:"Listeners"`
	Rules         []*Rule            `thrift:"Rules,10,required" json:"Rules"`
	CreateTime    string             `thrift:"CreateTime,11,required" json:"CreateTime"`
	Base          *base.Base         `thrift:"Base,255" json:"Base,omitempty"`
}

func NewGetIngressResponse() *GetIngressResponse {
	return &GetIngressResponse{}
}

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

func (p *GetIngressResponse) GetRegion() (v string) {
	return p.Region
}

func (p *GetIngressResponse) GetClusterId() (v string) {
	return p.ClusterId
}

func (p *GetIngressResponse) GetNamespace() (v string) {
	return p.Namespace
}

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

func (p *GetIngressResponse) GetSessionSticky() (v bool) {
	return p.SessionSticky
}

func (p *GetIngressResponse) GetType() (v string) {
	return p.Type
}

func (p *GetIngressResponse) GetVip() (v string) {
	return p.Vip
}

func (p *GetIngressResponse) GetListeners() (v []*IngressListener) {
	return p.Listeners
}

func (p *GetIngressResponse) GetRules() (v []*Rule) {
	return p.Rules
}

func (p *GetIngressResponse) GetCreateTime() (v string) {
	return p.CreateTime
}

var GetIngressResponse_Base_DEFAULT *base.Base

func (p *GetIngressResponse) GetBase() (v *base.Base) {
	if !p.IsSetBase() {
		return GetIngressResponse_Base_DEFAULT
	}
	return p.Base
}
func (p *GetIngressResponse) SetName(val string) {
	p.Name = val
}
func (p *GetIngressResponse) SetRegion(val string) {
	p.Region = val
}
func (p *GetIngressResponse) SetClusterId(val string) {
	p.ClusterId = val
}
func (p *GetIngressResponse) SetNamespace(val string) {
	p.Namespace = val
}
func (p *GetIngressResponse) SetDescription(val string) {
	p.Description = val
}
func (p *GetIngressResponse) SetSessionSticky(val bool) {
	p.SessionSticky = val
}
func (p *GetIngressResponse) SetType(val string) {
	p.Type = val
}
func (p *GetIngressResponse) SetVip(val string) {
	p.Vip = val
}
func (p *GetIngressResponse) SetListeners(val []*IngressListener) {
	p.Listeners = val
}
func (p *GetIngressResponse) SetRules(val []*Rule) {
	p.Rules = val
}
func (p *GetIngressResponse) SetCreateTime(val string) {
	p.CreateTime = val
}
func (p *GetIngressResponse) SetBase(val *base.Base) {
	p.Base = val
}

var fieldIDToName_GetIngressResponse = map[int16]string{
	1:   "Name",
	2:   "Region",
	3:   "ClusterId",
	4:   "Namespace",
	5:   "Description",
	6:   "SessionSticky",
	7:   "Type",
	8:   "Vip",
	9:   "Listeners",
	10:  "Rules",
	11:  "CreateTime",
	255: "Base",
}

func (p *GetIngressResponse) IsSetBase() bool {
	return p.Base != nil
}

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

	var fieldTypeId thrift.TType
	var fieldId int16
	var issetName bool = false
	var issetRegion bool = false
	var issetClusterId bool = false
	var issetNamespace bool = false
	var issetDescription bool = false
	var issetSessionSticky bool = false
	var issetType bool = false
	var issetVip bool = false
	var issetListeners bool = false
	var issetRules bool = false
	var issetCreateTime 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.STRING {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
				issetName = true
			} 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
				}
				issetRegion = true
			} 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
				}
				issetClusterId = true
			} 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
				}
				issetNamespace = true
			} 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
				}
				issetDescription = true
			} 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
				}
				issetSessionSticky = true
			} 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
				}
				issetType = true
			} 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
				}
				issetVip = true
			} 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
				}
				issetListeners = true
			} 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
				}
				issetRules = true
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		case 11:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField11(iprot); err != nil {
					goto ReadFieldError
				}
				issetCreateTime = true
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		case 255:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField255(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
	}

	if !issetName {
		fieldId = 1
		goto RequiredFieldNotSetError
	}

	if !issetRegion {
		fieldId = 2
		goto RequiredFieldNotSetError
	}

	if !issetClusterId {
		fieldId = 3
		goto RequiredFieldNotSetError
	}

	if !issetNamespace {
		fieldId = 4
		goto RequiredFieldNotSetError
	}

	if !issetDescription {
		fieldId = 5
		goto RequiredFieldNotSetError
	}

	if !issetSessionSticky {
		fieldId = 6
		goto RequiredFieldNotSetError
	}

	if !issetType {
		fieldId = 7
		goto RequiredFieldNotSetError
	}

	if !issetVip {
		fieldId = 8
		goto RequiredFieldNotSetError
	}

	if !issetListeners {
		fieldId = 9
		goto RequiredFieldNotSetError
	}

	if !issetRules {
		fieldId = 10
		goto RequiredFieldNotSetError
	}

	if !issetCreateTime {
		fieldId = 11
		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_GetIngressResponse[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_GetIngressResponse[fieldId]))
}

func (p *GetIngressResponse) ReadField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.Name = v
	}
	return nil
}

func (p *GetIngressResponse) ReadField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.Region = v
	}
	return nil
}

func (p *GetIngressResponse) ReadField3(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.ClusterId = v
	}
	return nil
}

func (p *GetIngressResponse) ReadField4(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.Namespace = v
	}
	return nil
}

func (p *GetIngressResponse) ReadField5(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.Description = v
	}
	return nil
}

func (p *GetIngressResponse) ReadField6(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadBool(); err != nil {
		return err
	} else {
		p.SessionSticky = v
	}
	return nil
}

func (p *GetIngressResponse) ReadField7(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.Type = v
	}
	return nil
}

func (p *GetIngressResponse) ReadField8(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.Vip = v
	}
	return nil
}

func (p *GetIngressResponse) ReadField9(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	p.Listeners = make([]*IngressListener, 0, size)
	for i := 0; i < size; i++ {
		_elem := NewIngressListener()
		if err := _elem.Read(iprot); err != nil {
			return err
		}

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

func (p *GetIngressResponse) ReadField10(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	p.Rules = make([]*Rule, 0, size)
	for i := 0; i < size; i++ {
		_elem := NewRule()
		if err := _elem.Read(iprot); err != nil {
			return err
		}

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

func (p *GetIngressResponse) ReadField11(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.CreateTime = v
	}
	return nil
}

func (p *GetIngressResponse) ReadField255(iprot thrift.TProtocol) error {
	p.Base = base.NewBase()
	if err := p.Base.Read(iprot); err != nil {
		return err
	}
	return nil
}

func (p *GetIngressResponse) Write(oprot thrift.TProtocol) (err error) {
	var fieldId int16
	if err = oprot.WriteStructBegin("GetIngressResponse"); 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.writeField255(oprot); err != nil {
			fieldId = 255
			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 *GetIngressResponse) 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 *GetIngressResponse) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("Region", thrift.STRING, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.Region); 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 *GetIngressResponse) writeField3(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("ClusterId", thrift.STRING, 3); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.ClusterId); 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 *GetIngressResponse) writeField4(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("Namespace", thrift.STRING, 4); 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 4 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err)
}

func (p *GetIngressResponse) 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 *GetIngressResponse) writeField6(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("SessionSticky", thrift.BOOL, 6); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteBool(p.SessionSticky); 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 *GetIngressResponse) writeField7(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("Type", thrift.STRING, 7); 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 7 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 7 end error: ", p), err)
}

func (p *GetIngressResponse) writeField8(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("Vip", thrift.STRING, 8); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.Vip); 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 *GetIngressResponse) writeField9(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("Listeners", thrift.LIST, 9); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Listeners)); err != nil {
		return err
	}
	for _, v := range p.Listeners {
		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 *GetIngressResponse) writeField10(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("Rules", thrift.LIST, 10); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Rules)); err != nil {
		return err
	}
	for _, v := range p.Rules {
		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 *GetIngressResponse) writeField11(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("CreateTime", thrift.STRING, 11); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.CreateTime); 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 *GetIngressResponse) writeField255(oprot thrift.TProtocol) (err error) {
	if p.IsSetBase() {
		if err = oprot.WriteFieldBegin("Base", thrift.STRUCT, 255); err != nil {
			goto WriteFieldBeginError
		}
		if err := p.Base.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 255 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err)
}

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

func (p *GetIngressResponse) DeepEqual(ano *GetIngressResponse) 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.Region) {
		return false
	}
	if !p.Field3DeepEqual(ano.ClusterId) {
		return false
	}
	if !p.Field4DeepEqual(ano.Namespace) {
		return false
	}
	if !p.Field5DeepEqual(ano.Description) {
		return false
	}
	if !p.Field6DeepEqual(ano.SessionSticky) {
		return false
	}
	if !p.Field7DeepEqual(ano.Type) {
		return false
	}
	if !p.Field8DeepEqual(ano.Vip) {
		return false
	}
	if !p.Field9DeepEqual(ano.Listeners) {
		return false
	}
	if !p.Field10DeepEqual(ano.Rules) {
		return false
	}
	if !p.Field11DeepEqual(ano.CreateTime) {
		return false
	}
	if !p.Field255DeepEqual(ano.Base) {
		return false
	}
	return true
}

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

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

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

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

	if strings.Compare(p.Namespace, src) != 0 {
		return false
	}
	return true
}
func (p *GetIngressResponse) Field5DeepEqual(src string) bool {

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

	if p.SessionSticky != src {
		return false
	}
	return true
}
func (p *GetIngressResponse) Field7DeepEqual(src string) bool {

	if strings.Compare(p.Type, src) != 0 {
		return false
	}
	return true
}
func (p *GetIngressResponse) Field8DeepEqual(src string) bool {

	if strings.Compare(p.Vip, src) != 0 {
		return false
	}
	return true
}
func (p *GetIngressResponse) Field9DeepEqual(src []*IngressListener) bool {

	if len(p.Listeners) != len(src) {
		return false
	}
	for i, v := range p.Listeners {
		_src := src[i]
		if !v.DeepEqual(_src) {
			return false
		}
	}
	return true
}
func (p *GetIngressResponse) Field10DeepEqual(src []*Rule) bool {

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

	if strings.Compare(p.CreateTime, src) != 0 {
		return false
	}
	return true
}
func (p *GetIngressResponse) Field255DeepEqual(src *base.Base) bool {

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

type DeleteIngressRequest struct {
	ClusterId string         `thrift:"ClusterId,1,required" validate:"required"`
	Namespace string         `thrift:"Namespace,2,required" validate:"required"`
	Name      string         `thrift:"Name,3,required" validate:"required,k8sName"`
	Top       *base.TopParam `thrift:"Top,254,required" json:"Top"`
	Base      *base.Base     `thrift:"Base,255" json:"Base,omitempty"`
}

func NewDeleteIngressRequest() *DeleteIngressRequest {
	return &DeleteIngressRequest{}
}

func (p *DeleteIngressRequest) GetClusterId() (v string) {
	return p.ClusterId
}

func (p *DeleteIngressRequest) GetNamespace() (v string) {
	return p.Namespace
}

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

var DeleteIngressRequest_Top_DEFAULT *base.TopParam

func (p *DeleteIngressRequest) GetTop() (v *base.TopParam) {
	if !p.IsSetTop() {
		return DeleteIngressRequest_Top_DEFAULT
	}
	return p.Top
}

var DeleteIngressRequest_Base_DEFAULT *base.Base

func (p *DeleteIngressRequest) GetBase() (v *base.Base) {
	if !p.IsSetBase() {
		return DeleteIngressRequest_Base_DEFAULT
	}
	return p.Base
}
func (p *DeleteIngressRequest) SetClusterId(val string) {
	p.ClusterId = val
}
func (p *DeleteIngressRequest) SetNamespace(val string) {
	p.Namespace = val
}
func (p *DeleteIngressRequest) SetName(val string) {
	p.Name = val
}
func (p *DeleteIngressRequest) SetTop(val *base.TopParam) {
	p.Top = val
}
func (p *DeleteIngressRequest) SetBase(val *base.Base) {
	p.Base = val
}

var fieldIDToName_DeleteIngressRequest = map[int16]string{
	1:   "ClusterId",
	2:   "Namespace",
	3:   "Name",
	254: "Top",
	255: "Base",
}

func (p *DeleteIngressRequest) IsSetTop() bool {
	return p.Top != nil
}

func (p *DeleteIngressRequest) IsSetBase() bool {
	return p.Base != nil
}

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

	var fieldTypeId thrift.TType
	var fieldId int16
	var issetClusterId bool = false
	var issetNamespace bool = false
	var issetName bool = false
	var issetTop 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.STRING {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
				issetClusterId = true
			} 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
				}
				issetNamespace = true
			} 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
				}
				issetName = true
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		case 254:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField254(iprot); err != nil {
					goto ReadFieldError
				}
				issetTop = true
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		case 255:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField255(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
	}

	if !issetClusterId {
		fieldId = 1
		goto RequiredFieldNotSetError
	}

	if !issetNamespace {
		fieldId = 2
		goto RequiredFieldNotSetError
	}

	if !issetName {
		fieldId = 3
		goto RequiredFieldNotSetError
	}

	if !issetTop {
		fieldId = 254
		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_DeleteIngressRequest[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_DeleteIngressRequest[fieldId]))
}

func (p *DeleteIngressRequest) ReadField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.ClusterId = v
	}
	return nil
}

func (p *DeleteIngressRequest) ReadField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.Namespace = v
	}
	return nil
}

func (p *DeleteIngressRequest) ReadField3(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.Name = v
	}
	return nil
}

func (p *DeleteIngressRequest) ReadField254(iprot thrift.TProtocol) error {
	p.Top = base.NewTopParam()
	if err := p.Top.Read(iprot); err != nil {
		return err
	}
	return nil
}

func (p *DeleteIngressRequest) ReadField255(iprot thrift.TProtocol) error {
	p.Base = base.NewBase()
	if err := p.Base.Read(iprot); err != nil {
		return err
	}
	return nil
}

func (p *DeleteIngressRequest) Write(oprot thrift.TProtocol) (err error) {
	var fieldId int16
	if err = oprot.WriteStructBegin("DeleteIngressRequest"); 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.writeField254(oprot); err != nil {
			fieldId = 254
			goto WriteFieldError
		}
		if err = p.writeField255(oprot); err != nil {
			fieldId = 255
			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 *DeleteIngressRequest) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("ClusterId", thrift.STRING, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.ClusterId); 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 *DeleteIngressRequest) 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 *DeleteIngressRequest) 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 *DeleteIngressRequest) writeField254(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("Top", thrift.STRUCT, 254); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Top.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 254 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 254 end error: ", p), err)
}

func (p *DeleteIngressRequest) writeField255(oprot thrift.TProtocol) (err error) {
	if p.IsSetBase() {
		if err = oprot.WriteFieldBegin("Base", thrift.STRUCT, 255); err != nil {
			goto WriteFieldBeginError
		}
		if err := p.Base.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 255 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err)
}

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

func (p *DeleteIngressRequest) DeepEqual(ano *DeleteIngressRequest) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.ClusterId) {
		return false
	}
	if !p.Field2DeepEqual(ano.Namespace) {
		return false
	}
	if !p.Field3DeepEqual(ano.Name) {
		return false
	}
	if !p.Field254DeepEqual(ano.Top) {
		return false
	}
	if !p.Field255DeepEqual(ano.Base) {
		return false
	}
	return true
}

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

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

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

	if strings.Compare(p.Name, src) != 0 {
		return false
	}
	return true
}
func (p *DeleteIngressRequest) Field254DeepEqual(src *base.TopParam) bool {

	if !p.Top.DeepEqual(src) {
		return false
	}
	return true
}
func (p *DeleteIngressRequest) Field255DeepEqual(src *base.Base) bool {

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

type DeleteIngressResponse struct {
}

func NewDeleteIngressResponse() *DeleteIngressResponse {
	return &DeleteIngressResponse{}
}

var fieldIDToName_DeleteIngressResponse = map[int16]string{}

func (p *DeleteIngressResponse) 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
		}
		if err = iprot.Skip(fieldTypeId); err != nil {
			goto SkipFieldTypeError
		}

		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)
SkipFieldTypeError:
	return thrift.PrependError(fmt.Sprintf("%T skip field type %d error", p, 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 *DeleteIngressResponse) Write(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteStructBegin("DeleteIngressResponse"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {

	}
	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)
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 *DeleteIngressResponse) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("DeleteIngressResponse(%+v)", *p)
}

func (p *DeleteIngressResponse) DeepEqual(ano *DeleteIngressResponse) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	return true
}

type GetSecretDomainsRequest struct {
	ClusterId string         `thrift:"ClusterId,1,required" json:"ClusterId"`
	Namespace string         `thrift:"Namespace,2,required" json:"Namespace"`
	Names     []string       `thrift:"Names,3,required" json:"Names"`
	Top       *base.TopParam `thrift:"Top,254,required" json:"Top"`
	Base      *base.Base     `thrift:"Base,255" json:"Base,omitempty"`
}

func NewGetSecretDomainsRequest() *GetSecretDomainsRequest {
	return &GetSecretDomainsRequest{}
}

func (p *GetSecretDomainsRequest) GetClusterId() (v string) {
	return p.ClusterId
}

func (p *GetSecretDomainsRequest) GetNamespace() (v string) {
	return p.Namespace
}

func (p *GetSecretDomainsRequest) GetNames() (v []string) {
	return p.Names
}

var GetSecretDomainsRequest_Top_DEFAULT *base.TopParam

func (p *GetSecretDomainsRequest) GetTop() (v *base.TopParam) {
	if !p.IsSetTop() {
		return GetSecretDomainsRequest_Top_DEFAULT
	}
	return p.Top
}

var GetSecretDomainsRequest_Base_DEFAULT *base.Base

func (p *GetSecretDomainsRequest) GetBase() (v *base.Base) {
	if !p.IsSetBase() {
		return GetSecretDomainsRequest_Base_DEFAULT
	}
	return p.Base
}
func (p *GetSecretDomainsRequest) SetClusterId(val string) {
	p.ClusterId = val
}
func (p *GetSecretDomainsRequest) SetNamespace(val string) {
	p.Namespace = val
}
func (p *GetSecretDomainsRequest) SetNames(val []string) {
	p.Names = val
}
func (p *GetSecretDomainsRequest) SetTop(val *base.TopParam) {
	p.Top = val
}
func (p *GetSecretDomainsRequest) SetBase(val *base.Base) {
	p.Base = val
}

var fieldIDToName_GetSecretDomainsRequest = map[int16]string{
	1:   "ClusterId",
	2:   "Namespace",
	3:   "Names",
	254: "Top",
	255: "Base",
}

func (p *GetSecretDomainsRequest) IsSetTop() bool {
	return p.Top != nil
}

func (p *GetSecretDomainsRequest) IsSetBase() bool {
	return p.Base != nil
}

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

	var fieldTypeId thrift.TType
	var fieldId int16
	var issetClusterId bool = false
	var issetNamespace bool = false
	var issetNames bool = false
	var issetTop 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.STRING {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
				issetClusterId = true
			} 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
				}
				issetNamespace = true
			} 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
				}
				issetNames = true
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		case 254:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField254(iprot); err != nil {
					goto ReadFieldError
				}
				issetTop = true
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		case 255:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField255(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
	}

	if !issetClusterId {
		fieldId = 1
		goto RequiredFieldNotSetError
	}

	if !issetNamespace {
		fieldId = 2
		goto RequiredFieldNotSetError
	}

	if !issetNames {
		fieldId = 3
		goto RequiredFieldNotSetError
	}

	if !issetTop {
		fieldId = 254
		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_GetSecretDomainsRequest[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_GetSecretDomainsRequest[fieldId]))
}

func (p *GetSecretDomainsRequest) ReadField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.ClusterId = v
	}
	return nil
}

func (p *GetSecretDomainsRequest) ReadField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.Namespace = v
	}
	return nil
}

func (p *GetSecretDomainsRequest) ReadField3(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	p.Names = 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
		}

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

func (p *GetSecretDomainsRequest) ReadField254(iprot thrift.TProtocol) error {
	p.Top = base.NewTopParam()
	if err := p.Top.Read(iprot); err != nil {
		return err
	}
	return nil
}

func (p *GetSecretDomainsRequest) ReadField255(iprot thrift.TProtocol) error {
	p.Base = base.NewBase()
	if err := p.Base.Read(iprot); err != nil {
		return err
	}
	return nil
}

func (p *GetSecretDomainsRequest) Write(oprot thrift.TProtocol) (err error) {
	var fieldId int16
	if err = oprot.WriteStructBegin("GetSecretDomainsRequest"); 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.writeField254(oprot); err != nil {
			fieldId = 254
			goto WriteFieldError
		}
		if err = p.writeField255(oprot); err != nil {
			fieldId = 255
			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 *GetSecretDomainsRequest) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("ClusterId", thrift.STRING, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.ClusterId); 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 *GetSecretDomainsRequest) 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 *GetSecretDomainsRequest) writeField3(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("Names", thrift.LIST, 3); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRING, len(p.Names)); err != nil {
		return err
	}
	for _, v := range p.Names {
		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 3 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err)
}

func (p *GetSecretDomainsRequest) writeField254(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("Top", thrift.STRUCT, 254); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Top.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 254 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 254 end error: ", p), err)
}

func (p *GetSecretDomainsRequest) writeField255(oprot thrift.TProtocol) (err error) {
	if p.IsSetBase() {
		if err = oprot.WriteFieldBegin("Base", thrift.STRUCT, 255); err != nil {
			goto WriteFieldBeginError
		}
		if err := p.Base.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 255 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err)
}

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

func (p *GetSecretDomainsRequest) DeepEqual(ano *GetSecretDomainsRequest) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.ClusterId) {
		return false
	}
	if !p.Field2DeepEqual(ano.Namespace) {
		return false
	}
	if !p.Field3DeepEqual(ano.Names) {
		return false
	}
	if !p.Field254DeepEqual(ano.Top) {
		return false
	}
	if !p.Field255DeepEqual(ano.Base) {
		return false
	}
	return true
}

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

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

	if strings.Compare(p.Namespace, src) != 0 {
		return false
	}
	return true
}
func (p *GetSecretDomainsRequest) Field3DeepEqual(src []string) bool {

	if len(p.Names) != len(src) {
		return false
	}
	for i, v := range p.Names {
		_src := src[i]
		if strings.Compare(v, _src) != 0 {
			return false
		}
	}
	return true
}
func (p *GetSecretDomainsRequest) Field254DeepEqual(src *base.TopParam) bool {

	if !p.Top.DeepEqual(src) {
		return false
	}
	return true
}
func (p *GetSecretDomainsRequest) Field255DeepEqual(src *base.Base) bool {

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

type SecretDomain struct {
	SecretName string   `thrift:"SecretName,1,required" json:"SecretName"`
	Domains    []string `thrift:"Domains,2,required" json:"Domains"`
}

func NewSecretDomain() *SecretDomain {
	return &SecretDomain{}
}

func (p *SecretDomain) GetSecretName() (v string) {
	return p.SecretName
}

func (p *SecretDomain) GetDomains() (v []string) {
	return p.Domains
}
func (p *SecretDomain) SetSecretName(val string) {
	p.SecretName = val
}
func (p *SecretDomain) SetDomains(val []string) {
	p.Domains = val
}

var fieldIDToName_SecretDomain = map[int16]string{
	1: "SecretName",
	2: "Domains",
}

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

	var fieldTypeId thrift.TType
	var fieldId int16
	var issetSecretName bool = false
	var issetDomains 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.STRING {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
				issetSecretName = true
			} 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
				}
				issetDomains = 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 !issetSecretName {
		fieldId = 1
		goto RequiredFieldNotSetError
	}

	if !issetDomains {
		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_SecretDomain[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_SecretDomain[fieldId]))
}

func (p *SecretDomain) ReadField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.SecretName = v
	}
	return nil
}

func (p *SecretDomain) ReadField2(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	p.Domains = 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
		}

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

func (p *SecretDomain) Write(oprot thrift.TProtocol) (err error) {
	var fieldId int16
	if err = oprot.WriteStructBegin("SecretDomain"); 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 *SecretDomain) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("SecretName", thrift.STRING, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.SecretName); 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 *SecretDomain) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("Domains", thrift.LIST, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRING, len(p.Domains)); err != nil {
		return err
	}
	for _, v := range p.Domains {
		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 *SecretDomain) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("SecretDomain(%+v)", *p)
}

func (p *SecretDomain) DeepEqual(ano *SecretDomain) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.SecretName) {
		return false
	}
	if !p.Field2DeepEqual(ano.Domains) {
		return false
	}
	return true
}

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

	if strings.Compare(p.SecretName, src) != 0 {
		return false
	}
	return true
}
func (p *SecretDomain) Field2DeepEqual(src []string) bool {

	if len(p.Domains) != len(src) {
		return false
	}
	for i, v := range p.Domains {
		_src := src[i]
		if strings.Compare(v, _src) != 0 {
			return false
		}
	}
	return true
}

type GetSecretDomainsResponse struct {
	SecretDomains []*SecretDomain `thrift:"SecretDomains,1,required" json:"SecretDomains"`
	Base          *base.Base      `thrift:"Base,255" json:"Base,omitempty"`
}

func NewGetSecretDomainsResponse() *GetSecretDomainsResponse {
	return &GetSecretDomainsResponse{}
}

func (p *GetSecretDomainsResponse) GetSecretDomains() (v []*SecretDomain) {
	return p.SecretDomains
}

var GetSecretDomainsResponse_Base_DEFAULT *base.Base

func (p *GetSecretDomainsResponse) GetBase() (v *base.Base) {
	if !p.IsSetBase() {
		return GetSecretDomainsResponse_Base_DEFAULT
	}
	return p.Base
}
func (p *GetSecretDomainsResponse) SetSecretDomains(val []*SecretDomain) {
	p.SecretDomains = val
}
func (p *GetSecretDomainsResponse) SetBase(val *base.Base) {
	p.Base = val
}

var fieldIDToName_GetSecretDomainsResponse = map[int16]string{
	1:   "SecretDomains",
	255: "Base",
}

func (p *GetSecretDomainsResponse) IsSetBase() bool {
	return p.Base != nil
}

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

	var fieldTypeId thrift.TType
	var fieldId int16
	var issetSecretDomains 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.LIST {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
				issetSecretDomains = true
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		case 255:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField255(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
	}

	if !issetSecretDomains {
		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_GetSecretDomainsResponse[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_GetSecretDomainsResponse[fieldId]))
}

func (p *GetSecretDomainsResponse) ReadField1(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	p.SecretDomains = make([]*SecretDomain, 0, size)
	for i := 0; i < size; i++ {
		_elem := NewSecretDomain()
		if err := _elem.Read(iprot); err != nil {
			return err
		}

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

func (p *GetSecretDomainsResponse) ReadField255(iprot thrift.TProtocol) error {
	p.Base = base.NewBase()
	if err := p.Base.Read(iprot); err != nil {
		return err
	}
	return nil
}

func (p *GetSecretDomainsResponse) Write(oprot thrift.TProtocol) (err error) {
	var fieldId int16
	if err = oprot.WriteStructBegin("GetSecretDomainsResponse"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
		if err = p.writeField255(oprot); err != nil {
			fieldId = 255
			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 *GetSecretDomainsResponse) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("SecretDomains", thrift.LIST, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.SecretDomains)); err != nil {
		return err
	}
	for _, v := range p.SecretDomains {
		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 *GetSecretDomainsResponse) writeField255(oprot thrift.TProtocol) (err error) {
	if p.IsSetBase() {
		if err = oprot.WriteFieldBegin("Base", thrift.STRUCT, 255); err != nil {
			goto WriteFieldBeginError
		}
		if err := p.Base.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 255 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err)
}

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

func (p *GetSecretDomainsResponse) DeepEqual(ano *GetSecretDomainsResponse) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.SecretDomains) {
		return false
	}
	if !p.Field255DeepEqual(ano.Base) {
		return false
	}
	return true
}

func (p *GetSecretDomainsResponse) Field1DeepEqual(src []*SecretDomain) bool {

	if len(p.SecretDomains) != len(src) {
		return false
	}
	for i, v := range p.SecretDomains {
		_src := src[i]
		if !v.DeepEqual(_src) {
			return false
		}
	}
	return true
}
func (p *GetSecretDomainsResponse) Field255DeepEqual(src *base.Base) bool {

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